tildes-statistics/source/entities/group_data.rs

37 lines
872 B
Rust
Raw Normal View History

//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "group_data")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
#[sea_orm(column_type = "Text", nullable)]
pub description: Option<String>,
#[sea_orm(column_type = "Text")]
pub name: String,
pub snapshot_id: i64,
pub subscribers: i64,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::snapshot::Entity",
from = "Column::SnapshotId",
to = "super::snapshot::Column::Id",
on_update = "NoAction",
on_delete = "Cascade"
)]
Snapshot,
}
impl Related<super::snapshot::Entity> for Entity {
fn to() -> RelationDef {
Relation::Snapshot.def()
}
}
impl ActiveModelBehavior for ActiveModel {}