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
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
pub mod users;
|
||||
pub mod devices;
|
||||
pub mod sessions;
|
||||
pub mod prelude;
|
||||
pub mod sessions;
|
||||
pub mod users;
|
||||
|
@@ -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},
|
||||
};
|
||||
|
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user