From 2b8d41a7528dfe2c8705a3da0a0b6b92e0264fef Mon Sep 17 00:00:00 2001 From: Kevin McConnell Date: Thu, 27 Feb 2025 10:39:44 +0000 Subject: [PATCH] Start with subscriptions on for everyone To prevent people missing a notification they care about when we ship the subscriptions feature, we'll start out with everything toggled on (which matches the previous behaviour). People can then opt out as they like. --- db/migrate/20250224152047_create_subscriptions.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db/migrate/20250224152047_create_subscriptions.rb b/db/migrate/20250224152047_create_subscriptions.rb index 860f1d4f1..e234e0a8b 100644 --- a/db/migrate/20250224152047_create_subscriptions.rb +++ b/db/migrate/20250224152047_create_subscriptions.rb @@ -8,5 +8,11 @@ class CreateSubscriptions < ActiveRecord::Migration[8.1] t.index [ :subscribable_type, :subscribable_id, :user_id ], unique: true end + + # Subscribe everyone to their current buckets to start with + execute " + insert into subscriptions (subscribable_type, subscribable_id, user_id, created_at, updated_at) + select 'Bucket', bucket_id, user_id, current_timestamp, current_timestamp from accesses; + " end end