members-database/entities/communication.ts

38 lines
955 B
TypeScript

import { Column, Entity, 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)
type: communicationType;
@ManyToOne(() => member, (member) => member.awards, {
onDelete: "RESTRICT",
})
member: member;
}