discourse/db/migrate/20120614202024_add_quote_count_to_posts.rb

13 lines
368 B
Ruby
Raw Normal View History

2013-02-05 14:16:51 -05:00
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