mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 10:54:22 +08:00
41b43a2a25
This adds an option to "delete on owner reply" to bookmarks. If you select this option in the modal, then reply to the topic the bookmark is in, the bookmark will be deleted on reply. This PR also changes the checkboxes for these additional bookmark options to an Integer column in the DB with a combobox to select the option you want. The use cases are: * Sometimes I will bookmark the topics to read it later. In this case we definitely don’t need to keep the bookmark after I replied to it. * Sometimes I will read the topic in mobile and I will prefer to reply in PC later. Or I may have to do some research before reply. So I will bookmark it for reply later.
13 lines
380 B
Ruby
13 lines
380 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AddDeleteOptionToBookmarks < ActiveRecord::Migration[6.0]
|
|
def up
|
|
add_column :bookmarks, :auto_delete_preference, :integer, index: true, null: false, default: 0
|
|
DB.exec("UPDATE bookmarks SET auto_delete_preference = 1 WHERE delete_when_reminder_sent")
|
|
end
|
|
|
|
def down
|
|
remove_column :bookmarks, :auto_delete_preference
|
|
end
|
|
end
|