suna/backend/supabase/migrations/20250811133931_agent_profil...

15 lines
509 B
MySQL
Raw Normal View History

2025-08-11 22:00:57 +08:00
BEGIN;
ALTER TABLE agents ADD COLUMN IF NOT EXISTS profile_image_url TEXT;
ALTER TABLE agent_templates ADD COLUMN IF NOT EXISTS profile_image_url TEXT;
UPDATE agents
SET profile_image_url = COALESCE(profile_image_url, (metadata->>'profile_image_url'))
WHERE profile_image_url IS NULL AND metadata ? 'profile_image_url';
UPDATE agent_templates
SET profile_image_url = COALESCE(profile_image_url, (metadata->>'profile_image_url'))
WHERE profile_image_url IS NULL AND metadata ? 'profile_image_url';
COMMIT;