Foreign key relationship from login_token table #4484
Unanswered
demiankatz
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
While validating schemas in #2233, @sambhavp96 noticed that there is no foreign key connecting the login_token table to the user table, even though login_token has a user_id field, and the Doctrine entity in #2233 specifies this relationship.
It looks like the original implementation of the table in #3027 simply omitted the foreign key relationship. A few months later, @EreMaijala added indexes in #4191 to improve performance, so we now have a simple index instead of a foreign key.
I strongly suspect that we'd be better off dropping the user-based index and introducing a foreign key instead; it will have the same benefits as an index while also improving data integrity.
@rajaro, does this make sense to you? Can you think of any reason why we would intentionally avoid using a foreign key here?
If no one objects, @sambhavp96 will likely have time to begin a PR next week to straighten this out (and I'm available to help him as needed).
Beta Was this translation helpful? Give feedback.
All reactions