discourse/db/migrate/20120614202024_add_quote_count_to_posts.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
402 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class AddQuoteCountToPosts < ActiveRecord::Migration[4.2]
2013-02-06 03:16:51 +08: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-26 00:42:20 +08:00
end
2013-02-06 03:16:51 +08:00
end