2023-01-20 17:28:24 +01:00
|
|
|
#!/usr/bin/env pwsh
|
|
|
|
param (
|
|
|
|
[Parameter(Mandatory)]
|
|
|
|
$Name
|
|
|
|
)
|
|
|
|
|
2023-02-23 18:01:01 +01:00
|
|
|
# DB service provider name
|
|
|
|
$service = "mysql"
|
|
|
|
|
|
|
|
Write-Output "--- Attempting to start $service service ---"
|
|
|
|
|
2024-07-08 16:48:02 +02:00
|
|
|
# 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
|
|
|
|
}
|
2023-02-23 18:01:01 +01:00
|
|
|
|
2023-01-20 17:28:24 +01:00
|
|
|
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 ---"
|
|
|
|
}
|