elsa-core/update-migrations-runtime.sh
Sipke Schoorstra 95cefe631f
Bookmarks & Activity Instances (#4301)
* Add ActivityInstanceId to bookmark model

* Fix Telnyx activity resumption

* Fix missing activity instance ID forwarding to workflow inbox
2023-08-09 13:02:20 +02:00

38 lines
1.1 KiB
Bash

#!/usr/bin/env zsh
# Define the modules to update
mods=("Runtime")
# Define the list of providers
# providers=("MySql" "SqlServer" "Sqlite" "PostgreSql")
providers=("Sqlite")
# Connection strings for each provider
typeset -A connStrings
connStrings=(
MySql "Server=localhost;Port=3306;Database=elsa;User=root;Password=password;"
SqlServer ""
Sqlite ""
PostgreSql ""
)
# Loop through each module
for module in "${mods[@]}"; do
# Loop through each provider
for provider in "${providers[@]}"; do
providerPath="./src/modules/Elsa.EntityFrameworkCore.$provider"
migrationsPath="Migrations/$module"
echo "Updating migrations for $provider..."
echo "Provider path: ${providerPath:?}/${migrationsPath}"
echo "Migrations path: $migrationsPath"
echo "Connection string: ${connStrings[$provider]}"
# 1. Delete the existing migrations folder
rm -rf "${providerPath:?}/${migrationsPath}"
# 2. Run the migrations command
dotnet ef migrations add Initial -c RuntimeElsaDbContext -p "$providerPath" -o "$migrationsPath" -- "${connStrings[$provider]}"
done
done