extend base schema for future features

This commit is contained in:
Julian Krauser 2025-01-31 11:06:02 +01:00
parent b7b6694407
commit 0b7de992c8
5 changed files with 21 additions and 2 deletions

View file

@ -43,6 +43,9 @@ export class calendar {
@UpdateDateColumn() @UpdateDateColumn()
updatedAt: Date; updatedAt: Date;
@Column({ type: "varchar", nullable: true, default: null, unique: true })
webpageId: string;
@ManyToOne(() => calendarType, (t) => t.calendar, { @ManyToOne(() => calendarType, (t) => t.calendar, {
nullable: false, nullable: false,
onDelete: "RESTRICT", onDelete: "RESTRICT",

View file

@ -9,7 +9,7 @@ export class calendarType {
@Column({ type: "varchar", length: 255, unique: true }) @Column({ type: "varchar", length: 255, unique: true })
type: string; type: string;
@Column({ type: "boolean" }) // none specified cal dav request @Column({ type: "boolean", default: false }) // none specified cal dav request
nscdr: boolean; nscdr: boolean;
@Column({ type: "varchar", length: 255 }) @Column({ type: "varchar", length: 255 })
@ -18,6 +18,9 @@ export class calendarType {
@Column({ type: "varchar", length: 255, nullable: true, default: null }) @Column({ type: "varchar", length: 255, nullable: true, default: null })
passphrase: string | null; passphrase: string | null;
@Column({ type: "boolean", default: false })
sendToWebpage: boolean;
@OneToMany(() => calendar, (c) => c.type, { @OneToMany(() => calendar, (c) => c.type, {
nullable: false, nullable: false,
onDelete: "RESTRICT", onDelete: "RESTRICT",

View file

@ -22,6 +22,9 @@ export class user {
@Column({ type: "varchar", length: 255 }) @Column({ type: "varchar", length: 255 })
secret: string; secret: string;
@Column({ type: "boolean", default: false })
static: boolean;
@Column({ type: "boolean", default: false }) @Column({ type: "boolean", default: false })
isOwner: boolean; isOwner: boolean;

View file

@ -59,6 +59,7 @@ export const user_table = new Table({
{ name: "firstname", type: getTypeByORM("varchar"), length: "255", isNullable: false }, { name: "firstname", type: getTypeByORM("varchar"), length: "255", isNullable: false },
{ name: "lastname", type: getTypeByORM("varchar"), length: "255", isNullable: false }, { name: "lastname", type: getTypeByORM("varchar"), length: "255", isNullable: false },
{ name: "secret", type: getTypeByORM("varchar"), length: "255", isNullable: false }, { name: "secret", type: getTypeByORM("varchar"), length: "255", isNullable: false },
{ name: "static", type: getTypeByORM("boolean"), isNullable: false, default: false },
{ name: "isOwner", type: getTypeByORM("boolean"), isNullable: false, default: false }, { name: "isOwner", type: getTypeByORM("boolean"), isNullable: false, default: false },
], ],
}); });

View file

@ -6,9 +6,10 @@ export const calendar_type_table = new Table({
columns: [ columns: [
{ name: "id", type: getTypeByORM("int"), isPrimary: true, isGenerated: true, generationStrategy: "increment" }, { name: "id", type: getTypeByORM("int"), isPrimary: true, isGenerated: true, generationStrategy: "increment" },
{ name: "type", type: getTypeByORM("varchar"), length: "255", isUnique: true, isNullable: false }, { name: "type", type: getTypeByORM("varchar"), length: "255", isUnique: true, isNullable: false },
{ name: "nscdr", type: getTypeByORM("boolean"), isNullable: false }, { name: "nscdr", type: getTypeByORM("boolean"), isNullable: false, default: false },
{ name: "color", type: getTypeByORM("varchar"), length: "255", isNullable: false }, { name: "color", type: getTypeByORM("varchar"), length: "255", isNullable: false },
{ name: "passphrase", type: getTypeByORM("varchar"), length: "255", isNullable: true }, { name: "passphrase", type: getTypeByORM("varchar"), length: "255", isNullable: true },
{ name: "sendToWebpage", type: getTypeByORM("boolean"), isNullable: false, default: false },
], ],
}); });
@ -45,6 +46,14 @@ export const calendar_table = new Table({
default: "CURRENT_TIMESTAMP(6)", default: "CURRENT_TIMESTAMP(6)",
onUpdate: "CURRENT_TIMESTAMP(6)", onUpdate: "CURRENT_TIMESTAMP(6)",
}, },
{
name: "webpageId",
type: getTypeByORM("varchar"),
length: "255",
isNullable: true,
default: null,
isUnique: true,
},
{ name: "typeId", type: getTypeByORM("int"), isNullable: false }, { name: "typeId", type: getTypeByORM("int"), isNullable: false },
], ],
foreignKeys: [ foreignKeys: [