use sea_orm::entity::prelude::*; use time::OffsetDateTime; use uuid::Uuid; #[sea_orm::model] #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)] #[sea_orm(table_name = "ci_runner_token")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: Uuid, pub runner_id: Option, pub name: String, #[sea_orm(unique)] pub token_hash: String, pub token_salt: String, pub token_last_eight: String, pub space_id: Option, pub single_use: bool, pub used_at: Option, pub revoked_at: Option, pub expires_at: Option, pub created_at: OffsetDateTime, pub updated_at: OffsetDateTime, #[sea_orm(belongs_to, from = "runner_id", to = "id")] pub runner: BelongsTo>, #[sea_orm(belongs_to, from = "space_id", to = "id")] pub space: BelongsTo>, } impl ActiveModelBehavior for ActiveModel {}