-- ============================================================
-- Migration: Remove RECURRENCE_RULE_ID and DEFAULT_DEADLINE
-- from TTM_TASK_TEMPLATE
--
-- Client no longer requires frequency (recurrence) or deadline
-- fields during task template creation. These columns are being
-- removed from both the UI and the database.
-- ============================================================

-- Drop the recurrence rule index first
ALTER TABLE TTM_TASK_TEMPLATE
  DROP INDEX IF EXISTS IDX_RECURRENCE_RULE;

-- Drop RECURRENCE_RULE_ID column
ALTER TABLE TTM_TASK_TEMPLATE
  DROP COLUMN IF EXISTS RECURRENCE_RULE_ID;

-- Drop DEFAULT_DEADLINE_DATE column (added by add_engagement_type_to_template.sql)
ALTER TABLE TTM_TASK_TEMPLATE
  DROP COLUMN IF EXISTS DEFAULT_DEADLINE_DATE;

-- Drop DEFAULT_DEADLINE_OFFSET_DAYS column (original column, if still exists)
ALTER TABLE TTM_TASK_TEMPLATE
  DROP COLUMN IF EXISTS DEFAULT_DEADLINE_OFFSET_DAYS;
