Skip to content

validateMigrations gives nonsensical output when table version is higher than in migrations #73

@jsynacek

Description

@jsynacek

Consider this:

<at this point, table1 is freshly created -- tblVersion is 1>
...
let tables = [ table1 { tblVersion = 10, <change some fields> } ]
let migrations = [ migration1 { fromVersion = 1, ...}, migration2 { fromVersion = 2, ...} ]   
...
migrateDatabase defaultExtrasOptions ["pgcrypto"] [] [] tables migrations
checkDatabase defaultExtrasOptions [] [] tables

When such migration is run, the output looks like this:

22-04-13 08:18:45 ATTENTION hpqtypes-extras-test: Migrations are invalid {
  "expected_migration_versions": [
    8,
    9
  ],
  "migration_versions": [
    1,
    2
  ],
  "table": "bank"
}

That doesn't make any sense. Expected version should be [0..9] or similar. In fact, maybe the error message should be reworked so that it doesn't just blatantly dump two lists but provides a more user-friendly error.

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