members-database/entities/award.ts

16 lines
403 B
TypeScript

import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
import { memberAwards } from "./memberAwards";
@Entity()
export class award {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "varchar", length: 255 })
award: string;
@OneToMany(() => memberAwards, (member) => member.award, {
onDelete: "RESTRICT",
})
members: memberAwards[];
}