Skip to content

Commit bb6787c

Browse files
generate migrations automated script
1 parent c8b73df commit bb6787c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Helpers/GenerateMigration.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Define base path
2+
# $basePath = "C:\WorkingFolders\FWD\<projectRoot>"
3+
$basePath = Get-Location
4+
5+
# Define variables for paths
6+
$flywayTomlPath = Join-Path $basePath "flyway.toml"
7+
$deploymentDeltasPath = Join-Path $basePath "deploymentDeltas.zip"
8+
$outputFolderPath = Join-Path $basePath "migrations"
9+
10+
# Diff between SchemaModel and Migrations using Shadow defined in the flyway.toml
11+
flyway-dev diff -p $flywayTomlPath --i-agree-to-the-eula --from=SchemaModel --to=Migrations -a $deploymentDeltasPath
12+
13+
# Take and generate migrations
14+
flyway-dev take -p $flywayTomlPath -a $deploymentDeltasPath --i-agree-to-the-eula | flyway-dev generate -p $flywayTomlPath -a $deploymentDeltasPath --i-agree-to-the-eula --outputFolder=$outputFolderPath

0 commit comments

Comments
 (0)