-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[db] Change the primary key of the d_b_oauth_auth_code_entry
table
#13583
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
Conversation
Use the new `uid` column as the primary key.
started the job as gitpod-build-af-make-uid-column-pk.16 because the annotations in the pull request description changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we expect to happen when the migrations take place but existing instances are still running with PK set previously? I believe this will work fine, unless the @PrimaryGeneratedColumn()
affects how the values are determined (and possibly generated)
/hold for Q
...ents/gitpod-db/src/typeorm/migration/1664799675276-MakeUidColumnPrimaryKeyInAuthCodeTable.ts
Show resolved
Hide resolved
Not sure I understand the question. Do you mean is it possible to perform this key switch against a real table with data? If so, this migration has been run against such a table as part of testing this. |
When the migrations run, the application that's running will still have the @PrimaryGeneratedColumn() annotation - is this a problem? This could result in a generated value being written to the |
I think the table is infrequently used enough that we can take the chance of a write to the table happening during the migration. I'm not sure how we would avoid the problem anyway, actually. |
I generally agree with the sentiment that we have compare effort and value. But we have to take into account that things happen, e.g.:
In both situations, suddenly the old code is broken because of this, causing an incident.
I think we could decouple the migration from the code change, no? In a way where we:
Might be a little bit more work, but would make me feel much safer. 👍 |
Closing this in favour of the safer approach mentioned by @gero in this comment. #13616 is the first step towards that. |
Description
Following on from #13524 which added the
uid
column to thed_b_oauth_auth_code_entry
table and #13577 which ensured that all new records set theuid
field, this PR changes to the primary key to theuid
column (and renames it toid
).Related Issue(s)
Part of #9198
How to test
local-app
against the preview environment:GITPOD_HOST=https://af-make-uib1daf36a03.preview.gitpod-dev.com ./local-app test
d_b_oauth_auth_code_entry
table have theirid
column set.Release Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide