31 lines
722 B
TypeScript
31 lines
722 B
TypeScript
|
import { Column, Entity, ManyToOne, PrimaryColumn, PrimaryGeneratedColumn } from "typeorm";
|
||
|
import { calendarType } from "./calendarType";
|
||
|
|
||
|
@Entity()
|
||
|
export class calendar {
|
||
|
@PrimaryGeneratedColumn("increment")
|
||
|
id: number;
|
||
|
|
||
|
@Column({ type: "date", nullable: false })
|
||
|
date: Date;
|
||
|
|
||
|
@Column({ type: "timestamp", nullable: true })
|
||
|
starttime: Date;
|
||
|
|
||
|
@Column({ type: "datetime", nullable: true })
|
||
|
endtime: Date;
|
||
|
|
||
|
@Column({ type: "varchar", length: 255, nullable: false })
|
||
|
title: string;
|
||
|
|
||
|
@Column({ type: "text", nullable: true })
|
||
|
content: string;
|
||
|
|
||
|
@ManyToOne(() => calendarType, (t) => t.calendar, {
|
||
|
nullable: false,
|
||
|
onDelete: "RESTRICT",
|
||
|
onUpdate: "RESTRICT",
|
||
|
})
|
||
|
type: calendarType;
|
||
|
}
|