45 lines
1.2 KiB
Rust
45 lines
1.2 KiB
Rust
//! SeaORM Entity. Generated by sea-orm-codegen 0.5.0
|
|
|
|
use sea_orm::entity::prelude::*;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
|
#[sea_orm(table_name = "application")]
|
|
pub struct Model {
|
|
#[sea_orm(primary_key)]
|
|
pub id: i32,
|
|
pub app_name: String,
|
|
pub url: String,
|
|
pub description: Option<String>,
|
|
pub active: bool,
|
|
pub glyph: Option<String>,
|
|
pub application_category_id: Option<i32>,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {
|
|
#[sea_orm(
|
|
belongs_to = "super::application_category::Entity",
|
|
from = "Column::ApplicationCategoryId",
|
|
to = "super::application_category::Column::Id"
|
|
)]
|
|
ApplicationCategory,
|
|
}
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|
|
|
|
#[cfg(test)]
|
|
impl Default for Model {
|
|
fn default() -> Self {
|
|
Self {
|
|
id: Default::default(),
|
|
app_name: Default::default(),
|
|
url: Default::default(),
|
|
description: Default::default(),
|
|
active: Default::default(),
|
|
glyph: Default::default(),
|
|
application_category_id: Default::default(),
|
|
}
|
|
}
|
|
}
|