Skip to content

Commit 2f46d37

Browse files
committed
Fix projectId filter migrations
1 parent e0a8288 commit 2f46d37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/2025-09-03_project-webhooks.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ CREATE INDEX notification_events_scope_user_and_project ON notification_events(s
7474
-- Migrate existing filters to the new column, and also remove
7575
-- the projectId from the JSONB filter.
7676
UPDATE notification_subscriptions
77-
SET scope_project_id = (filter->>'projectId')::UUID,
77+
SET scope_project_id = regexp_replace(filter->>'projectId', '^P-', '')::UUID,
7878
filter = filter - 'projectId'
7979
WHERE filter ? 'projectId';
8080

8181
UPDATE notification_events
82-
SET project_id = (data->>'projectId')::UUID
82+
SET project_id = regexp_replace(data->>'projectId', '^P-', '')::UUID
8383
WHERE data ? 'projectId';
8484

8585
-- Rework the trigger to use the new topic groups.

0 commit comments

Comments
 (0)