members-database/entities/member_awards.ts

29 lines
659 B
TypeScript
Raw Normal View History

import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
2024-08-19 10:47:10 +00:00
import { member } from "./member";
import { award } from "./award";
@Entity()
export class member_awards {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
2024-08-19 10:47:10 +00:00
@Column({ type: "boolean", default: true })
given: boolean;
@Column({ type: "varchar", length: 255, nullable: true, default: null })
note?: string;
2024-08-19 10:47:10 +00:00
@Column({ type: "date" })
date: Date;
@ManyToOne(() => member, (member) => member.awards, {
onDelete: "RESTRICT",
})
member: member;
@ManyToOne(() => award, (award) => award.members, {
onDelete: "RESTRICT",
})
award: award;
}