-- Migration 030: Remove legacy task_reminders table
-- This migration safely removes the old task_reminders table after migrating to smart_task_reminders

-- First check if there's any important data in the old table that needs to be preserved
-- (This is a precautionary step - in practice, the smart reminder system should already be handling all reminders)

-- 1. Create a backup table (optional - for safety)
CREATE TABLE task_reminders_backup AS SELECT * FROM task_reminders WHERE created_at >= DATE_SUB(NOW(), INTERVAL 7 DAY);

-- 2. Drop the legacy task_reminders table
DROP TABLE IF EXISTS task_reminders;

-- 3. Also remove the legacy task_reminders migration from the migrations list if it exists
-- (This is handled manually by the developer, not in SQL)

-- Note: The smart_task_reminders table (created in migration 028) is now the primary table for all reminders
-- It provides enhanced functionality with reminder chains, escalation, and better organization support