mirror of
https://github.com/CloudNebulaProject/barycenter.git
synced 2026-04-10 13:10:42 +00:00
The migration creates the interval column as integer (INT4) but the entity and storage struct used i64 (INT8), causing a type mismatch error on PostgreSQL. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28 lines
958 B
Rust
28 lines
958 B
Rust
use sea_orm::entity::prelude::*;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Serialize, Deserialize)]
|
|
#[sea_orm(table_name = "device_codes")]
|
|
pub struct Model {
|
|
#[sea_orm(primary_key, auto_increment = false)]
|
|
pub device_code: String,
|
|
pub user_code: String,
|
|
pub client_id: String,
|
|
pub client_name: Option<String>,
|
|
pub scope: String,
|
|
pub device_info: Option<String>, // JSON: {ip_address, user_agent}
|
|
pub created_at: i64,
|
|
pub expires_at: i64,
|
|
pub last_poll_at: Option<i64>,
|
|
pub interval: i32,
|
|
pub status: String, // "pending" | "approved" | "denied" | "consumed"
|
|
pub subject: Option<String>,
|
|
pub auth_time: Option<i64>,
|
|
pub amr: Option<String>, // JSON array: ["pwd", "hwk"]
|
|
pub acr: Option<String>, // "aal1" or "aal2"
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {}
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|