I have the following changelog:
databaseChangeLog: - changeSet: id: initial author: Dan Rumney changes: - sqlFile: dbms: postgresql path: ./initial.sql splitStatements: false - changeSet: id: seed-config author: Dan Rumney changes: - sqlFile: dbms: postgresql path: ./seed-configuration.sql splitStatements: false
As you can probably infer, the first changeset creates a bunch of tables (the ones that predate my adoption of Liquibase), and the second one seeds my configuration table.
When I run this on a brand new Postgres instance, I get
Unexpected error running Liquibase: ERROR: relation "configuration" does not exist Position: 13 [Failed SQL: (0) INSERT INTO configuration ("id", "guardianConsentDocs", "providerConsentDocs", "defaultPool") VALUES (1, '', '', NULL) ON CONFLICT (id) DO NOTHING]
Then, if I run it again, everything works perfectly. Also, by inspection of the DB, the
configuration table is definitely getting generated in the first pass.
It’s almost like the second changeset is running before the first is completed.
Is this possible? Is there another explanation that fits? I’m somewhat at a loss here.
I can work around it, but I’d love to understand it.