Skip to main content

durable_db/entity/
task_queue.rs

1//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.19
2
3use sea_orm::entity::prelude::*;
4use serde::{Deserialize, Serialize};
5
6#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
7#[sea_orm(schema_name = "durable", table_name = "task_queue")]
8pub struct Model {
9    #[sea_orm(primary_key, auto_increment = false, column_type = "Text")]
10    pub name: String,
11    pub max_concurrency: Option<i32>,
12    pub rate_limit: Option<i32>,
13    pub rate_limit_window_ms: Option<i64>,
14    pub created_at: DateTimeWithTimeZone,
15}
16
17#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
18pub enum Relation {
19    #[sea_orm(has_many = "super::task::Entity")]
20    Task,
21}
22
23impl Related<super::task::Entity> for Entity {
24    fn to() -> RelationDef {
25        Relation::Task.def()
26    }
27}
28
29impl ActiveModelBehavior for ActiveModel {}