DB versioning fixes
gitea/salix/dev There was a failure building this commit
Details
gitea/salix/dev There was a failure building this commit
Details
This commit is contained in:
parent
d0dc192fc4
commit
f46d50fc48
|
@ -3,9 +3,6 @@
|
||||||
ALTER TABLE `vn`.`itemTaxCountry` AUTO_INCREMENT = 1;
|
ALTER TABLE `vn`.`itemTaxCountry` AUTO_INCREMENT = 1;
|
||||||
ALTER TABLE `vn2008`.`Consignatarios` 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`)
|
INSERT INTO `vn`.`ticketConfig` (`id`, `scopeDays`)
|
||||||
VALUES
|
VALUES
|
||||||
('1', '6');
|
('1', '6');
|
||||||
|
|
|
@ -78,7 +78,6 @@ fi
|
||||||
# Applying changes
|
# Applying changes
|
||||||
|
|
||||||
N_CHANGES=0
|
N_CHANGES=0
|
||||||
echo "[INFO] Applying changes."
|
|
||||||
|
|
||||||
for DIR_PATH in "$DIR/changes/"*; do
|
for DIR_PATH in "$DIR/changes/"*; do
|
||||||
DIR_NAME=$(basename $DIR_PATH)
|
DIR_NAME=$(basename $DIR_PATH)
|
||||||
|
@ -96,7 +95,14 @@ for DIR_PATH in "$DIR/changes/"*; do
|
||||||
echo "[INFO] Applying version: $DIR_NAME"
|
echo "[INFO] Applying version: $DIR_NAME"
|
||||||
|
|
||||||
for FILE in "$DIR_PATH/"*; do
|
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
|
mysql --defaults-file="$INI_FILE" --comments < $FILE
|
||||||
N_CHANGES=$((N_CHANGES + 1))
|
N_CHANGES=$((N_CHANGES + 1))
|
||||||
done
|
done
|
||||||
|
@ -106,7 +112,7 @@ for DIR_PATH in "$DIR/changes/"*; do
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$N_CHANGES" -eq "0" ]; then
|
if [ "$N_CHANGES" -eq "0" ]; then
|
||||||
echo "[INFO] No changes to apply."
|
echo "[INFO] No changes applied."
|
||||||
else
|
else
|
||||||
echo "[INFO] Changes applied succesfully."
|
echo "[INFO] Changes applied succesfully."
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue