mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Ensure unique notification level per tag user (#28638)
TagUser.rb is used to set user notification levels for a tag, we don't have a unique index on the notification level itself. This means that there might be some weird case where a user may have multiple of the same notification level on a tag. This PR adds a migration which de-duplicates this based on defaults, where we keep the earliest record in the event there is multiple notification level per-user-per-tag.
This commit is contained in:
@@ -259,6 +259,7 @@ end
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# idx_tag_users_ix1 (user_id,tag_id,notification_level) UNIQUE
|
||||
# idx_tag_users_ix2 (tag_id,user_id,notification_level) UNIQUE
|
||||
# index_tag_users_on_tag_id_and_user_id_and_notification_level (tag_id,user_id,notification_level)
|
||||
# index_tag_users_on_user_id_and_tag_id (user_id,tag_id) UNIQUE
|
||||
# index_tag_users_on_user_id_and_tag_id_and_notification_level (user_id,tag_id,notification_level)
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user