IF EXISTS (
    SELECT 1 
    FROM sys.indexes 
    WHERE name = 'ticket_messages_file_uniq_idx' 
      AND object_id = OBJECT_ID('ticket_messages')
)
DROP INDEX ticket_messages_file_uniq_idx ON ticket_messages;