1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00
bitwarden-server/dev/ef_migrate.ps1
SmithThe4th 7d0bba3a29
Improve EF Migration Workflow by Starting Required Docker Services Automatically (#2725)
* Added check to detremine if certain docker services are running and if not starts them

* used to docker no recreate flag to simplify the process
2023-02-23 12:01:01 -05:00

27 lines
556 B
PowerShell

#!/usr/bin/env pwsh
param (
[Parameter(Mandatory)]
$Name
)
# DB service provider name
$service = "mysql"
Write-Output "--- Attempting to start $service service ---"
docker-compose --profile $service up -d --no-recreate
dotnet tool restore
$providers = @{
MySql = "../util/MySqlMigrations"
Postgres = "../util/PostgresMigrations"
Sqlite = "../util/SqliteMigrations"
}
foreach ($key in $providers.keys) {
Write-Output "--- START $key ---"
dotnet ef migrations add $Name -s $providers[$key]
Write-Output "--- END $key ---"
}