import { DB_SCHEMA } from 'src/utils';
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity('tv_shows', { schema: DB_SCHEMA })
export class TvShowsEntity {
  @PrimaryGeneratedColumn({ type: 'tinyint', name: 'id' })
  id: number;

  @Column('varchar', { name: 'title', nullable: true, length: 50 })
  title: string | null;

  @Column('varchar', { name: 'pagetype', length: 25 })
  pagetype: string;

  @Column('varchar', { name: 'day', nullable: true, length: 50 })
  day: string | null;

  @Column('varchar', { name: 'timing', nullable: true, length: 50 })
  timing: string | null;

  @Column('varchar', { name: 'image', length: 255 })
  image: string;

  @Column('tinyint', {
    name: 'active',
    nullable: true,
    width: 1,
    default: () => "'1'",
  })
  active: boolean | null;

  @Column('smallint', { name: 'by_user', nullable: true })
  by_user: number | null;

  @Column('timestamp', { name: 'created', default: () => 'CURRENT_TIMESTAMP' })
  created: Date;

  @Column('datetime', { name: 'modified', default: () => 'CURRENT_TIMESTAMP' })
  modified: Date;
}
