//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.4 use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] #[sea_orm(table_name = "notes")] pub struct Model { pub created_at: DateTime, pub updated_at: DateTime, #[sea_orm(primary_key)] pub id: i32, #[sea_orm(unique)] pub pid: Uuid, pub title: Option, pub content: Option, pub owner_id: i32, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation { #[sea_orm( belongs_to = "super::users::Entity", from = "Column::OwnerId", to = "super::users::Column::Id", on_update = "Cascade", on_delete = "Cascade" )] Users, } impl Related for Entity { fn to() -> RelationDef { Relation::Users.def() } } impl ActiveModelBehavior for ActiveModel {}