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.ymlindex 14298821e86..31a17414223 100644--- a/config/site_settings.yml+++ b/config/site_settings.yml@@ -338,10 +338,6 @@ basic:default: "14"allow_any: falserefresh: true- enable_bookmarks_with_reminders:- client: true- default: true- hidden: truepush_notifications_prompt:default: trueclient: truediff --git a/db/migrate/20200409033412_create_bookmarks_from_post_action_bookmarks.rb b/db/migrate/20200409033412_create_bookmarks_from_post_action_bookmarks.rbindex 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+ endbookmarks_to_create = []loop dodiff --git a/db/migrate/20240301033753_delete_old_bookmark_reminder_setting.rb b/db/migrate/20240301033753_delete_old_bookmark_reminder_setting.rbnew file mode 100644index 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