kot09
kot09

Reputation: 1037

Flyway with Spring: Can I have SQL and Java based migrations?

Is it possible to have both SQL and Java based migrations? (ie: an .sql file and .java file)? If so, do they rest in the same directory?

Upvotes: 8

Views: 1665

Answers (1)

markdsievers
markdsievers

Reputation: 7309

Do you mean with spring-boot? Please clarify what context Spring has in this question and I'll update my answer.

Aside from Spring, SQL and Java migrations are both available to you in combination. You can configure the location of your migration files, see the locations section of migrate but by default your SQL and Java migration files will be found in db/migration on the classpath. So in a typical project that would be

src/main
└── java
    └── db
        └── migration
            ├── V3__M3.java
            └── V4__M4.java

└── resources
    └── db
        └── migration
            ├── V1__m1.sql
            └── V2__m2.sql

Upvotes: 12

Related Questions