Fix migration so it doesn't break things!
This commit is contained in:
parent
c0bd723e31
commit
a0be5a27d2
1 changed files with 1 additions and 0 deletions
|
@ -2,6 +2,7 @@ class AddLinksCounterCacheToCards < ActiveRecord::Migration
|
||||||
def up
|
def up
|
||||||
add_column :cards, :links_count, :integer, default: 0, null: false
|
add_column :cards, :links_count, :integer, default: 0, null: false
|
||||||
|
|
||||||
|
PaperTrail.whodunnit = 1
|
||||||
Card.reset_column_information
|
Card.reset_column_information
|
||||||
Card.find_each do |card|
|
Card.find_each do |card|
|
||||||
card.update_attribute(:links_count, card.links.count)
|
card.update_attribute(:links_count, card.links.count)
|
||||||
|
|
Loading…
Reference in a new issue