Skip to content
Clone
b453d5d
29 lines 903 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 = "user_external_identity")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
#[sea_orm(unique_key = "provider_login")]
pub provider: String,
pub external_id: Option<String>,
#[sea_orm(unique_key = "provider_login")]
pub lower_login: String,
pub login: String,
pub name: Option<String>,
#[sea_orm(indexed)]
pub email: Option<String>,
pub avatar_url: Option<String>,
#[sea_orm(indexed)]
pub user_id: Option<i64>,
pub created_at: OffsetDateTime,
pub updated_at: OffsetDateTime,
#[sea_orm(belongs_to, from = "user_id", to = "uid")]
pub user: BelongsTo<Option<super::user::Entity>>,
}
impl ActiveModelBehavior for ActiveModel {}