Spring:Flyway: Unterschied zwischen den Versionen
Aus Alexander's Wiki
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…“) |
Admin (Diskussion | Beiträge) |
||
Zeile 26: | Zeile 26: | ||
== Flyway in maven-Skript == | == Flyway in maven-Skript == | ||
flyway.conf in | |||
* ''installDir/conf/flyway.conf'' | |||
* ''userhome/flyway.conf'' | |||
* ''workingDir/flyway.conf'' | |||
<syntaxhighlight lang="properties"> | |||
# Settings are simple key-value pairs | |||
flyway.key=value | |||
# Single line comment start with a hash | |||
# Long properties can be split over multiple lines by ending each line with a backslash | |||
flyway.locations=filesystem:my/really/long/path/folder1,\ | |||
filesystem:my/really/long/path/folder2,\ | |||
filesystem:my/really/long/path/folder3 | |||
# These are some example settings | |||
flyway.url=jdbc:mydb://mydatabaseurl | |||
flyway.schemas=schema1,schema2 | |||
flyway.placeholders.keyABC=valueXYZ | |||
</syntaxhighlight> |
Version vom 12. Mai 2022, 21:08 Uhr
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
Flyway in maven-Skript
flyway.conf in
- installDir/conf/flyway.conf
- userhome/flyway.conf
- workingDir/flyway.conf
# Settings are simple key-value pairs
flyway.key=value
# Single line comment start with a hash
# Long properties can be split over multiple lines by ending each line with a backslash
flyway.locations=filesystem:my/really/long/path/folder1,\
filesystem:my/really/long/path/folder2,\
filesystem:my/really/long/path/folder3
# These are some example settings
flyway.url=jdbc:mydb://mydatabaseurl
flyway.schemas=schema1,schema2
flyway.placeholders.keyABC=valueXYZ