Ergänze Entwurfsstatus für Termine und Plantafel

This commit is contained in:
2026-05-19 12:18:30 +02:00
parent 0ac22d346f
commit ea392af094
6 changed files with 176 additions and 7 deletions

View File

@@ -0,0 +1,8 @@
ALTER TABLE "events" ADD COLUMN "color" text;
UPDATE "events" AS e
SET "color" = COALESCE(t."calendarConfig"->'quickEntry'->>'color', '#2563eb')
FROM "tenants" AS t
WHERE e."tenant" = t."id"
AND e."quick" = true
AND e."color" IS NULL;

View File

@@ -0,0 +1,5 @@
ALTER TABLE "events" ADD COLUMN "state" text DEFAULT 'Final' NOT NULL;
UPDATE "events"
SET "state" = 'Final'
WHERE "state" IS NULL;

View File

@@ -243,29 +243,36 @@
{
"idx": 34,
"version": "7",
"when": 1777420800000,
"tag": "0034_events_color",
"breakpoints": true
},
{
"idx": 35,
"version": "7",
"when": 1778191200000,
"tag": "0035_contract_history",
"breakpoints": true
},
{
"idx": 35,
"idx": 36,
"version": "7",
"when": 1778194800000,
"tag": "0036_allowed_contracttypes",
"breakpoints": true
},
{
"idx": 36,
"idx": 37,
"version": "7",
"when": 1778840100000,
"tag": "0037_outgoing_sepa_mandates",
"breakpoints": true
},
{
"idx": 37,
"idx": 38,
"version": "7",
"when": 1778840200000,
"tag": "0034_profile_availability_note",
"when": 1779158400000,
"tag": "0038_events_state",
"breakpoints": true
}
]

View File

@@ -32,6 +32,8 @@ export const events = pgTable(
eventtype: text("eventtype").default("Umsetzung"),
quick: boolean("quick").notNull().default(false),
state: text("state").notNull().default("Final"),
color: text("color"),
project: bigint("project", { mode: "number" }), // FK follows when projects.ts exists