-- Add social media links and website to events table for marketing kit
ALTER TABLE events ADD COLUMN IF NOT EXISTS social_links JSON DEFAULT '{}';
ALTER TABLE events ADD COLUMN IF NOT EXISTS website_url TEXT;
ALTER TABLE events ADD COLUMN IF NOT EXISTS contact_email TEXT;

-- Add social media links to organizations table as well for branding
ALTER TABLE organizations ADD COLUMN IF NOT EXISTS social_links JSON DEFAULT '{}';
ALTER TABLE organizations ADD COLUMN IF NOT EXISTS website_url TEXT;
ALTER TABLE organizations ADD COLUMN IF NOT EXISTS contact_email TEXT;

-- Update the marketing templates to include social handles
UPDATE marketing_templates 
SET template_data = jsonb_set(
  template_data::jsonb, 
  '{includeSocialHandles}', 
  'true'::jsonb
)
WHERE template_type = 'social_post';

-- Add some example social links structure as comments
-- Social links JSON structure:
-- {
--   "facebook": "https://facebook.com/yourpage",
--   "instagram": "https://instagram.com/yourhandle", 
--   "twitter": "https://twitter.com/yourhandle",
--   "linkedin": "https://linkedin.com/company/yourcompany",
--   "youtube": "https://youtube.com/channel/yourchannel",
--   "tiktok": "https://tiktok.com/@yourhandle",
--   "website": "https://yourwebsite.com"
-- }