import { Entity, PrimaryGeneratedColumn, Column, Check } from 'typeorm';

@Entity('platform_changelog')
@Check(`"category" IN ('feature', 'bugfix', 'module', 'security')`)
export class PlatformChangelog {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column({ type: 'varchar', length: 20 })
  version: string;

  @Column({ type: 'varchar', length: 200 })
  title: string;

  @Column({ type: 'text' })
  body: string;

  @Column({ type: 'varchar', length: 20, default: 'feature' })
  category: string;

  @Column({ type: 'timestamptz', default: () => 'NOW()' })
  published_at: Date;
}
