DB versioning fixes
gitea/salix/dev This commit looks good Details

This commit is contained in:
Juan Ferrer 2019-04-03 11:21:54 +02:00
parent 836f210f6c
commit 479b4c68c8
3 changed files with 18 additions and 12 deletions

View File

@ -11,6 +11,12 @@ dump_tables() {
echo "" > "$DUMPED_FILE" echo "" > "$DUMPED_FILE"
TABLES=(
util
config
)
dump_tables ${TABLES[@]}
TABLES=( TABLES=(
account account
role role

View File

@ -2,20 +2,20 @@
SCHEMAS=( SCHEMAS=(
account account
util
vn2008
vn
edi
bs
bi bi
pbx bs
cache cache
salix edi
vncontrol
hedera hedera
stock
postgresql
nst nst
pbx
postgresql
salix
stock
util
vn
vn2008
vncontrol
) )
mysqldump \ mysqldump \

View File

@ -71,7 +71,7 @@ DB_VERSION=`echo "$GET_VERSION" | mysql --defaults-file="$INI_FILE" --silent --r
echo "[INFO] Current database version: $DB_VERSION" echo "[INFO] Current database version: $DB_VERSION"
if [[ ! "$DB_VERSION" =~ ^[0-9]+$ ]]; then if [[ ! "$DB_VERSION" =~ ^[0-9]+$ ]]; then
echo "[ERROR] Cannot fetch the database version" echo "[ERROR] Cannot fetch the database version."
exit 3 exit 3
fi fi
@ -93,7 +93,7 @@ for VERSION_DIR in "$DIR/changes/"*; do
done done
UPDATE_VERSION="UPDATE util.config SET dbVersion='$DIR_VERSION'" UPDATE_VERSION="UPDATE util.config SET dbVersion='$DIR_VERSION'"
echo $UPDATE_VERSION | mysql --defaults-file="$INI_FILE" echo "$UPDATE_VERSION" | mysql --defaults-file="$INI_FILE"
fi fi
done done