Include user table, identity and session table
This commit is contained in:
29
public/database/src/generated/entities/session.rs
Normal file
29
public/database/src/generated/entities/session.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
//! `SeaORM` Entity, @generated by sea-orm-codegen 2.0.0-rc.18
|
||||
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[sea_orm::model]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "session")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key, auto_increment = false)]
|
||||
pub id: Uuid,
|
||||
pub user_id: Uuid,
|
||||
#[sea_orm(unique)]
|
||||
pub refresh_token_hash: Option<String>,
|
||||
pub expires_at: DateTimeUtc,
|
||||
pub revoked_at: Option<DateTimeUtc>,
|
||||
pub created_at: DateTimeUtc,
|
||||
pub updated_at: DateTimeUtc,
|
||||
#[sea_orm(
|
||||
belongs_to,
|
||||
from = "user_id",
|
||||
to = "id",
|
||||
on_update = "Cascade",
|
||||
on_delete = "Cascade"
|
||||
)]
|
||||
pub user: HasOne<super::user::Entity>,
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
Reference in New Issue
Block a user