Logo
Explore Help
Sign In
IntenseWebs/discourse
3
0
Fork 0
You've already forked discourse
mirror of https://github.com/discourse/discourse.git synced 2025-02-25 18:55:32 -06:00
Code Issues Packages Projects Releases Wiki Activity
Files
274db95fb2600a7ac143c14ce14893b806d76943
discourse/db/migrate/20191217035630_populate_topic_id_on_bookmarks.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
324 B
Ruby
Raw Normal View History

FEATURE: Improving bookmarks part 2 -- Topic Bookmarking (#8954) ### UI Changes If `SiteSetting.enable_bookmarks_with_reminders` is enabled: * Clicking "Bookmark" on a topic will create a new Bookmark record instead of a post + user action * Clicking "Clear Bookmarks" on a topic will delete all the new Bookmark records on a topic * The topic bookmark buttons control the post bookmark flags correctly and vice-versa Disabled selecting the "reminder type" for bookmarks in the UI because the backend functionality is not done yet (of sending users notifications etc.) ### Other Changes * Added delete bookmark route (but no UI yet) * Added a rake task to sync the old PostAction bookmarks to the new Bookmark table, which can be run as many times as we want for a site (it will not create duplicates).
2020-02-13 16:26:02 +10:00
# frozen_string_literal: true
class PopulateTopicIdOnBookmarks < ActiveRecord::Migration[6.0]
def up
Bookmark.where(topic_id: nil).includes(:post).find_each do |bookmark|
bookmark.update_column(:topic_id, bookmark.post.topic_id)
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 91ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API