can store and retrive data now lol ok xd
This commit is contained in:
@@ -10,11 +10,20 @@ pub struct Model {
|
||||
pub id_discord: i32,
|
||||
pub id_sender: i32,
|
||||
pub id_content: i32,
|
||||
pub id_channel: i32,
|
||||
pub id_server: i32,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::channel::Entity",
|
||||
from = "Column::IdChannel",
|
||||
to = "super::channel::Column::Id",
|
||||
on_update = "NoAction",
|
||||
on_delete = "NoAction"
|
||||
)]
|
||||
Channel,
|
||||
#[sea_orm(
|
||||
belongs_to = "super::content::Entity",
|
||||
from = "Column::IdContent",
|
||||
@@ -25,6 +34,12 @@ pub enum Relation {
|
||||
Content,
|
||||
}
|
||||
|
||||
impl Related<super::channel::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Channel.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl Related<super::content::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Content.def()
|
||||
|
||||
Reference in New Issue
Block a user