-- Run once against your database. Stores the ORAC form chosen by admin when assigning executor/verifier.
-- Resolves effective form in API as: COALESCE(orac_assessments.form_id, MIN(form) for location).

ALTER TABLE `orac_assessments`
  ADD COLUMN `form_id` int DEFAULT NULL AFTER `department_id`,
  ADD KEY `orac_form_details_orac_assessments` (`form_id`),
  ADD CONSTRAINT `orac_form_details_orac_assessments`
    FOREIGN KEY (`form_id`) REFERENCES `orac_form_details` (`form_id`);
