can store and retrive data now lol ok xd

This commit is contained in:
2026-03-27 17:59:06 +00:00
parent 7ae73dc49e
commit 957cdf22cb
9 changed files with 242 additions and 2 deletions
+15
View File
@@ -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()