flix_db/entity/watched/
seasons.rs

1//! Episode entity
2
3use flix_model::id::{RawId, ShowId};
4use flix_model::numbers::SeasonNumber;
5
6use chrono::NaiveDate;
7use sea_orm::{
8	ActiveModelBehavior, DeriveEntityModel, DerivePrimaryKey, DeriveRelation, EnumIter,
9	PrimaryKeyTrait,
10};
11
12/// The database representation of a watched movie
13#[derive(Debug, Clone, DeriveEntityModel)]
14#[sea_orm(table_name = "flix_watched_seasons")]
15pub struct Model {
16	/// The season's show's ID
17	#[sea_orm(primary_key, auto_increment = false)]
18	pub show: ShowId,
19	/// The season's number
20	#[sea_orm(primary_key, auto_increment = false)]
21	pub season: SeasonNumber,
22	/// The user's ID
23	#[sea_orm(primary_key, auto_increment = false)]
24	pub user_id: RawId,
25	/// The date this season was watched
26	pub watched_date: NaiveDate,
27}
28
29impl ActiveModelBehavior for ActiveModel {}
30
31/// Relation
32#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
33pub enum Relation {}