34 lines
884 B
Rust
34 lines
884 B
Rust
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.10
|
|
|
|
use sea_orm::entity::prelude::*;
|
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
|
|
#[sea_orm(table_name = "rfid_cards")]
|
|
pub struct Model {
|
|
#[sea_orm(column_name = "cardId", primary_key, auto_increment = false)]
|
|
pub card_id: String,
|
|
#[sea_orm(column_name = "cardComment")]
|
|
pub card_comment: String,
|
|
pub member_id: Option<i32>,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {
|
|
#[sea_orm(
|
|
belongs_to = "super::members::Entity",
|
|
from = "Column::MemberId",
|
|
to = "super::members::Column::Id",
|
|
on_update = "NoAction",
|
|
on_delete = "NoAction"
|
|
)]
|
|
Members,
|
|
}
|
|
|
|
impl Related<super::members::Entity> for Entity {
|
|
fn to() -> RelationDef {
|
|
Relation::Members.def()
|
|
}
|
|
}
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|