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, #[sea_orm(unique_key = "provider_login")] pub lower_login: String, pub login: String, pub name: Option, #[sea_orm(indexed)] pub email: Option, pub avatar_url: Option, #[sea_orm(indexed)] pub user_id: Option, pub created_at: OffsetDateTime, pub updated_at: OffsetDateTime, #[sea_orm(belongs_to, from = "user_id", to = "uid")] pub user: BelongsTo>, } impl ActiveModelBehavior for ActiveModel {}