Skip to content

A platform for community discussion. Free, open, simple.

DEV: Delete old enable_bookmarks_with_reminders setting (#25982)

Martin Brennanfef52c2ab7e9
diff --git a/config/site_settings.yml b/config/site_settings.yml
index 14298821e86..31a17414223 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -338,10 +338,6 @@ basic:
default: "14"
allow_any: false
refresh: true
- enable_bookmarks_with_reminders:
- client: true
- default: true
- hidden: true
push_notifications_prompt:
default: true
client: true
diff --git a/db/migrate/20200409033412_create_bookmarks_from_post_action_bookmarks.rb b/db/migrate/20200409033412_create_bookmarks_from_post_action_bookmarks.rb
index bae9cb2e6e2..59771b2bd33 100644
--- a/db/migrate/20200409033412_create_bookmarks_from_post_action_bookmarks.rb
+++ b/db/migrate/20200409033412_create_bookmarks_from_post_action_bookmarks.rb
@@ -2,7 +2,20 @@
class CreateBookmarksFromPostActionBookmarks < ActiveRecord::Migration[6.0]
def up
- SiteSetting.enable_bookmarks_with_reminders = true
+ bookmarks_with_reminders_val =
+ DB.query_single(
+ "SELECT value FROM site_settings WHERE name = 'enable_bookmarks_with_reminders'",
+ )
+
+ if bookmarks_with_reminders_val.present?
+ DB.exec("UPDATE site_settings SET value = 't' WHERE name = 'enable_bookmarks_with_reminders'")
+ else
+ # data_type 5 is boolean
+ DB.exec(<<~SQL)
+ INSERT INTO site_settings(name, value, data_type, created_at, updated_at)
+ VALUES('enable_bookmarks_with_reminders', 't', 5, NOW(), NOW())
+ SQL
+ end
bookmarks_to_create = []
loop do
diff --git a/db/migrate/20240301033753_delete_old_bookmark_reminder_setting.rb b/db/migrate/20240301033753_delete_old_bookmark_reminder_setting.rb
new file mode 100644
index 00000000000..017f5b42f16
--- /dev/null
+++ b/db/migrate/20240301033753_delete_old_bookmark_reminder_setting.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class DeleteOldBookmarkReminderSetting < ActiveRecord::Migration[7.0]
+ def up
+ DB.exec("DELETE FROM site_settings WHERE name = 'enable_bookmarks_with_reminders'")
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
+ end
+end