Skip to content

Commit

Permalink
Upgraded distribution script when removing suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
tonydamage committed Aug 30, 2023
1 parent b8e867c commit 23c5d37
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions config/sql/README.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Subdirectories contain SQL schema scripts for two repository implementations:

* generic-old: This was the only available implementation before midPoint 4.4.
It supports various SQL databases, currently PostgreSQL, Oracle and MicrosoftS
* generic: This was the only available implementation before midPoint 4.4.
It supports various SQL databases, currently Oracle and Microsoft
SQL Server is supported. Repository implementation uses Hibernate ORM system.
This repository is planned for removal after 4.4 LTS cycle.

* native-new: This is newer repository implementation that is available since
* native: This is newer repository implementation that is available since
midPoint 4.4. Only PostgreSQL from version 12 higher is supported.
This is the repository we plan to support and improve in the future.

Expand All @@ -21,10 +21,10 @@ NATIVE (NEW) REPOSITORY

SQL schema for Native repository is split into the following files:

* postgres-new.sql - main part of the repository; this is always needed.
* postgres-new-audit.sql - audit tables; this can be applied on top of the main
* postgres.sql - main part of the repository; this is always needed.
* postgres-audit.sql - audit tables; this can be applied on top of the main
repository or in a new database if separate audit database is desired.
* postgres-new-quartz.sql - tables for Quartz scheduler, can be applied safely.
* postgres-quartz.sql - tables for Quartz scheduler, can be applied safely.

Unless you plan to use separate database for audit, just apply all these schema
files in the order named above. Even if tables are not needed, no harm is done.
Expand Down
20 changes: 10 additions & 10 deletions dist/src/main/bin/midpoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@ if [ "${1}" = "init-native" ]; then
echo "MP_INIT_DB variable with target for DB init files was not set - skipping db init file processing..." >&2
else
if [ "${MP_INIT_DB_CONCAT:-}" = "" ]; then
if [ -e "${BASE_DIR}/doc/config/sql/native-new" ]; then
find "${BASE_DIR}/doc/config/sql/native-new/" -type f -name "postgres-new*.sql" ! -name "postgres-new-upgrade.sql" -exec cp \{\} "${MP_INIT_DB}/" \;
if [ -e "${BASE_DIR}/doc/config/sql/native" ]; then
find "${BASE_DIR}/doc/config/sql/native/" -type f -name "postgres*.sql" ! -name "postgres-upgrade.sql" -exec cp \{\} "${MP_INIT_DB}/" \;
else
echo "Location with sql init structure (source) have not been found..." >&2
exit 1
fi
else
if [ -e "${BASE_DIR}/doc/config/sql/native-new" ]; then

[ -e "${BASE_DIR}/doc/config/sql/native-new/postgres-new.sql" ] &&
cp "${BASE_DIR}/doc/config/sql/native-new/postgres-new.sql" "${MP_INIT_DB_CONCAT}"
[ -e "${BASE_DIR}/doc/config/sql/native-new/postgres-new-audit.sql" ] &&
cat "${BASE_DIR}/doc/config/sql/native-new/postgres-new-audit.sql" >>"${MP_INIT_DB_CONCAT}"
[ -e "${BASE_DIR}/doc/config/sql/native-new/postgres-new-quartz.sql" ] &&
cat "${BASE_DIR}/doc/config/sql/native-new/postgres-new-quartz.sql" >>"${MP_INIT_DB_CONCAT}"
if [ -e "${BASE_DIR}/doc/config/sql/native" ]; then

[ -e "${BASE_DIR}/doc/config/sql/native/postgres.sql" ] &&
cp "${BASE_DIR}/doc/config/sql/native/postgres.sql" "${MP_INIT_DB_CONCAT}"
[ -e "${BASE_DIR}/doc/config/sql/native/postgres-audit.sql" ] &&
cat "${BASE_DIR}/doc/config/sql/native/postgres-audit.sql" >>"${MP_INIT_DB_CONCAT}"
[ -e "${BASE_DIR}/doc/config/sql/native/postgres-quartz.sql" ] &&
cat "${BASE_DIR}/doc/config/sql/native/postgres-quartz.sql" >>"${MP_INIT_DB_CONCAT}"
else
echo "Location with sql init structure (source) have not been found..." >&2
exit 1
Expand Down

0 comments on commit 23c5d37

Please sign in to comment.