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})"
}
Since the result of
slick.migration.api.SqlMigration.applydoesn't overridetoString, the generateddescriptionof aSqlMigrationlooks likeSqlMigration$$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: