mirror of
https://github.com/shiroyashik/doggy-watch.git
synced 2025-12-06 12:31:13 +03:00
Prototype
This commit is contained in:
commit
2844bb9149
19 changed files with 5483 additions and 0 deletions
33
entity/src/actions.rs
Normal file
33
entity/src/actions.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.2
|
||||
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
|
||||
#[sea_orm(table_name = "actions")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key)]
|
||||
pub id: i32,
|
||||
pub uid: String,
|
||||
pub vid: i32,
|
||||
pub created_at: DateTime,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::videos::Entity",
|
||||
from = "Column::Vid",
|
||||
to = "super::videos::Column::Id",
|
||||
on_update = "NoAction",
|
||||
on_delete = "Cascade"
|
||||
)]
|
||||
Videos,
|
||||
}
|
||||
|
||||
impl Related<super::videos::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Videos.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue