use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "channels")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
pub handle: Option<String>,
pub description: Option<String>,
pub uploads_playlist_id: Option<String>,
pub title: Option<String>,
pub thumbnail_url: Option<String>,
#[sea_orm(column_type = "JsonBinary", nullable)]
pub thumbnails: Option<serde_json::Value>,
pub subscriber_count: Option<i64>,
pub video_count: Option<i64>,
pub view_count: Option<i64>,
pub hidden_subscriber_count: Option<bool>,
pub stats_refreshed_at: Option<DateTimeWithTimeZone>,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub last_full_sync_at: Option<DateTimeWithTimeZone>,
pub last_full_sync_filter: Option<String>,
pub latest_published_at: Option<DateTimeWithTimeZone>,
pub harvest_page_token: Option<String>,
#[sea_orm(column_type = "Text")]
pub status: String,
pub membership_open: bool,
#[sea_orm(column_type = "JsonBinary", nullable)]
pub links: Option<serde_json::Value>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::video::Entity")]
Video,
}
impl Related<super::video::Entity> for Entity {
fn to() -> RelationDef {
Relation::Video.def() }
}
impl ActiveModelBehavior for ActiveModel {}