Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jsynacek opened this issue Apr 13, 2022 · 1 comment

Comments

@jsynacek
Copy link
Contributor

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.

@jsynacek
Copy link
Contributor Author

jsynacek commented May 4, 2022

Maybe we could do something along the lines of 2d99d9a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant