16 lines
606 B
TypeScript
16 lines
606 B
TypeScript
import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
import { CompanyEntity } from './company.entity';
|
|
|
|
@Entity('company_uniforms')
|
|
export class CompanyUniformEntity {
|
|
@PrimaryGeneratedColumn() id: number;
|
|
@Column() company_id: number;
|
|
@Column({ type: 'int', nullable: true }) position_id: number | null;
|
|
@Column({ type: 'varchar', length: 32 }) name: string;
|
|
@Column({ type: 'json' }) clothing_items: number[];
|
|
|
|
@ManyToOne(() => CompanyEntity, (company) => company.uniforms)
|
|
@JoinColumn({ name: 'company_id' })
|
|
company: CompanyEntity;
|
|
}
|