-- Simplify column notifications to only "on_enter" and remove old notification fields

-- First, remove the old project notification settings column (ignore error if doesn't exist)
SET sql_notes = 0;
ALTER TABLE projects DROP COLUMN project_notification_settings;
SET sql_notes = 1;

-- Update the column notifications table to remove notification_type (only keeping on_enter)
ALTER TABLE project_column_subscriptions DROP COLUMN notification_type;

-- Update the unique constraint to not include notification_type
ALTER TABLE project_column_subscriptions DROP INDEX unique_subscription;
ALTER TABLE project_column_subscriptions ADD UNIQUE KEY unique_subscription (project_id, user_id, column_name);

-- Add comment to document the simplified approach
ALTER TABLE project_column_subscriptions COMMENT = 'Simplified column-based notifications - users get notified when tasks enter their subscribed columns';