//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.16

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize, Default)]
#[sea_orm(table_name = "oss_bucket")]
pub struct Model {
    #[sea_orm(column_name = "_id", primary_key, auto_increment = false, unique)]
    pub id: i64,
    #[sea_orm(unique)]
    pub name: String,
    pub remark: Option<String>,
    #[sea_orm(column_name = "_creator_id")]
    pub creator_id: i64,
    #[sea_orm(column_name = "_create_timestamp")]
    pub create_timestamp: i64,
    #[sea_orm(column_name = "_updator_id")]
    pub updator_id: i64,
    #[sea_orm(column_name = "_update_timestamp")]
    pub update_timestamp: i64,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
    #[sea_orm(has_many = "super::oss_obj_ref::Entity")]
    OssObjRef,
}

impl Related<super::oss_obj_ref::Entity> for Entity {
    fn to() -> RelationDef {
        Relation::OssObjRef.def()
    }
}

impl ActiveModelBehavior for ActiveModel {}
