add scripts folder and rename sqlserver

This commit is contained in:
zedy
2022-11-18 13:53:38 +08:00
parent b2a3137f02
commit 45ad9ed83f
6 changed files with 23 additions and 2 deletions

12
scripts/setup-database.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
# Default to current directory
FOLDER_PATH=$(pwd)
# Before setting up your database, make sure of two things:
# 1. Ensure your connection strings in appsettings.json point to a local SQL Server instance.
# 2. Ensure the tool EF was already installed.
dotnet tool update --global dotnet-ef
dotnet ef database update -c catalogcontext -p $FOLDER_PATH/src/Infrastructure/Infrastructure.csproj -s $FOLDER_PATH/src/Web/Web.csproj
dotnet ef database update -c appidentitydbcontext -p $FOLDER_PATH/src/Infrastructure/Infrastructure.csproj -s $FOLDER_PATH/src/Web/Web.csproj