2024-03-22 05:34:08 +01:00
|
|
|
use sea_orm::entity::prelude::*;
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
|
|
|
|
#[sea_orm(table_name = "shares")]
|
|
|
|
pub struct Model {
|
|
|
|
#[sea_orm(primary_key)]
|
|
|
|
pub id: i64,
|
|
|
|
pub actor: String,
|
|
|
|
pub shares: String,
|
2024-03-23 04:40:39 +01:00
|
|
|
pub date: ChronoDateTimeUtc,
|
2024-03-22 05:34:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
2024-04-30 00:53:57 +02:00
|
|
|
pub enum Relation {
|
|
|
|
#[sea_orm(
|
|
|
|
belongs_to = "super::object::Entity",
|
|
|
|
from = "Column::Shares",
|
|
|
|
to = "super::object::Column::Id",
|
|
|
|
)]
|
|
|
|
Object
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Related<super::object::Entity> for Entity {
|
|
|
|
fn to() -> RelationDef {
|
|
|
|
Relation::Object.def()
|
|
|
|
}
|
|
|
|
}
|
2024-03-22 05:34:08 +01:00
|
|
|
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|