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

@Entity('galleries', { schema: DB_SCHEMA })
export class GalleriesEntity {
  @PrimaryGeneratedColumn({ type: 'smallint', name: 'id' })
  id: number;

  @Column('char', { name: 'media_type', nullable: true, length: 5 })
  media_type: string | null;

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

  @Column('varchar', { name: 'title', length: 20 })
  title: string;

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

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

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

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

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

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

  @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;
}
