0820badcc3
This provides a way to set the level of involvement that a user has with a collection, and from which we determine the level of notifications to send. Users can be access-only, watching, or being notified about everything. If you're access-only, you won't get an notifications. If you're watching, you'll only get notifications for the items you're watching (which includes the items you've been assigned, have commented on, etc). If you're set to everything you'll get notifications about all activity in that collection. This change replaces our previous concept of subscriptions. Where previously you'd subscribe to a collection to get notifications in it, now you'll simply set the notification level on your access.
15 lines
450 B
Ruby
15 lines
450 B
Ruby
class DropSubscriptions < ActiveRecord::Migration[8.1]
|
|
def change
|
|
execute "
|
|
update accesses set involvement = 'access_only'
|
|
"
|
|
execute "
|
|
update accesses set involvement = 'watching'
|
|
from (select user_id, subscribable_id as bucket_id from subscriptions) as subscriptions
|
|
where subscriptions.user_id = accesses.user_id and subscriptions.bucket_id = accesses.bucket_id
|
|
"
|
|
|
|
drop_table :subscriptions
|
|
end
|
|
end
|