Datenbank: PowerShell-Skripte für Datenbank-Upgrade und neue Migration

This commit is contained in:
hydrant
2021-04-22 13:10:27 +02:00
parent c47af1f596
commit a26a7991f7
3 changed files with 15 additions and 1 deletions

View 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"

View 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"

View File

@@ -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>