Skip to content
Clone
563bb99
30 lines 1002 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 = "ci_runner_token")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub runner_id: Option<Uuid>,
pub name: String,
#[sea_orm(unique)]
pub token_hash: String,
pub token_salt: String,
pub token_last_eight: String,
pub space_id: Option<Uuid>,
pub single_use: bool,
pub used_at: Option<OffsetDateTime>,
pub revoked_at: Option<OffsetDateTime>,
pub expires_at: Option<OffsetDateTime>,
pub created_at: OffsetDateTime,
pub updated_at: OffsetDateTime,
#[sea_orm(belongs_to, from = "runner_id", to = "id")]
pub runner: BelongsTo<Option<super::runner::Entity>>,
#[sea_orm(belongs_to, from = "space_id", to = "id")]
pub space: BelongsTo<Option<super::super::space::spaces::Entity>>,
}
impl ActiveModelBehavior for ActiveModel {}