mirror of
https://github.com/discourse/discourse.git
synced 2025-09-03 08:39:21 +08:00
FEATURE: Promote polymorphic bookmarks to default and migrate (#16729)
This commit migrates all bookmarks to be polymorphic (using the bookmarkable_id and bookmarkable_type) columns. It also deletes all the old code guarded behind the use_polymorphic_bookmarks setting and changes that setting to true for all sites and by default for the sake of plugins. No data is deleted in the migrations, the old post_id and for_topic columns for bookmarks will be dropped later on.
This commit is contained in:
parent
bf987af3ca
commit
fcc2e7ebbf
63 changed files with 582 additions and 1833 deletions
|
@ -624,12 +624,7 @@ class ImportScripts::Base
|
|||
else
|
||||
begin
|
||||
manager = BookmarkManager.new(user)
|
||||
|
||||
if SiteSetting.use_polymorphic_bookmarks
|
||||
bookmark = manager.create_for(bookmarkable_id: post.id, bookmarkable_type: "Post")
|
||||
else
|
||||
bookmark = manager.create(post_id: post.id)
|
||||
end
|
||||
bookmark = manager.create_for(bookmarkable_id: post.id, bookmarkable_type: "Post")
|
||||
|
||||
created += 1 if manager.errors.none?
|
||||
skipped += 1 if manager.errors.any?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue