SET @moderator_notes_exists = (
    SELECT COUNT(*) FROM information_schema.COLUMNS
    WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'reports' AND COLUMN_NAME = 'moderator_notes'
);
SET @moderator_notes_sql = IF(
    @moderator_notes_exists = 0,
    'ALTER TABLE reports ADD COLUMN moderator_notes TEXT NULL AFTER notes',
    'SELECT 1'
);
PREPARE moderator_notes_stmt FROM @moderator_notes_sql;
EXECUTE moderator_notes_stmt;
DEALLOCATE PREPARE moderator_notes_stmt;
