Skip to content

bad versions generated when using prefix #161

@Incanus3

Description

@Incanus3

Hi guys. We just started experimenting with ebean-migration and encountered a strange problem with generated migration versions. We have a migration generation script like this:

fun main(args: Array<String>) {
    System.setProperty("spring.profiles.active", "kb-dev")
    System.setProperty("spring.main.banner-mode", "off")
    System.setProperty("spring.main.web-application-type", "none")
    System.setProperty("logging.level.root", "WARN")
    System.setProperty("kb.background.run-jobs", "false")
    System.setProperty("kb.architecture.load-registry-network", "false")

    val context = runApplication<QwazarKB>(*args)
    val database = context.getBean(INDEX_DB_QUALIFIER, Database::class.java)

    val migration = DbMigration.create().apply {
        setServer(database)

        addPlatform(Platform.H2)
        addPlatform(Platform.POSTGRES)
        addPlatform(Platform.ORACLE)
        addPlatform(Platform.SQLSERVER17)

        setIncludeIndex(true)

        setApplyPrefix("3.14.0-") // TODO: change before running!
        setName("add ZkratkaListRow") // TODO: change before running!

        // TODO: can we somehow deduce this?
        setPathToResources("backends/kb/src/main/resources")
    }

    migration.generateMigration()
}

Now, the first version looked as expected: 3.14.0-1.0, but after that, they started getting strange:

  • second version: 3.14.0-3.14.0.1.1
  • third version: 3.14.0-3.14.0.3.14.0.1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions