52 lines
1 KiB
TypeScript
52 lines
1 KiB
TypeScript
import {
|
|
Column,
|
|
Entity,
|
|
ManyToOne,
|
|
PrimaryColumn,
|
|
PrimaryGeneratedColumn,
|
|
CreateDateColumn,
|
|
UpdateDateColumn,
|
|
AfterUpdate,
|
|
BeforeUpdate,
|
|
} from "typeorm";
|
|
import { calendarType } from "../settings/calendarType";
|
|
|
|
@Entity()
|
|
export class calendar {
|
|
@PrimaryGeneratedColumn("uuid")
|
|
id: string;
|
|
|
|
@Column({ type: "datetime", nullable: false })
|
|
starttime: Date;
|
|
|
|
@Column({ type: "datetime", nullable: false })
|
|
endtime: Date;
|
|
|
|
@Column({ type: "varchar", length: 255, nullable: false })
|
|
title: string;
|
|
|
|
@Column({ type: "text", nullable: true })
|
|
content: string;
|
|
|
|
@Column({ type: "text", nullable: true })
|
|
location: string;
|
|
|
|
@Column({ type: "boolean", default: false })
|
|
allDay: boolean;
|
|
|
|
@Column({ type: "int", default: 1 })
|
|
sequence: number;
|
|
|
|
@CreateDateColumn()
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn()
|
|
updatedAt: Date;
|
|
|
|
@ManyToOne(() => calendarType, (t) => t.calendar, {
|
|
nullable: false,
|
|
onDelete: "RESTRICT",
|
|
onUpdate: "RESTRICT",
|
|
})
|
|
type: calendarType;
|
|
}
|