exports.up = async (db) => {
  await db.query(`
    ALTER TABLE compliance_reports DROP CONSTRAINT IF EXISTS compliance_reports_report_type_check;
    ALTER TABLE compliance_reports ADD CONSTRAINT compliance_reports_report_type_check
      CHECK (report_type IN ('sox_change', 'access_audit', 'activity_summary', 'security_posture'));
  `);
};

exports.down = async (db) => {
  await db.query(`
    ALTER TABLE compliance_reports DROP CONSTRAINT IF EXISTS compliance_reports_report_type_check;
    ALTER TABLE compliance_reports ADD CONSTRAINT compliance_reports_report_type_check
      CHECK (report_type IN ('sox_change', 'access_audit', 'activity_summary'));
  `);
};
