2024-01-23 12:29:19 +01:00
|
|
|
//! `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 = "labels")]
|
|
|
|
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,
|
|
|
|
pub created_by_id: Option<Uuid>,
|
|
|
|
pub project_id: Uuid,
|
|
|
|
pub updated_by_id: Option<Uuid>,
|
|
|
|
pub workspace_id: Uuid,
|
|
|
|
pub parent_id: Option<Uuid>,
|
|
|
|
pub color: String,
|
|
|
|
#[sea_orm(column_type = "Double")]
|
|
|
|
pub sort_order: f64,
|
|
|
|
pub external_id: Option<String>,
|
|
|
|
pub external_source: Option<String>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
|
|
pub enum Relation {
|
2024-02-10 11:03:40 +01:00
|
|
|
#[sea_orm(has_many = "super::github_repository_syncs::Entity")]
|
|
|
|
GithubRepositorySyncs,
|
|
|
|
#[sea_orm(has_many = "super::issue_labels::Entity")]
|
|
|
|
IssueLabels,
|
|
|
|
#[sea_orm(
|
|
|
|
belongs_to = "Entity",
|
|
|
|
from = "Column::ParentId",
|
|
|
|
to = "Column::Id",
|
|
|
|
on_update = "NoAction",
|
|
|
|
on_delete = "NoAction"
|
|
|
|
)]
|
|
|
|
SelfRef,
|
|
|
|
#[sea_orm(has_many = "super::page_labels::Entity")]
|
|
|
|
PageLabels,
|
2024-01-23 12:29:19 +01:00
|
|
|
#[sea_orm(
|
|
|
|
belongs_to = "super::projects::Entity",
|
|
|
|
from = "Column::ProjectId",
|
|
|
|
to = "super::projects::Column::Id",
|
|
|
|
on_update = "NoAction",
|
|
|
|
on_delete = "NoAction"
|
|
|
|
)]
|
2024-02-10 11:03:40 +01:00
|
|
|
Projects2,
|
|
|
|
#[sea_orm(
|
|
|
|
belongs_to = "super::projects::Entity",
|
|
|
|
from = "Column::ProjectId",
|
|
|
|
to = "super::projects::Column::Id",
|
|
|
|
on_update = "NoAction",
|
|
|
|
on_delete = "NoAction"
|
|
|
|
)]
|
|
|
|
Projects1,
|
|
|
|
#[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,
|
2024-01-23 12:29:19 +01:00
|
|
|
#[sea_orm(
|
|
|
|
belongs_to = "super::workspaces::Entity",
|
|
|
|
from = "Column::WorkspaceId",
|
|
|
|
to = "super::workspaces::Column::Id",
|
|
|
|
on_update = "NoAction",
|
|
|
|
on_delete = "NoAction"
|
|
|
|
)]
|
2024-02-10 11:03:40 +01:00
|
|
|
Workspaces2,
|
|
|
|
#[sea_orm(
|
|
|
|
belongs_to = "super::workspaces::Entity",
|
|
|
|
from = "Column::WorkspaceId",
|
|
|
|
to = "super::workspaces::Column::Id",
|
|
|
|
on_update = "NoAction",
|
|
|
|
on_delete = "NoAction"
|
|
|
|
)]
|
|
|
|
Workspaces1,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Related<super::github_repository_syncs::Entity> for Entity {
|
|
|
|
fn to() -> RelationDef {
|
|
|
|
Relation::GithubRepositorySyncs.def()
|
|
|
|
}
|
2024-01-23 12:29:19 +01:00
|
|
|
}
|
|
|
|
|
2024-02-10 11:03:40 +01:00
|
|
|
impl Related<super::issue_labels::Entity> for Entity {
|
2024-01-23 12:29:19 +01:00
|
|
|
fn to() -> RelationDef {
|
2024-02-10 11:03:40 +01:00
|
|
|
Relation::IssueLabels.def()
|
2024-01-23 12:29:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-10 11:03:40 +01:00
|
|
|
impl Related<super::page_labels::Entity> for Entity {
|
2024-01-23 12:29:19 +01:00
|
|
|
fn to() -> RelationDef {
|
2024-02-10 11:03:40 +01:00
|
|
|
Relation::PageLabels.def()
|
2024-01-23 12:29:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|