import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { FactionEntity } from './faction.entity';

@Entity('mdc_notices')
export class MDCNoticeEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column({ type: 'int' }) faction_id: number;
    @Column({ type: 'varchar', width: 256 }) notice: string;
    @Column({ type: 'varchar', width: 90 }) by: string;
    @Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP()' }) time: Date;

    @ManyToOne(() => FactionEntity, (faction) => faction.mdcNotices)
    @JoinColumn({ name: 'faction_id' })
    faction: FactionEntity;
}
