feat: add card due dates to schema
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
ALTER TYPE "public"."card_activity_type" ADD VALUE 'card.updated.dueDate.added' BEFORE 'card.archived';--> statement-breakpoint
|
||||||
|
ALTER TYPE "public"."card_activity_type" ADD VALUE 'card.updated.dueDate.updated' BEFORE 'card.archived';--> statement-breakpoint
|
||||||
|
ALTER TYPE "public"."card_activity_type" ADD VALUE 'card.updated.dueDate.removed' BEFORE 'card.archived';--> statement-breakpoint
|
||||||
|
ALTER TABLE "card_activity" ADD COLUMN "fromDueDate" timestamp;--> statement-breakpoint
|
||||||
|
ALTER TABLE "card_activity" ADD COLUMN "toDueDate" timestamp;--> statement-breakpoint
|
||||||
|
ALTER TABLE "card" ADD COLUMN "dueDate" timestamp;
|
||||||
@@ -44,6 +44,9 @@ export const activityTypes = [
|
|||||||
"card.updated.checklist.item.deleted",
|
"card.updated.checklist.item.deleted",
|
||||||
"card.updated.attachment.added",
|
"card.updated.attachment.added",
|
||||||
"card.updated.attachment.removed",
|
"card.updated.attachment.removed",
|
||||||
|
"card.updated.dueDate.added",
|
||||||
|
"card.updated.dueDate.updated",
|
||||||
|
"card.updated.dueDate.removed",
|
||||||
"card.archived",
|
"card.archived",
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
@@ -70,6 +73,7 @@ export const cards = pgTable("card", {
|
|||||||
.notNull()
|
.notNull()
|
||||||
.references(() => lists.id, { onDelete: "cascade" }),
|
.references(() => lists.id, { onDelete: "cascade" }),
|
||||||
importId: bigint("importId", { mode: "number" }).references(() => imports.id),
|
importId: bigint("importId", { mode: "number" }).references(() => imports.id),
|
||||||
|
dueDate: timestamp("dueDate"),
|
||||||
}).enableRLS();
|
}).enableRLS();
|
||||||
|
|
||||||
export const cardsRelations = relations(cards, ({ one, many }) => ({
|
export const cardsRelations = relations(cards, ({ one, many }) => ({
|
||||||
@@ -137,6 +141,8 @@ export const cardActivities = pgTable("card_activity", {
|
|||||||
),
|
),
|
||||||
fromComment: text("fromComment"),
|
fromComment: text("fromComment"),
|
||||||
toComment: text("toComment"),
|
toComment: text("toComment"),
|
||||||
|
fromDueDate: timestamp("fromDueDate"),
|
||||||
|
toDueDate: timestamp("toDueDate"),
|
||||||
sourceBoardId: bigint("sourceBoardId", { mode: "number" }).references(
|
sourceBoardId: bigint("sourceBoardId", { mode: "number" }).references(
|
||||||
() => boards.id,
|
() => boards.id,
|
||||||
{ onDelete: "set null" },
|
{ onDelete: "set null" },
|
||||||
|
|||||||
Reference in New Issue
Block a user