You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
812 B
41 lines
812 B
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
ManyToOne,
|
|
CreateDateColumn,
|
|
UpdateDateColumn,
|
|
} from 'typeorm';
|
|
import { MediaStatus } from '../constants/media';
|
|
import Media from './Media';
|
|
|
|
@Entity()
|
|
class Season {
|
|
@PrimaryGeneratedColumn()
|
|
public id: number;
|
|
|
|
@Column()
|
|
public seasonNumber: number;
|
|
|
|
@Column({ type: 'int', default: MediaStatus.UNKNOWN })
|
|
public status: MediaStatus;
|
|
|
|
@Column({ type: 'int', default: MediaStatus.UNKNOWN })
|
|
public status4k: MediaStatus;
|
|
|
|
@ManyToOne(() => Media, (media) => media.seasons, { onDelete: 'CASCADE' })
|
|
public media: Promise<Media>;
|
|
|
|
@CreateDateColumn()
|
|
public createdAt: Date;
|
|
|
|
@UpdateDateColumn()
|
|
public updatedAt: Date;
|
|
|
|
constructor(init?: Partial<Season>) {
|
|
Object.assign(this, init);
|
|
}
|
|
}
|
|
|
|
export default Season;
|