Skip to content

Allow emails table to contain multiple emails per user #11642

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kailan
Copy link

@kailan kailan commented Jul 26, 2025

This PR is split from #11629 – it contains just the database schema-related changes, with no changes to the API, frontend, or any user-visible behaviour, barring a change to the description of three properties of the /api/v1/me response in the OpenAPI schema.

I previously had a note here about it being possible for an email address to exist on more than one user account, but this is the current behaviour in production so I have removed it.

Relates to #11597.

@kailan kailan force-pushed the multiple-emails-schema branch 3 times, most recently from f6ebfe0 to 77ebf49 Compare July 26, 2025 14:25
@kailan kailan force-pushed the multiple-emails-schema branch from 77ebf49 to edf516e Compare July 26, 2025 14:27
@@ -538,6 +538,9 @@ diesel::table! {
///
/// (Automatically generated by Diesel.)
token_generated_at -> Nullable<Timestamptz>,
/// Whether this email is the primary email address for the user.
#[sql_name = "is_primary"]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

primary is a reserved keyword in Postgres, so we use is_primary as the column name and then alias it to primary in the Diesel schema to be consistent with verified.

@kailan kailan marked this pull request as ready for review July 26, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant