-- Migration: Add measurement_integration_setting_id to analytics_data
-- Date: 2025-01-XX
-- Description: Adds measurement_integration_setting_id column to analytics_data table to support site-level data management

ALTER TABLE analytics_data
ADD COLUMN measurement_integration_setting_id VARCHAR(36) NULL COMMENT '計測統合設定ID（サイト単位の識別子）',
ADD INDEX idx_measurement_integration_setting (measurement_integration_setting_id),
ADD FOREIGN KEY (measurement_integration_setting_id) REFERENCES measurement_integration_settings(id) ON DELETE SET NULL;

