Files
descrybe/apps/api/sql/schema/026_plan_features.sql
greeneclipse 8580c996c3 Initial commit of Descrybe v2 without local scratch artifacts.
Drop one-shot tmp/axe scripts and agent i18n scratch so the Gitea tree is deployable.
2026-08-09 22:47:43 +02:00

22 lines
766 B
SQL

-- +goose Up
-- Plan dashboard feature permissions (per-plan overrides + global section/feature gates).
ALTER TABLE plans
ADD COLUMN IF NOT EXISTS features JSONB NOT NULL DEFAULT '{}'::jsonb;
CREATE TABLE IF NOT EXISTS platform_feature_gates (
gate_key TEXT PRIMARY KEY,
kind TEXT NOT NULL CHECK (kind IN ('section', 'feature')),
enabled BOOLEAN NOT NULL DEFAULT true,
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_by UUID NULL REFERENCES users(id) ON DELETE SET NULL
);
CREATE INDEX IF NOT EXISTS platform_feature_gates_kind_idx
ON platform_feature_gates (kind);
-- +goose Down
DROP INDEX IF EXISTS platform_feature_gates_kind_idx;
DROP TABLE IF EXISTS platform_feature_gates;
ALTER TABLE plans DROP COLUMN IF EXISTS features;