-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
UUID type for hydra_client primary key #2781
Comments
👍 |
grantzvolsky
added a commit
to grantzvolsky/hydra
that referenced
this issue
Oct 7, 2021
This is the first step towards resolving ory#2781. The issue will be resolved when we remove the deprecated column.
4 tasks
aeneasr
pushed a commit
that referenced
this issue
Oct 11, 2021
grantzvolsky
added a commit
to grantzvolsky/hydra
that referenced
this issue
Feb 7, 2022
grantzvolsky
added a commit
to grantzvolsky/hydra
that referenced
this issue
Mar 8, 2022
grantzvolsky
added a commit
that referenced
this issue
May 19, 2022
aeneasr
pushed a commit
that referenced
this issue
Jun 27, 2022
grantzvolsky
added a commit
that referenced
this issue
Aug 1, 2022
aeneasr
pushed a commit
that referenced
this issue
Aug 1, 2022
aeneasr
pushed a commit
that referenced
this issue
Aug 18, 2022
aeneasr
pushed a commit
that referenced
this issue
Sep 5, 2022
aeneasr
pushed a commit
that referenced
this issue
Sep 7, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Currently, the primary key of the hydra_client table is an integer sequence. Since we don't benefit from the guarantees that a sequence provides, it would be better to just use UUID, to reduce insert complexity[1] and avoid other potential issues[2].
Additional context
The hydra_client table has a public ID (
id
) and an internal ID (pk
, sequential primary key). Other tables reference the public id. The primary key is not used in foreign keys, so it can be changed with minimal disruption in cockroachdb, mysql, and postgres. sqlite requires the table to be recreated.This change will involve generating new primary keys in application code rather than in the DB because we would like to minimize the work done by the database and it is the standard practice. The migration, however, requires that we generate UUIDs for existing rows, which could be tricky with sqlite or even postgres without an extension.
Describe the solution you'd like
Change hydra_client primary key to UUID while making it possible to revert the change and without imposing any new configuration requirements such as the postgres UUID extension. It is not required for this migration to be online.
Describe alternatives you've considered
Keep using an integer sequence for the hydra_client primary key.
[1] https://www.cockroachlabs.com/docs/stable/create-sequence.html#considerations
[2] #2765
The text was updated successfully, but these errors were encountered: