-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd-migrations.sh
executable file
·44 lines (38 loc) · 961 Bytes
/
add-migrations.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -e
set -o pipefail
usage() {
cat << EOF
Adds migrations for the core database in the ConsensusChessShared project, and
the feature tests database in the ConsensusChessFeatureTests project.
Options:
-m <name> --migration-name <name> Name for the migration
-h --help Prints this help message and exits
EOF
}
# parameters
while [ -n "$1" ]; do
case $1 in
-m | --migration-name)
shift
MIGRATION=$1
;;
-h | --help)
usage
exit 0
;;
*)
echo -e "Unknown option $1...\n"
usage
exit 1
;;
esac
shift
done
if [ -z "$MIGRATION" ]; then
echo "Please set the migration name with -m/--migration-name"
usage
exit 1
fi
dotnet ef migrations add $MIGRATION --project ConsensusChessShared/ConsensusChessShared.csproj --context ConsensusChessPostgresContext
dotnet ef migrations add $MIGRATION --project ConsensusChessFeatureTests/ConsensusChessFeatureTests.csproj