fix: Postgresql migrations for eventSubscriptionOffset. (#18980)

This commit is contained in:
Siddhant 2024-12-10 09:49:39 +05:30 committed by GitHub
parent c3455aae91
commit 4985496051
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1290,17 +1290,20 @@ SET
)
)
)
)
)
WHERE
json -> 'chartDetails' -> 'metrics' is null;
-- Rename 'offset' to 'currentOffset' and add 'startingOffset'
-- Rename and remove 'offset' to 'currentOffset' and add 'startingOffset'
UPDATE change_event_consumers
SET json = jsonb_set(
jsonb_set(json, '{currentOffset}', json -> 'offset'),
'{startingOffset}', json -> 'offset'
)
jsonb_set(
json - 'offset',
'{currentOffset}', json -> 'offset'
),
'{startingOffset}', json -> 'offset'
)
WHERE json -> 'offset' IS NOT NULL
AND jsonSchema = 'eventSubscriptionOffset';