Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quick fix to migrations order, subtle, related to #978 #1030

Merged
merged 1 commit into from
Nov 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
class AddCommentsCountToDrupalNode < ActiveRecord::Migration
def up
add_column :node, :comments_count, :integer, default: 0
add_column :node, :drupal_comments_count, :integer, default: 0
DrupalNode.reset_column_information
DrupalNode.all.each do |node|
DrupalNode.reset_counters(node.id, :comments)
DrupalNode.reset_counters(node.id, :drupal_comments)
end
end

def down
remove_column :node, :comments_count
remove_column :node, :drupal_comments_count
end
end
9 changes: 9 additions & 0 deletions db/migrate/20161129210111_change_comments.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class ChangeComments < ActiveRecord::Migration
def up
rename_column :node, :drupal_comments_count, :comments_count
end

def down
rename_column :node, :comments_count, :drupal_comments_count
end
end