Authentication workflow complete, add database link

This commit is contained in:
Jai A
2020-09-27 22:49:38 -07:00
parent 34075738ea
commit cd28a75c86
7 changed files with 147 additions and 9 deletions

View File

@@ -73,6 +73,13 @@ generate_ids!(
"SELECT EXISTS(SELECT 1 FROM team_members WHERE id=$1)",
TeamMemberId
);
generate_ids!(
pub generate_state_id,
StateId,
8,
"SELECT EXISTS(SELECT 1 FROM mods WHERE id=$1)",
StateId
);
#[derive(Copy, Clone, Debug, Type)]
#[sqlx(transparent)]
@@ -109,6 +116,10 @@ pub struct CategoryId(pub i32);
#[sqlx(transparent)]
pub struct FileId(pub i64);
#[derive(Copy, Clone, Debug, Type)]
#[sqlx(transparent)]
pub struct StateId(pub i64);
use crate::models::ids;
impl From<ids::ModId> for ModId {