From a26a7991f7eae8149698ff87e5dea4e98b1c00c9 Mon Sep 17 00:00:00 2001 From: hydrant Date: Thu, 22 Apr 2021 13:10:27 +0200 Subject: [PATCH] =?UTF-8?q?Datenbank:=20PowerShell-Skripte=20f=C3=BCr=20Da?= =?UTF-8?q?tenbank-Upgrade=20und=20neue=20Migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ReallifeGamemode.Database/Add-Migration.ps1 | 10 ++++++++++ ReallifeGamemode.Database/Update-Database.ps1 | 4 ++++ ReallifeGamemode.Server/ReallifeGamemode.Server.csproj | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 ReallifeGamemode.Database/Add-Migration.ps1 create mode 100644 ReallifeGamemode.Database/Update-Database.ps1 diff --git a/ReallifeGamemode.Database/Add-Migration.ps1 b/ReallifeGamemode.Database/Add-Migration.ps1 new file mode 100644 index 00000000..43d4d65d --- /dev/null +++ b/ReallifeGamemode.Database/Add-Migration.ps1 @@ -0,0 +1,10 @@ +Param +( + [Parameter(Mandatory=$true)] + [string]$MigrationName +) + +$root = $PSScriptRoot + +dotnet tool update dotnet-ef --global +dotnet ef migrations add $MigrationName --project "$root\ReallifeGamemode.Database.csproj" --startup-project "$root\..\ReallifeGamemode.Server\ReallifeGamemode.Server.csproj" --configuration "Database" \ No newline at end of file diff --git a/ReallifeGamemode.Database/Update-Database.ps1 b/ReallifeGamemode.Database/Update-Database.ps1 new file mode 100644 index 00000000..0f57198a --- /dev/null +++ b/ReallifeGamemode.Database/Update-Database.ps1 @@ -0,0 +1,4 @@ +$root = $PSScriptRoot + +dotnet tool update dotnet-ef --global +dotnet ef database update --project "$root\ReallifeGamemode.Database.csproj" --startup-project "$root\..\ReallifeGamemode.Server\ReallifeGamemode.Server.csproj" --configuration "Database" \ No newline at end of file diff --git a/ReallifeGamemode.Server/ReallifeGamemode.Server.csproj b/ReallifeGamemode.Server/ReallifeGamemode.Server.csproj index ff6191e1..80049bd1 100644 --- a/ReallifeGamemode.Server/ReallifeGamemode.Server.csproj +++ b/ReallifeGamemode.Server/ReallifeGamemode.Server.csproj @@ -51,7 +51,7 @@ ..\Import\Newtonsoft.Json.dll - + \ No newline at end of file