collab: Make users.github_user_id required and unique (#16704)

This PR makes the `github_user_id` column on the `users` table required
and replaces the index with a unique index.

I have gone through and ensured that all users have a unique
`github_user_id` in the staging and production databases.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-08-22 18:27:22 -04:00 committed by GitHub
parent 69e76a3bb9
commit 4ddf2cbb9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 74 additions and 85 deletions

View file

@ -108,7 +108,7 @@ pub async fn validate_api_token<B>(req: Request<B>, next: Next<B>) -> impl IntoR
#[derive(Debug, Deserialize)]
struct AuthenticatedUserParams {
github_user_id: Option<i32>,
github_user_id: i32,
github_login: String,
github_email: Option<String>,
github_user_created_at: Option<chrono::DateTime<chrono::Utc>>,