feat(migration): 0005 — add site_settings_tariff_category_labels table
Sub-table for the tariffCategoryLabels array field added to SiteSettings global. Was missing from prod DB causing query failures on every page load. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5ca72de20f
commit
f3c3d2c978
1 changed files with 21 additions and 0 deletions
21
migrations/0005_site_settings_tariff_labels.sql
Normal file
21
migrations/0005_site_settings_tariff_labels.sql
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
-- Migration 0005: site_settings_tariff_category_labels sub-table
|
||||
-- Added when tariffCategoryLabels array field was added to SiteSettings global
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "site_settings_tariff_category_labels" (
|
||||
"_order" integer NOT NULL,
|
||||
"_parent_id" integer NOT NULL,
|
||||
"id" varchar PRIMARY KEY NOT NULL,
|
||||
"key" varchar NOT NULL,
|
||||
"label" varchar NOT NULL
|
||||
);
|
||||
|
||||
DO $$ BEGIN
|
||||
ALTER TABLE "site_settings_tariff_category_labels" ADD CONSTRAINT "site_settings_tariff_category_labels_parent_id_fk"
|
||||
FOREIGN KEY ("_parent_id") REFERENCES "public"."site_settings"("id") ON DELETE cascade ON UPDATE no action;
|
||||
EXCEPTION WHEN duplicate_object THEN null; END $$;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS "site_settings_tariff_category_labels_order_idx"
|
||||
ON "site_settings_tariff_category_labels" USING btree ("_order");
|
||||
|
||||
CREATE INDEX IF NOT EXISTS "site_settings_tariff_category_labels_parent_id_idx"
|
||||
ON "site_settings_tariff_category_labels" USING btree ("_parent_id");
|
||||
Loading…
Add table
Reference in a new issue