Skip to content

Commit

Permalink
fix: migration for permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe authored and moshloop committed Jan 3, 2025
1 parent 79f11e2 commit aea3534
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion views/036_permission.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
UPDATE
permissions
SET
subject = COALESCE(team_id, person_id, notification_id)
subject = COALESCE(team_id, person_id, notification_id),
subject_type = CASE
WHEN team_id IS NOT NULL THEN 'team'
WHEN person_id IS NOT NULL THEN 'person'
WHEN notification_id IS NOT NULL THEN 'notification'
ELSE 'group'
END
WHERE
subject IS NULL
OR subject = '';
Expand Down

0 comments on commit aea3534

Please sign in to comment.