Files
silo-server/migrations/135_webhook_sync_silo_profile_column.down.sql
T
Silo Server Migration f1e82f1eec Rename webhook sync actors to profile mappings
- Rename actor-oriented API, storage, and webhook fields to user/profile terminology
- Switch dev compose helpers to use docker-compose.yml
- Update frontend types and webhook sync settings for the new endpoints
2026-05-24 00:04:25 -04:00

31 lines
1.0 KiB
SQL

DO $$
BEGIN
IF EXISTS (
SELECT 1
FROM information_schema.columns
WHERE table_schema = 'public'
AND table_name = 'webhook_sync_actor_mappings'
AND column_name = 'silo_profile_id'
) AND NOT EXISTS (
SELECT 1
FROM information_schema.columns
WHERE table_schema = 'public'
AND table_name = 'webhook_sync_actor_mappings'
AND column_name = 'continuum_profile_id'
) THEN
ALTER TABLE public.webhook_sync_actor_mappings
RENAME COLUMN silo_profile_id TO continuum_profile_id;
ELSIF EXISTS (
SELECT 1
FROM information_schema.columns
WHERE table_schema = 'public'
AND table_name = 'webhook_sync_actor_mappings'
AND column_name = 'silo_profile_id'
) THEN
UPDATE public.webhook_sync_actor_mappings
SET continuum_profile_id = COALESCE(continuum_profile_id, silo_profile_id)
WHERE continuum_profile_id IS NULL
AND silo_profile_id IS NOT NULL;
END IF;
END $$;