Rework db-seeding, so that it doesn't depend on a github auth token

Instead, admins are specified using a JSON file, 'admins.json'. This file is
gitignored. If it is not present, there is a default list of admins in
'admins.default.json'.
This commit is contained in:
Max Brunsfeld 2024-01-17 12:45:18 -08:00
parent c6c56c35df
commit 9367f719f2
6 changed files with 84 additions and 88 deletions

View file

@ -20,7 +20,11 @@ impl Database {
})
.on_conflict(
OnConflict::column(user::Column::GithubLogin)
.update_column(user::Column::GithubLogin)
.update_columns([
user::Column::Admin,
user::Column::EmailAddress,
user::Column::GithubUserId,
])
.to_owned(),
)
.exec_with_returning(&*tx)