-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrift_GenerateMigration.ps1
More file actions
15 lines (11 loc) · 1019 Bytes
/
Drift_GenerateMigration.ps1
File metadata and controls
15 lines (11 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Compare Target Database To schemaModel and apply drift to schemaModel
# Use case: Compare a live environment (e.g., QA) against the schema model to check for drift.
# Helpful for identifying differences before deploying migrations.
flyway diff model -diff.source=qa -environments.qa.url="jdbc:postgresql://127.0.0.1:5432/qa" -environments.qa.user="flyway_qa" "-environments.qa.password=Flyway123" -diff.target=schemaModel -environments.qa.schemas="mySchema"
# Note: Ensure that the 'qa' environment is properly configured in your Flyway configuration file or command line.
# Generate Migrations
# Use case: Automatically generate versioned and undo migrations after drift is detected.
# Useful for developers to create migration scripts based on schema changes.
flyway generate "-generate.types=versioned,undo" "-generate.description=dev_updates"
# generate to a specific location
flyway generate -X -generate.types=versioned,undo -generate.description=dev_updates -generate.location=./outputs/drift