--- crms-enabled


ALTER TABLE crms
  ADD enabled BOOLEAN;

UPDATE crms
SET enabled = TRUE;

ALTER TABLE crms
  ALTER COLUMN enabled SET NOT NULL;

DROP INDEX crms_uniq;

CREATE UNIQUE INDEX crms_project_enabled_uniq
  ON crms (project_id)
  WHERE enabled = TRUE;
