collab: Backfill github_user_created_at on users (#16600)

This PR adds a backfiller to backfill the `github_user_created_at`
column on users.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-08-21 12:38:51 -04:00 committed by GitHub
parent 28568429aa
commit 8a5fcc2c22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 153 additions and 0 deletions

View file

@ -377,4 +377,14 @@ impl Database {
})
.await
}
pub async fn get_users_missing_github_user_created_at(&self) -> Result<Vec<user::Model>> {
self.transaction(|tx| async move {
Ok(user::Entity::find()
.filter(user::Column::GithubUserCreatedAt.is_null())
.all(&*tx)
.await?)
})
.await
}
}