mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 04:46:27 +08:00
13 lines
366 B
Ruby
13 lines
366 B
Ruby
class AddQuoteCountToPosts < ActiveRecord::Migration
|
|
def up
|
|
add_column :posts, :quote_count, :integer, default: 0, null: false
|
|
execute "UPDATE posts SET quote_count = 1 WHERE quoteless = 'f'"
|
|
remove_column :posts, :quoteless
|
|
end
|
|
|
|
def down
|
|
remove_column :posts, :quote_count
|
|
add_column :posts, :quoteless, :boolean, default: false
|
|
end
|
|
end
|