-- Doğrulanmış alıcı rozeti için (satır yoksa ekle). MySQL 8+

SET @s = (
  SELECT COUNT(*) FROM information_schema.COLUMNS
  WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'product_reviews' AND COLUMN_NAME = 'is_verified_purchase'
);
SET @sql = IF(
  @s = 0,
  'ALTER TABLE product_reviews ADD COLUMN is_verified_purchase TINYINT(1) NOT NULL DEFAULT 0 AFTER is_approved',
  'SELECT 1'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
