36 lines
881 B
Rust

//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
use sea_orm::entity::prelude::*;
/// 🐎 » ticker entity model
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "ticker")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
pub symbol: String,
pub quote_symbol: Option<String>,
pub market_id: String,
pub active: bool,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::market::Entity",
from = "Column::MarketId",
to = "super::market::Column::Id",
on_update = "Cascade",
on_delete = "Cascade"
)]
Market,
}
impl Related<super::market::Entity> for Entity {
fn to() -> RelationDef {
Relation::Market.def()
}
}
impl ActiveModelBehavior for ActiveModel {}