Files
descrybe/apps/api/sql/schema/008_standard_fields_config.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

17 lines
630 B
SQL

-- +goose Up
ALTER TABLE standard_fields
ADD COLUMN IF NOT EXISTS enabled BOOLEAN NOT NULL DEFAULT true,
ADD COLUMN IF NOT EXISTS unit TEXT,
ADD COLUMN IF NOT EXISTS sort_order INT NOT NULL DEFAULT 0,
ADD COLUMN IF NOT EXISTS mapping_hints JSONB NOT NULL DEFAULT '[]'::jsonb;
CREATE INDEX IF NOT EXISTS standard_fields_company_enabled_idx
ON standard_fields(company_id, enabled);
-- +goose Down
DROP INDEX IF EXISTS standard_fields_company_enabled_idx;
ALTER TABLE standard_fields
DROP COLUMN IF EXISTS mapping_hints,
DROP COLUMN IF EXISTS sort_order,
DROP COLUMN IF EXISTS unit,
DROP COLUMN IF EXISTS enabled;