fix: use id, author and filename as pk for Liquibase databasechangelog table#4167
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
@molivasdat Thanks for this fix. We can only merge this fix if you sign the CLA (click on the failed cla/google check above for more details). I can also move this change to a new pull request, but I would prefer to merge your PR to make sure that you are listed as the contributor for this fix. |
|
@olavloite I did sign it. My email address is private in the commit id. I have signed the CLA. There is this in the CLA docs. Not sure who my CLA point of contact would be to add ❌ 9edbe33 Author: @molivasdat <47544147+molivasdat@users.noreply.github.com> (Only the first commit for a unique contributor is listed.) |
|
@molivasdat Ah, yes, re-running the check manually seems to succeed. Not sure why it did not turn green automatically. Thanks! |
b348c65
into
GoogleCloudPlatform:postgresql-dialect
Users of Spanner using the PgAdapter plugin cannot reuse the same id anywhere within all of the changelogs.
That means that users of Liquibase cannot create a changeset within the same file or even different files if different authors use the same id.
This PR will fix that issue.
From the liquibase docs
https://docs.liquibase.com/secure/user-guide-5-1/what-is-the-databasechangelog-table
What is the DATABASECHANGELOG table?
Liquibase tracks which changesets have been run by using the DATABASECHANGELOG (DBCL) table. If the table does not exist in the database, Liquibase creates one automatically.
The default name of the DBCL is DATABASECHANGELOG. You can specify a different name with the --database-changelog-table-name parameter.
Columns
The table tracks each changeset as a row, identified by a combination of the id, author, and filename columns. There is no primary key on the table. This is to avoid any database-specific restrictions on key lengths. The composite of id, author, and filename is unique across all rows of the table.
Users of Liquibase can create changes and those changes are indexed by
filename, id, and author.
If a primary key on the table is required in Spanner when using it as a PostgreSQL database,then this change would fulfill the need for a composite key entry.