Spring:Flyway
Aus Alexander's Wiki
Version vom 12. Mai 2022, 21:01 Uhr von Admin (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „== Flyway in SpringBoot-Projekt == In pom.xml<syntaxhighlight lang="xml"> <dependency> <groupId>org.flywaydb</groupId> <artifactId>flyway-core</artifac…“)
Flyway in SpringBoot-Projekt
In pom.xml
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>${flyway.version}</version>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-mysql</artifactId>
<version>${flyway.version}</version>
</dependency>
In application.yaml
spring:
flyway:
enabled: true
baselineOnMigrate: true
check-location: true
# schemas: public
# unfortunately flyway cannot distinct between mysql and mariadb by {vendor}
locations: classpath:db/migration/{vendor},classpath:db/migration/all #, filesystem:/opt/migration/{vendor}
user: user
password: password