-- ============================================================================
-- Add fb_app_id to Shortlinks Table
-- ============================================================================
-- Migration: 003_add_fb_app_id_to_shortlinks.sql
-- Purpose: Add Facebook App ID field for per-shortlink customization
-- ============================================================================

-- Add fb_app_id column (optional per shortlink, fallback to default)
ALTER TABLE `shortlinks`
ADD COLUMN `fb_app_id` VARCHAR(50) DEFAULT NULL COMMENT 'Facebook App ID (optional, for Facebook Insights)' AFTER `og_type`;

-- Update existing rows to use default app ID (optional)
-- Uncomment if you want to set default for existing shortlinks:
-- UPDATE `shortlinks` SET `fb_app_id` = '115190258555800' WHERE `fb_app_id` IS NULL;

-- ============================================================================
-- Verification
-- ============================================================================
-- Run this to verify column added:
-- DESCRIBE shortlinks;
-- SELECT fb_app_id FROM shortlinks LIMIT 5;
