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

@Entity('gangnet_comments')
export class GangnetCommentEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column({ type: 'int' }) gangnet_id: number;
    @Column({ type: 'text' }) comment: string;
    @Column({ type: 'datetime' }) time: Date;
    @Column({ type: 'int' }) added_by: number;
    @Column({ type: 'varchar', width: 80 }) added_by_name: string;

    @ManyToOne(() => GangNetEntity, (net) => net.comments)
    @JoinColumn({ name: 'gangnet_id' })
    gangnet: GangNetEntity;
}
