From 479b4c68c854c106d528d740e9b6a6c516d91f39 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 3 Apr 2019 11:21:54 +0200 Subject: [PATCH] DB versioning fixes --- db/export-data.sh | 6 ++++++ db/export-structure.sh | 20 ++++++++++---------- db/import-changes.sh | 4 ++-- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/db/export-data.sh b/db/export-data.sh index b4283f0d3..d192a2da5 100755 --- a/db/export-data.sh +++ b/db/export-data.sh @@ -11,6 +11,12 @@ dump_tables() { echo "" > "$DUMPED_FILE" +TABLES=( + util + config +) +dump_tables ${TABLES[@]} + TABLES=( account role diff --git a/db/export-structure.sh b/db/export-structure.sh index a1a8c94b9..020cf85be 100755 --- a/db/export-structure.sh +++ b/db/export-structure.sh @@ -2,20 +2,20 @@ SCHEMAS=( account - util - vn2008 - vn - edi - bs bi - pbx + bs cache - salix - vncontrol + edi hedera - stock - postgresql nst + pbx + postgresql + salix + stock + util + vn + vn2008 + vncontrol ) mysqldump \ diff --git a/db/import-changes.sh b/db/import-changes.sh index 978243b25..9ba774b98 100755 --- a/db/import-changes.sh +++ b/db/import-changes.sh @@ -71,7 +71,7 @@ DB_VERSION=`echo "$GET_VERSION" | mysql --defaults-file="$INI_FILE" --silent --r echo "[INFO] Current database version: $DB_VERSION" if [[ ! "$DB_VERSION" =~ ^[0-9]+$ ]]; then - echo "[ERROR] Cannot fetch the database version" + echo "[ERROR] Cannot fetch the database version." exit 3 fi @@ -93,7 +93,7 @@ for VERSION_DIR in "$DIR/changes/"*; do done 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 done