From: Jean-Marc Pigeon (Delson) Date: Thu, 26 Jun 2025 17:03:02 +0000 (-0400) Subject: Creating table at init level for postgresql X-Git-Tag: tag-0.10~8 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=9dd7578be693c4e75085f2414997422bc0531813;p=jmp%2Fmailleur Creating table at init level for postgresql --- diff --git a/support/crdb.sh b/support/crdb.sh index 694486d..69cc58b 100755 --- a/support/crdb.sh +++ b/support/crdb.sh @@ -59,6 +59,7 @@ case "$DB_TYPE" in ;; "POSTGRESQL" ) SQL="/usr/bin/psql -q" + MSQL="/usr/bin/psql -U $APPNAME -q $APPNAME" /etc/rc.d/init.d/postgresql status if [ $? != 0 ] ; then echo "Postgresql serveur NOT found up and running (exiting!)" @@ -85,3 +86,7 @@ case "$DB_TYPE" in #undefined database type at that stage? ;; esac +#loading database definition +if [ -n "$MSQL" ] ; then + cpp -P -D$DB_TYPE /usr/share/$APPNAME/sql/$APPNAME.sql | $MSQL + fi