//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.16
use sea_orm::entity::prelude::*;
use serde::{Serialize, Deserialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "registration_tokens")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
#[sea_orm(unique)]
pub token: String,
pub email: Option<String>,
pub created_by_user_id: Option<i64>,
pub expires_at: DateTimeWithTimeZone,
pub is_used: bool,
pub used_by_user_id: Option<i64>,
pub used_at: Option<DateTimeWithTimeZone>,
pub created_at: DateTimeWithTimeZone,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::users::Entity",
from = "Column::CreatedByUserId",
to = "super::users::Column::Id",
on_update = "Cascade",
on_delete = "SetNull"
)]
Users2,
#[sea_orm(
belongs_to = "super::users::Entity",
from = "Column::UsedByUserId",
to = "super::users::Column::Id",
on_update = "Cascade",
on_delete = "SetNull"
)]
Users1,
}
impl ActiveModelBehavior for ActiveModel {}
⭐
Log in to mark this repository.
1.2 KiB · text
History
1ce9641