2010-11-04 02:46:38 +07:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# $Id: PostMigration.sh
|
|
|
|
echo Postgresql Post Migration Scripts
|
|
|
|
|
2020-09-09 00:37:00 +07:00
|
|
|
if [ $# -le 2 ]
|
2010-11-04 02:46:38 +07:00
|
|
|
then
|
|
|
|
echo "Usage: $0 <systemAccount> <AdempiereID> <AdempierePWD> <PostgresPwd>"
|
2012-06-06 21:13:34 +07:00
|
|
|
echo "Example: $0 postgres idempiere idempiere postgresPwd"
|
2010-11-04 02:46:38 +07:00
|
|
|
exit 1
|
|
|
|
fi
|
2020-09-09 00:37:00 +07:00
|
|
|
if [ "$IDEMPIERE_HOME" = "" ] || [ "$ADEMPIERE_DB_NAME" = "" ] || [ "$ADEMPIERE_DB_SERVER" = "" ] || [ "$ADEMPIERE_DB_PORT" = "" ]
|
2010-11-04 02:46:38 +07:00
|
|
|
then
|
|
|
|
echo "Please make sure that the environment variables are set correctly:"
|
2012-06-06 21:13:34 +07:00
|
|
|
echo " IDEMPIERE_HOME e.g. /idempiere"
|
|
|
|
echo " ADEMPIERE_DB_NAME e.g. idempiere"
|
|
|
|
echo " ADEMPIERE_DB_SERVER e.g. dbserver.idempiere.org"
|
|
|
|
echo " ADEMPIERE_DB_PORT e.g. 5432"
|
2010-11-04 02:46:38 +07:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
PGPASSWORD=$3
|
|
|
|
export PGPASSWORD
|
|
|
|
echo -------------------------------------
|
|
|
|
echo Add missing translations
|
|
|
|
echo -------------------------------------
|
2020-09-09 00:37:00 +07:00
|
|
|
psql -h "$ADEMPIERE_DB_SERVER" -p "$ADEMPIERE_DB_PORT" -d "$ADEMPIERE_DB_NAME" -U "$2" -f "$IDEMPIERE_HOME"/migration/processes_post_migration/"$ADEMPIERE_DB_PATH"/01_add_missing_translations.sql
|
2010-11-04 02:46:38 +07:00
|
|
|
PGPASSWORD=
|
|
|
|
export PGPASSWORD
|