self defined value tables
This commit is contained in:
parent
6286add31c
commit
c85f23ed73
8 changed files with 382 additions and 3 deletions
16
src/entity/award.ts
Normal file
16
src/entity/award.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
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[];
|
||||
}
|
40
src/entity/communication.ts
Normal file
40
src/entity/communication.ts
Normal file
|
@ -0,0 +1,40 @@
|
|||
import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
//import { member } from "./member";
|
||||
import { communicationType } from "./communicationType";
|
||||
|
||||
@Entity()
|
||||
export class communication {
|
||||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "boolean", default: false })
|
||||
preffered: boolean;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
mobile: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
email: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
city: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
street: string;
|
||||
|
||||
@Column({ type: "integer" })
|
||||
streetNumber: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
streetNumberAddition: string;
|
||||
|
||||
@ManyToOne(() => communicationType, (communicationType) => communicationType.communications, {
|
||||
nullable: false,
|
||||
})
|
||||
type: communicationType;
|
||||
|
||||
// @ManyToOne(() => member, (member) => member.awards, {
|
||||
// onDelete: "RESTRICT",
|
||||
// })
|
||||
// member: member;
|
||||
}
|
31
src/entity/communicationType.ts
Normal file
31
src/entity/communicationType.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
|
||||
import { communication } from "./communication";
|
||||
|
||||
@Entity()
|
||||
export class communicationType {
|
||||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
type: string;
|
||||
|
||||
@Column({
|
||||
type: "varchar",
|
||||
length: 255,
|
||||
default: "",
|
||||
transformer: {
|
||||
from(value: string): Array<string> {
|
||||
return value.split(",");
|
||||
},
|
||||
to(value: Array<string>): string {
|
||||
return value.join(",");
|
||||
},
|
||||
},
|
||||
})
|
||||
useColumns: Array<string>;
|
||||
|
||||
@OneToMany(() => communication, (communication) => communication.type, {
|
||||
onDelete: "RESTRICT",
|
||||
})
|
||||
communications: communication[];
|
||||
}
|
16
src/entity/executivePosition.ts
Normal file
16
src/entity/executivePosition.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
|
||||
//import { memberExecutivePositions } from "./memberExecutivePositions";
|
||||
|
||||
@Entity()
|
||||
export class executivePosition {
|
||||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
position: string;
|
||||
|
||||
// @OneToMany(() => memberExecutivePositions, (memberExecutivePositions) => memberExecutivePositions.executivePosition, {
|
||||
// onDelete: "RESTRICT",
|
||||
// })
|
||||
// members: memberExecutivePositions[];
|
||||
}
|
14
src/entity/membershipStatus.ts
Normal file
14
src/entity/membershipStatus.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
|
||||
//import { membership } from "./membership";
|
||||
|
||||
@Entity()
|
||||
export class membershipStatus {
|
||||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
status: string;
|
||||
|
||||
// @OneToMany(() => membership, (membership) => membership.status)
|
||||
// memberships: membership[];
|
||||
}
|
19
src/entity/qualification.ts
Normal file
19
src/entity/qualification.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
|
||||
//import { memberQualifications } from "./memberQualifications";
|
||||
|
||||
@Entity()
|
||||
export class qualification {
|
||||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255 })
|
||||
qualification: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true, default: null })
|
||||
description?: string;
|
||||
|
||||
// @OneToMany(() => memberQualifications, (memberQualifications) => memberQualifications.qualification, {
|
||||
// onDelete: "RESTRICT",
|
||||
// })
|
||||
// members: memberQualifications[];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue