Skip to content
Clone
563bb99
19 lines 533 B Rust
use sea_orm::entity::prelude::*;
use time::OffsetDateTime;
use uuid::Uuid;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "system_rate_limits")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
#[sea_orm(unique_key = "key_window")]
pub key: String,
#[sea_orm(unique_key = "key_window")]
pub window_start: OffsetDateTime,
pub count: i64,
pub created_at: OffsetDateTime,
}
impl ActiveModelBehavior for ActiveModel {}