mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Apply flyway api changes
This commit is contained in:
@ -22,7 +22,7 @@ final class StoreImpl[F[_]: Effect](jdbc: JdbcConfig, xa: Transactor[F])
|
|||||||
)
|
)
|
||||||
|
|
||||||
def migrate: F[Int] =
|
def migrate: F[Int] =
|
||||||
FlywayMigrate.run[F](jdbc)
|
FlywayMigrate.run[F](jdbc).map(_.migrationsExecuted)
|
||||||
|
|
||||||
def transact[A](prg: doobie.ConnectionIO[A]): F[A] =
|
def transact[A](prg: doobie.ConnectionIO[A]): F[A] =
|
||||||
prg.transact(xa)
|
prg.transact(xa)
|
||||||
|
@ -5,12 +5,13 @@ import cats.effect.Sync
|
|||||||
import docspell.store.JdbcConfig
|
import docspell.store.JdbcConfig
|
||||||
|
|
||||||
import org.flywaydb.core.Flyway
|
import org.flywaydb.core.Flyway
|
||||||
|
import org.flywaydb.core.api.output.MigrateResult
|
||||||
import org.log4s._
|
import org.log4s._
|
||||||
|
|
||||||
object FlywayMigrate {
|
object FlywayMigrate {
|
||||||
private[this] val logger = getLogger
|
private[this] val logger = getLogger
|
||||||
|
|
||||||
def run[F[_]: Sync](jdbc: JdbcConfig): F[Int] =
|
def run[F[_]: Sync](jdbc: JdbcConfig): F[MigrateResult] =
|
||||||
Sync[F].delay {
|
Sync[F].delay {
|
||||||
logger.info("Running db migrations...")
|
logger.info("Running db migrations...")
|
||||||
val locations = jdbc.dbmsName match {
|
val locations = jdbc.dbmsName match {
|
||||||
|
Reference in New Issue
Block a user