db->query(" CREATE TABLE IF NOT EXISTS advertising_landing_templates ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, cuid VARCHAR(64) NOT NULL UNIQUE, brand_id BIGINT(20) UNSIGNED NOT NULL, country_code VARCHAR(10) NOT NULL, template_type VARCHAR(50) NOT NULL DEFAULT 'banner', image_path VARCHAR(500) NOT NULL, mobile_image_path VARCHAR(500) NULL, desktop_image_path VARCHAR(500) NULL, is_active TINYINT(1) NOT NULL DEFAULT 1, created_by BIGINT(20) NOT NULL DEFAULT 1, created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, deleted_at TIMESTAMP NULL, PRIMARY KEY (id), INDEX idx_brand_country (brand_id, country_code), INDEX idx_template_type (template_type), INDEX idx_is_active (is_active), INDEX idx_created_by (created_by), INDEX idx_deleted_at (deleted_at), FOREIGN KEY (brand_id) REFERENCES advertising_brands(id) ON DELETE CASCADE, UNIQUE KEY unique_brand_country_type (brand_id, country_code, template_type) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci "); } public function down(): void { $this->db->query("DROP TABLE IF EXISTS advertising_landing_templates"); } }