Fix mariadb utf8 encoding..
This commit is contained in:
@@ -1,12 +1,23 @@
|
||||
package be.simplenotes.persistance
|
||||
|
||||
import be.simplenotes.shared.config.DataSourceConfig
|
||||
import org.flywaydb.core.Flyway
|
||||
import javax.sql.DataSource
|
||||
|
||||
internal class DbMigrationsImpl(private val dataSource: DataSource) : DbMigrations {
|
||||
internal class DbMigrationsImpl(
|
||||
private val dataSource: DataSource,
|
||||
private val dataSourceConfig: DataSourceConfig
|
||||
) : DbMigrations {
|
||||
override fun migrate() {
|
||||
|
||||
val migrationDir = when {
|
||||
dataSourceConfig.jdbcUrl.contains("mariadb") -> "db/migration/mariadb"
|
||||
else -> "db/migration/other"
|
||||
}
|
||||
|
||||
Flyway.configure()
|
||||
.dataSource(dataSource)
|
||||
.locations(migrationDir)
|
||||
.load()
|
||||
.migrate()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user