Datenbank: PowerShell-Skripte für Datenbank-Upgrade und neue Migration
This commit is contained in:
10
ReallifeGamemode.Database/Add-Migration.ps1
Normal file
10
ReallifeGamemode.Database/Add-Migration.ps1
Normal file
@@ -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"
|
||||||
4
ReallifeGamemode.Database/Update-Database.ps1
Normal file
4
ReallifeGamemode.Database/Update-Database.ps1
Normal file
@@ -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"
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
<HintPath>..\Import\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\Import\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(ConfigurationName)' != 'ServerBuild' AND '$(OS)' == 'Windows_NT'">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(ConfigurationName)' != 'ServerBuild' AND '$(OS)' == 'Windows_NT' AND '$(ConfigurationName)' != 'Database'">
|
||||||
<Exec Command="powershell -NonInteractive -ExecutionPolicy ByPass -File ..\postbuild.ps1 -buildDirectory $(OutDir) -buildFilename $(TargetFileName)" LogStandardErrorAsError="True" />
|
<Exec Command="powershell -NonInteractive -ExecutionPolicy ByPass -File ..\postbuild.ps1 -buildDirectory $(OutDir) -buildFilename $(TargetFileName)" LogStandardErrorAsError="True" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
Reference in New Issue
Block a user