-- ROAS all time dla historii kampanii Facebook Ads

SET @sql = IF(
  EXISTS (
    SELECT 1
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_SCHEMA = DATABASE()
      AND TABLE_NAME = 'facebook_campaigns_history'
      AND COLUMN_NAME = 'roas_all_time'
  ),
  'DO 1',
  'ALTER TABLE `facebook_campaigns_history` ADD COLUMN `roas_all_time` DECIMAL(20,6) NOT NULL DEFAULT 0.000000 AFTER `roas`'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
