-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
128 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,48 @@ | ||
= Run SQL | ||
|
||
#TODO# | ||
`run-sql` command can be used to execute SQL scripts on database. | ||
|
||
Database schema changes are implemented in SQL scripts that are bundled with distribution in folder `doc/config/sql/native/*.sql`. | ||
User can use `--mode [repository|audit]` switch together with `--upgrade` to run proper scripts automatically or use `--scripts` option to specify custom set of scripts. | ||
|
||
Run-sql command can be used also to create database schema from scratch using switch `--create`. | ||
|
||
Ninja by default uses repository/audit configuration from _midpoint-home/config.xml_ to connect to database. | ||
This behaviour can be changed via `--jdbc-url`, `--jdbc-username` and `--jdbc-password` options. | ||
With these options, ninja will switch to _raw_ mode, create custom JDBC connection and execute scripts on it. | ||
|
||
If `--result` switch is used, ninja will print results for each query in script to SYSOUT, otherwise results are ignored. | ||
|
||
.Example runs custom-upgrade-database.sql script on JDBC connection specified by url/username/password | ||
[source,bash] | ||
---- | ||
./bin/ninja.sh run-sql \ | ||
--jdbc-url jdbc:postgresql://localhost:5432/postgres \ | ||
--jdbc-username postgres \ | ||
--jdbc-password postgres \ | ||
--scripts ./custom-upgrade-database.sql | ||
---- | ||
|
||
.This example runs upgrade scripts for repository on database defined in midpoint-home/config.xml | ||
[source,bash] | ||
---- | ||
./bin/ninja.sh run-sql \ | ||
--mode repository \ | ||
--upgrade | ||
---- | ||
|
||
.Following example runs upgrade scripts for repository on database defined in midpoint-home/config.xml | ||
[source,bash] | ||
---- | ||
./bin/ninja.sh run-sql \ | ||
--mode audit \ | ||
--upgrade | ||
---- | ||
|
||
.This example runs custom defined scripts for audit on database defined in midpoint-home/config.xml | ||
[source,bash] | ||
---- | ||
./bin/ninja.sh run-sql \ | ||
--mode repository \ | ||
--scripts ./upgrade/new-distribution/doc/config/sql/native/postgres-upgrade.sql | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
= Upgrade installation | ||
|
||
#TODO# | ||
Upgrade installation command will copy and replace files in midPoint installation directory using files from distribution. | ||
By default, installation directory is computed as a parent of midpoint-home directory. | ||
This behaviour can be changed using `--installation-directory <PATH>` option. | ||
|
||
All files that would be replaced can be backed up if necessary using `--backup-installation-directory <path>` option. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters