2023-10-09 18:49:57 +00:00
|
|
|
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3
|
|
|
|
|
|
|
|
|
|
use sea_orm::entity::prelude::*;
|
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
|
|
|
|
|
#[sea_orm(table_name = "user")]
|
|
|
|
|
pub struct Model {
|
|
|
|
|
#[sea_orm(primary_key)]
|
|
|
|
|
pub id: i64,
|
|
|
|
|
#[sea_orm(unique)]
|
|
|
|
|
pub name: String,
|
|
|
|
|
pub password: String,
|
|
|
|
|
pub is_admin: bool,
|
2023-10-10 18:25:02 +00:00
|
|
|
pub can_download: bool,
|
|
|
|
|
pub scrobbling_enabled: bool,
|
2023-10-09 18:49:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
2023-10-14 16:03:20 +00:00
|
|
|
pub enum Relation {
|
|
|
|
|
#[sea_orm(has_many = "super::user_session::Entity")]
|
|
|
|
|
UserSession,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Related<super::user_session::Entity> for Entity {
|
|
|
|
|
fn to() -> RelationDef {
|
|
|
|
|
Relation::UserSession.def()
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-10-09 18:49:57 +00:00
|
|
|
|
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|