a06673b
use sea_orm::entity::prelude::*;
use time::OffsetDateTime;
use uuid::Uuid;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "user_oauth_provider")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub user_id: Uuid,
#[sea_orm(belongs_to, from = "user_id", to = "uid")]
pub user: BelongsTo<crate::user::users::Entity>,
#[sea_orm(unique_key = "provider_identity")]
pub provider: String,
#[sea_orm(unique_key = "provider_identity")]
pub provider_user_id: String,
pub provider_username: String,
pub access_token_hash: Option<String>,
pub refresh_token_hash: Option<String>,
pub token_expires_at: Option<OffsetDateTime>,
pub scopes: Vec<String>,
pub created_at: OffsetDateTime,
pub updated_at: OffsetDateTime,
pub last_used_at: Option<OffsetDateTime>,
}
impl ActiveModelBehavior for ActiveModel {}