sprygen migrate:init
Convert any non-Flyway project seamlessly to Flyway.
If you generated your project without Flyway enabled initially (ddl-auto: update), you can run this command later once your database schema is stable and you’re preparing for production.
What it does
- Patches your
application.ymlsettingddl-auto: none. - Creates the
src/main/resources/db/migrationdirectory. - Examines your existing entities and creates a baseline
V1__baseline.sqlscript. - Injects Flyway dependencies into your
pom.xml/build.gradle. - Updates your Sprygen metadata (
.sprygen/meta.json).
After doing this, all future sprygen add-entity commands will automatically generate SQL migration schema files and place them in the db/migration folder.
Usage:
cd my-spring-project
sprygen migrate:init