get back to where we were. but now with sea_orm and a more sane structure
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-07-14 22:29:35 +02:00
parent 35bde07b39
commit e33a734199
26 changed files with 126 additions and 312 deletions

View File

@@ -1,4 +1,4 @@
pub mod users;
pub mod devices;
pub mod sessions;
pub mod prelude;
pub mod sessions;
pub mod users;

View File

@@ -1,6 +1,6 @@
#[allow(unused_imports)]
pub use crate::{
devices::{self, Entity as Device},
sessions::{self, Entity as Session},
users::{self, Entity as User},
devices::{self, Entity as Device, Model as DeviceModel},
sessions::{self, Entity as Session, Model as SessionModel},
users::{self, Entity as User, Model as UserModel},
};

View File

@@ -1,4 +1,4 @@
use sea_orm::entity::prelude::*;
use sea_orm::{entity::prelude::*, Set};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "sessions")]
@@ -27,4 +27,11 @@ impl Related<super::devices::Entity> for Entity {
}
}
impl ActiveModelBehavior for ActiveModel {}
impl ActiveModelBehavior for ActiveModel {
fn new() -> Self {
Self {
uuid: Set(Uuid::new_v4()),
..ActiveModelTrait::default()
}
}
}