-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathdiff_databases.sh
More file actions
executable file
·24 lines (18 loc) · 956 Bytes
/
diff_databases.sh
File metadata and controls
executable file
·24 lines (18 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# Check for the existence of mysqldbcompare
if ! [ -x "$(command -v mysqldbcompare)" ]; then
echo 'Error: MySQL Utilities are required.' >&2
echo 'Please install them from https://dev.mysql.com/downloads/utilities/' >&2
exit 1
fi
# Get the directory we're in
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Set up the verification databases in Node
npx ts-node --project $DIR/../tsconfig.server.json -e "require('$DIR/../src/migrations/util').createVerificationDatabases()"
# Perform the actual diff
mysqldbcompare --server1="queue@localhost" --server2="queue@localhost" --run-all-tests --changes-for=server2 --character-set=utf8 queue_sequelize:queue_migrations
EXIT_CODE=$?
# Destroy the verification databases in Node
npx ts-node --project $DIR/../tsconfig.server.json -e "require('$DIR/../src/migrations/util').destroyVerificationDatabases()"
# Let the user know if the databases diffed cleanly or not
exit $EXIT_CODE