-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check DB schema version consistency at build time
- Loading branch information
1 parent
3669a9c
commit 800d42f
Showing
3 changed files
with
17 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
pushd "$(dirname "$0")"/.. >/dev/null | ||
|
||
LAST_UPGRADE="$(ls misc/sql/mysql-upgrade | sort -n -r | head -n 1)" | ||
if ! [[ "$(< misc/sql/installed_db_version)" == "$LAST_UPGRADE" ]]; then | ||
cat >&2 <<-EOF | ||
Fix misc/sql/installed_db_version to be $LAST_UPGRADE | ||
echo $LAST_UPGRADE > misc/sql/installed_db_version | ||
git add misc/sql/installed_db_version | ||
EOF | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,4 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
LAST_UPGRADE="$(ls misc/sql/mysql-upgrade | sort -n -r | head -n 1)" | ||
if ! [[ "$(< misc/sql/installed_db_version)" == "$LAST_UPGRADE" ]]; then | ||
cat >&2 <<-EOF | ||
Fix misc/sql/installed_db_version to be $LAST_UPGRADE | ||
echo $LAST_UPGRADE > misc/sql/installed_db_version | ||
git add misc/sql/installed_db_version | ||
EOF | ||
exit 1 | ||
fi | ||
$(dirname $0)/check-db-version-consistency |