1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-30 13:33:24 +01:00
bitwarden-server/dev/ef_migrate.ps1
Justin Baur b61b1eadaf
Devcontainer Improvements (#4466)
* Optionally Run `docker-compose`

* Use Traversal Projects Over Solution Files

* Cleanup VSCode Tasks

* Bind DataProtection Keys to Host

- Makes it so the container can be rebuilt without corrupting data

* Update .vscode/tasks.json

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2024-07-08 10:48:02 -04:00

31 lines
711 B
PowerShell

#!/usr/bin/env pwsh
param (
[Parameter(Mandatory)]
$Name
)
# DB service provider name
$service = "mysql"
Write-Output "--- Attempting to start $service service ---"
# Attempt to start mysql but if docker-compose doesn't
# exist just trust that the user has it running some other way
if (command -v docker-compose) {
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 ---"
}