diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 15d025c41..a96820c05 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -3,9 +3,6 @@ ALTER TABLE `vn`.`itemTaxCountry` AUTO_INCREMENT = 1; ALTER TABLE `vn2008`.`Consignatarios` AUTO_INCREMENT = 1; -INSERT INTO `util`.`config` ( `dbVersion`, `hasTriggersDisabled`, `environment`) - VALUES ('1.0.0', '0', 'development'); - INSERT INTO `vn`.`ticketConfig` (`id`, `scopeDays`) VALUES ('1', '6'); diff --git a/db/import-changes.sh b/db/import-changes.sh index 0c986afe8..b3d9d3a02 100755 --- a/db/import-changes.sh +++ b/db/import-changes.sh @@ -78,7 +78,6 @@ fi # Applying changes N_CHANGES=0 -echo "[INFO] Applying changes." for DIR_PATH in "$DIR/changes/"*; do DIR_NAME=$(basename $DIR_PATH) @@ -96,7 +95,14 @@ for DIR_PATH in "$DIR/changes/"*; do echo "[INFO] Applying version: $DIR_NAME" for FILE in "$DIR_PATH/"*; do - echo "[INFO] -> $(basename "$FILE")" + FILE_NAME=$(basename "$FILE") + + if [[ ! "$FILE_NAME" =~ ^[0-9]{2}-[a-zA-Z0-9]+\.sql$ ]]; then + echo "[WARN] Ignoring wrong file name: $FILE_NAME" + continue + fi + + echo "[INFO] -> $FILE_NAME" mysql --defaults-file="$INI_FILE" --comments < $FILE N_CHANGES=$((N_CHANGES + 1)) done @@ -106,7 +112,7 @@ for DIR_PATH in "$DIR/changes/"*; do done if [ "$N_CHANGES" -eq "0" ]; then - echo "[INFO] No changes to apply." + echo "[INFO] No changes applied." else echo "[INFO] Changes applied succesfully." fi