You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
509 B
23 lines
509 B
set -xeu
|
|
|
|
BRANCH=$1
|
|
COMMIT_SHA=$2
|
|
|
|
git clone https://codefirst.iut.uca.fr/git/IQBall/Dotnet-WebAPI
|
|
|
|
cd Dotnet-WebAPI
|
|
|
|
git switch $BRANCH
|
|
|
|
#TODO remove migrations that are bound to commits that are no longer in the branch (which could occur via a rebase)
|
|
|
|
cd AppContext
|
|
rm -rf Migrations # remove migrations from git
|
|
ln -s /migrations Migrations # bind auto branch migrations to the project
|
|
|
|
# apply migrations
|
|
dotnet ef migrations add "auto-migration-$COMMIT_SHA"
|
|
|
|
# update database
|
|
dotnet ef database update
|