forked from TWS/kalkutago
39 lines
943 B
Rust
39 lines
943 B
Rust
//! `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 = "ticks")]
|
|
pub struct Model {
|
|
#[sea_orm(primary_key)]
|
|
pub id: i32,
|
|
pub track_id: Option<i32>,
|
|
pub year: Option<i32>,
|
|
pub month: Option<i32>,
|
|
pub day: Option<i32>,
|
|
pub hour: Option<i32>,
|
|
pub minute: Option<i32>,
|
|
pub second: Option<i32>,
|
|
pub has_time_info: Option<i32>,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {
|
|
#[sea_orm(
|
|
belongs_to = "super::tracks::Entity",
|
|
from = "Column::TrackId",
|
|
to = "super::tracks::Column::Id",
|
|
on_update = "NoAction",
|
|
on_delete = "NoAction"
|
|
)]
|
|
Tracks,
|
|
}
|
|
|
|
impl Related<super::tracks::Entity> for Entity {
|
|
fn to() -> RelationDef {
|
|
Relation::Tracks.def()
|
|
}
|
|
}
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|