43f85d73d5c989f00702e5a586bdfe0911dc3e36 / frogue / src / entities / ssh_keys.rs
Raw
//! `SeaORM` Entity, @generated by sea-orm-codegen 2.0
use sea_orm::entity::prelude::*;
use serde::Serialize;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Serialize)]
#[sea_orm(table_name = "ssh_keys")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
pub user_id: i64,
pub name: String,
pub algorithm: String,
#[sea_orm(unique)]
pub fingerprint: String,
pub public_key: String,
pub created_at: DateTimeWithTimeZone,
pub last_used_at: Option<DateTimeWithTimeZone>,
#[sea_orm(
belongs_to,
from = "user_id",
to = "id",
on_update = "NoAction",
on_delete = "Cascade"
)]
pub users: BelongsTo<super::users::Entity>,
}
impl ActiveModelBehavior for ActiveModel {}