mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: allow moderators to globally pin topics
This commit is contained in:
12
db/migrate/20140407055830_add_pinned_globally_to_topics.rb
Normal file
12
db/migrate/20140407055830_add_pinned_globally_to_topics.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class AddPinnedGloballyToTopics < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :topics, :pinned_globally, :boolean, null: false, default: false
|
||||
execute "UPDATE topics set pinned_globally = 't' where category_id = (
|
||||
SELECT value::int FROM site_settings WHERE name = 'uncategorized_category_id') AND pinned_at IS NOT NULL
|
||||
"
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :topics, :pinned_globally
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user