65 lines
1.8 KiB
Rust
65 lines
1.8 KiB
Rust
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.11
|
|
|
|
use sea_orm::entity::prelude::*;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
|
#[sea_orm(table_name = "global_views")]
|
|
pub struct Model {
|
|
pub created_at: DateTimeWithTimeZone,
|
|
pub updated_at: DateTimeWithTimeZone,
|
|
#[sea_orm(primary_key, auto_increment = false)]
|
|
pub id: Uuid,
|
|
pub name: String,
|
|
#[sea_orm(column_type = "Text")]
|
|
pub description: String,
|
|
#[sea_orm(column_type = "JsonBinary")]
|
|
pub query: Json,
|
|
pub access: i16,
|
|
#[sea_orm(column_type = "JsonBinary")]
|
|
pub query_data: Json,
|
|
#[sea_orm(column_type = "Double")]
|
|
pub sort_order: f64,
|
|
pub created_by_id: Option<Uuid>,
|
|
pub updated_by_id: Option<Uuid>,
|
|
pub workspace_id: Uuid,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {
|
|
#[sea_orm(
|
|
belongs_to = "super::users::Entity",
|
|
from = "Column::CreatedById",
|
|
to = "super::users::Column::Id",
|
|
on_update = "NoAction",
|
|
on_delete = "NoAction"
|
|
)]
|
|
Users2,
|
|
#[sea_orm(
|
|
belongs_to = "super::users::Entity",
|
|
from = "Column::UpdatedById",
|
|
to = "super::users::Column::Id",
|
|
on_update = "NoAction",
|
|
on_delete = "NoAction"
|
|
)]
|
|
Users1,
|
|
#[sea_orm(
|
|
belongs_to = "super::workspaces::Entity",
|
|
from = "Column::WorkspaceId",
|
|
to = "super::workspaces::Column::Id",
|
|
on_update = "NoAction",
|
|
on_delete = "NoAction"
|
|
)]
|
|
Workspaces2,
|
|
#[sea_orm(
|
|
belongs_to = "super::workspaces::Entity",
|
|
from = "Column::WorkspaceId",
|
|
to = "super::workspaces::Column::Id",
|
|
on_update = "NoAction",
|
|
on_delete = "NoAction"
|
|
)]
|
|
Workspaces1,
|
|
}
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|