Code Analysis for State-based deployments
Published 02 April 2025
- Use flyway prepare to generate your deployment script:
- flyway prepare -source=schemaModel -target=Prod
This defaults to adding a D__deployment.sql file into a deployments folder in your current directory. - Run flyway check -code to run static code analysis checks against the generated deployment script:
- cd deployments
- rename D__deployment.sql V001_deployment.sql
- flyway check -code -environment=development -locations=deployments
- rename V001__deployment.sql D_deployment.sql
Note: Currently the flyway check -code command only works on Versioned Migration Scripts that begin with V, which is why we temporarily rename the file. Please email us so we can prioritize a change to remove this temporary step.