oauth2
This commit is contained in:
@@ -7,12 +7,32 @@ pub struct Model {
|
||||
#[sea_orm(primary_key)]
|
||||
pub id: i32,
|
||||
#[sea_orm(unique)]
|
||||
pub username: String,
|
||||
pub password_hash: String,
|
||||
pub username: Option<String>,
|
||||
#[serde(skip_serializing)]
|
||||
pub password_hash: Option<String>,
|
||||
pub is_admin: bool,
|
||||
#[sea_orm(unique)]
|
||||
pub email: Option<String>,
|
||||
#[sea_orm(unique)]
|
||||
#[serde(skip_serializing)]
|
||||
pub google_id: Option<String>,
|
||||
pub family_id: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::family::Entity",
|
||||
from = "Column::FamilyId",
|
||||
to = "super::family::Column::Id"
|
||||
)]
|
||||
Family,
|
||||
}
|
||||
|
||||
impl Related<super::family::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Family.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
|
||||
Reference in New Issue
Block a user