-- Fix task_reminders table to use correct column name
-- Change slack_user_id to slack_member_id to match users table

-- Rename the column
ALTER TABLE task_reminders 
CHANGE COLUMN slack_user_id slack_member_id VARCHAR(50) NOT NULL;

-- Update the index to use the correct column name
ALTER TABLE task_reminders 
DROP INDEX IF EXISTS idx_reminders_slack_time;

ALTER TABLE task_reminders 
ADD INDEX idx_reminders_slack_time (slack_member_id, reminder_time);