mirror of
https://github.com/discourse/discourse.git
synced 2024-11-21 16:38:15 -06:00
DEV: Delete old enable_bookmarks_with_reminders setting (#25982)
This setting has not been used for a long time, get rid of it and also update the historical migration to not rely on the SiteSetting model.
This commit is contained in:
parent
1a76c4e099
commit
fef52c2ab7
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user