-- Migration: Add customer-related event types to tmodule_sync_log
-- Version: v1.3.52
-- Description: Add 'hourly_rate_updated' and 'time_card_toggled' event types

-- Drop existing constraint
ALTER TABLE tmodule_sync_log DROP CONSTRAINT IF EXISTS check_event_type;

-- Add new constraint with additional event types
ALTER TABLE tmodule_sync_log ADD CONSTRAINT check_event_type CHECK (event_type IN (
    'sync_started', 'sync_completed', 'sync_failed',
    'approval', 'rejection', 'bulk_approval',
    'order_created', 'order_updated', 'order_cancelled',
    'export_started', 'export_completed', 'export_failed',
    'module_installed', 'module_uninstalled',
    'hourly_rate_updated', 'time_card_toggled'
));
