All checks were successful
CI / build-and-deploy (push) Successful in 1m22s
Den Zeitraum-Bereich habe ich dabei gleich mit aufgeräumt: die Auswahl des aktuellen Haushalts ist breiter und sauberer angeordnet, und die Desktop-Nutzerverwaltung ist jetzt wirklich links Anlegen + Schwelle und rechts die Nutzerliste. Seed und Backup/Restore kennen die neuen Felder ebenfalls in seed.ts, route.ts und route.ts.
23 lines
790 B
SQL
23 lines
790 B
SQL
ALTER TABLE "users"
|
|
ADD COLUMN "approval_permissions" "ApprovalType"[] NOT NULL DEFAULT ARRAY[]::"ApprovalType"[];
|
|
|
|
UPDATE "users"
|
|
SET "approval_permissions" = CASE
|
|
WHEN "approval_preference" IS NOT NULL THEN ARRAY["approval_preference"]::"ApprovalType"[]
|
|
WHEN "role" = 'FINANCE' THEN ARRAY['FINANCE']::"ApprovalType"[]
|
|
ELSE ARRAY[]::"ApprovalType"[]
|
|
END;
|
|
|
|
CREATE TABLE "app_settings" (
|
|
"id" TEXT NOT NULL,
|
|
"approval_threshold" DECIMAL(10,2) NOT NULL DEFAULT 50.00,
|
|
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
|
|
CONSTRAINT "app_settings_pkey" PRIMARY KEY ("id")
|
|
);
|
|
|
|
INSERT INTO "app_settings" ("id", "approval_threshold", "updated_at")
|
|
VALUES ('global', 50.00, CURRENT_TIMESTAMP)
|
|
ON CONFLICT ("id") DO NOTHING;
|