ALTER TABLE cases ADD COLUMN content_order text NOT NULL DEFAULT 'position', ADD COLUMN content_order_dir text NOT NULL DEFAULT 'asc'; ALTER TABLE cases ADD CONSTRAINT cases_content_order CHECK (content_order IN ('date', 'position')), ADD CONSTRAINT cases_content_order_dir CHECK (content_order_dir IN ('asc', 'desc')); ALTER TABLE matters ADD COLUMN content_order text NOT NULL DEFAULT 'position', ADD COLUMN content_order_dir text NOT NULL DEFAULT 'asc'; ALTER TABLE matters ADD CONSTRAINT matters_content_order CHECK (content_order IN ('date', 'position')), ADD CONSTRAINT matters_content_order_dir CHECK (content_order_dir IN ('asc', 'desc'));