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

@Index('role_id', ['role_id'], {})
@Entity('role_menu_settings', { schema: DB_SCHEMA })
export class RoleMenuSettingsEntity {
  @PrimaryGeneratedColumn({ type: 'mediumint', name: 'id', unsigned: true })
  id: number;

  @Column('tinyint', { name: 'role_id' })
  role_id: number;

  @Column('longtext', { name: 'settings', nullable: true })
  settings: string | null;

  @Column('tinyint', { name: 'active', default: () => "'1'" })
  active: number;

  @Column('smallint', { name: 'by_user' })
  by_user: number;

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

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

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