postgres: streamline migrations#1749
Merged
github-actions[bot] merged 1 commit intoquay:mainfrom Feb 27, 2026
Merged
Conversation
Contributor
|
What'd you think about making changes here as well? claircore/datastore/postgres/types/version.go Lines 37 to 39 in 467fce6 My first thought was to log that we hit this condition to help debug this situation when it comes up, but now I'm wondering... should we return this error anyway? |
Contributor
|
The current changes will still have Postgres produce the following log: I think this might be confusing for admins looking through database logs. |
Member
Author
|
I'm against returning an error, as it makes everything more complicated for little gain: the user should know if the database types have been created. I've added an attempt to log (in the PostgreSQL log) that the error is expected. |
e530459 to
0ebc5e6
Compare
a2efc1e to
e0b6d71
Compare
BradLugo
reviewed
Feb 27, 2026
Contributor
BradLugo
left a comment
There was a problem hiding this comment.
One minor detail. Everything else looks good.
BradLugo
reviewed
Feb 27, 2026
Contributor
BradLugo
left a comment
There was a problem hiding this comment.
One minor detail. Everything else looks good.
e0b6d71 to
5585470
Compare
This change adds dedicated functions to run migrations using a wholly-owned connection, then update the normal "Init" flow to reset any connections created prior to the migrations running. This should make sure that no connections from before the migrations are run could possibly be around to be used by accident. Signed-off-by: Hank Donnay <[email protected]> See-also: https://issues.redhat.com/browse/CLAIRDEV-232
5585470 to
fed5975
Compare
BradLugo
approved these changes
Feb 27, 2026
Member
Author
|
/fast-forward |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should make it easier to run the migrations and make sure that no connections from before the migrations are run could possibly be around to be used by accident.
See-also: https://issues.redhat.com/browse/CLAIRDEV-232