- 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
31 lines
1.0 KiB
SQL
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 $$;
|