Go back to a compiling state, panicking on unimplemented db methods

This commit is contained in:
Antonio Scandurra 2022-12-01 15:13:34 +01:00
parent d2385bd6a0
commit db1d93576f
4 changed files with 1240 additions and 51 deletions

View file

@ -13,6 +13,12 @@ pub struct Model {
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::user::Entity",
from = "Column::HostUserId",
to = "super::user::Column::Id"
)]
HostUser,
#[sea_orm(
belongs_to = "super::room::Entity",
from = "Column::RoomId",
@ -23,6 +29,12 @@ pub enum Relation {
Worktree,
}
impl Related<super::user::Entity> for Entity {
fn to() -> RelationDef {
Relation::HostUser.def()
}
}
impl Related<super::room::Entity> for Entity {
fn to() -> RelationDef {
Relation::Room.def()