2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 00:06:56 -04:00
|
|
|
class AddQuoteCountToPosts < ActiveRecord::Migration[4.2]
|
2013-02-05 14:16:51 -05:00
|
|
|
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
|
2013-02-25 11:42:20 -05:00
|
|
|
end
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|