flix_db/entity/watched/
shows.rs

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