members-database/entities/qualification.ts

20 lines
587 B
TypeScript
Raw Permalink Normal View History

import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
2024-08-23 07:10:40 +00:00
import { memberQualifications } from "./memberQualifications";
2024-08-17 14:38:08 +00:00
@Entity()
export class qualification {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
2024-08-17 14:38:08 +00:00
@Column({ type: "varchar", length: 255 })
qualification: string;
2024-08-19 10:47:10 +00:00
@Column({ type: "varchar", length: 255, nullable: true, default: null })
description?: string;
2024-08-17 14:38:08 +00:00
2024-08-23 07:10:40 +00:00
@OneToMany(() => memberQualifications, (memberQualifications) => memberQualifications.qualification, {
2024-08-17 14:38:08 +00:00
onDelete: "RESTRICT",
})
2024-08-23 07:10:40 +00:00
members: memberQualifications[];
2024-08-17 14:38:08 +00:00
}