SqlMigrations don't work with slick-migration-api-flyway
PawelLipski opened this issue · comments
Since the result of slick.migration.api.SqlMigration.apply
doesn't override toString
, the generated description
of a SqlMigration
looks like SqlMigration$$anon$1@5becf99e
, and is a different string each time a new object is created (incl. when a new JVM is launched).
This leads to Flyway failing with ``Migration description mismatch for migration version ...`.
As a workaround, once could do sth like:
val initialSchema = new SqlMigration {
override def sql: Seq[String] = Seq(Source.fromResource("initial-schema.sql").mkString)
override def toString: String = s"${classOf[SqlMigration].getSimpleName}(${sql})"
}
What do you recommend?
Well... if you could just override toString
in trait SqlMigration
:)
Right, I mean what do you suggest it be overridden to?
…On Thu, Dec 3, 2020, 6:05 AM Paweł Lipski ***@***.***> wrote:
Well... if you could just override toString in trait SqlMigration :)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAYAUE25E5YQN7MITYBKP3SS5WGTANCNFSM4R4WMBBA>
.
Hmmm same as in my implementation?... Possibly with getName
instead of getSimpleName
🤔
Could you send a PR?