use sea_orm::entity::prelude::*; use time::OffsetDateTime; use uuid::Uuid; #[sea_orm::model] #[derive(Clone, Debug, PartialEq, DeriveEntityModel)] #[sea_orm(table_name = "user_devices")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: Uuid, #[sea_orm(unique_key = "user_device")] pub user_id: Uuid, #[sea_orm(belongs_to, from = "user_id", to = "uid")] pub user: BelongsTo, pub device_name: Option, pub device_type: Option, #[sea_orm(unique_key = "user_device")] pub device_hash: String, pub user_agent: Option, pub os: Option, pub last_ip_hash: Option, pub last_seen_at: OffsetDateTime, pub first_seen_at: OffsetDateTime, pub is_trusted: bool, pub created_at: OffsetDateTime, pub updated_at: OffsetDateTime, } impl ActiveModelBehavior for ActiveModel {}