-- Migracja: typ kampanii Google Ads
-- Data: 2026-02-17
-- Opis: dodaje pole z dokladnym typem kampanii (SEARCH, DISPLAY, PERFORMANCE_MAX, itp.)

SET @sql = IF(
  EXISTS (
    SELECT 1
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_SCHEMA = DATABASE()
      AND TABLE_NAME = 'campaigns'
      AND COLUMN_NAME = 'advertising_channel_type'
  ),
  'DO 1',
  'ALTER TABLE `campaigns` ADD COLUMN `advertising_channel_type` VARCHAR(40) NULL DEFAULT NULL AFTER `campaign_name`'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
