Commit 75570d3772af7f4333cef8c312902b9457ade4ac
1 parent
301c33ea
Exists in
master
and in
29 other branches
ActionItem908: zero the hits after adding the field
Showing
1 changed file
with
1 additions
and
0 deletions
Show diff stats
db/migrate/058_add_hits_to_articles.rb
@@ -2,6 +2,7 @@ class AddHitsToArticles < ActiveRecord::Migration | @@ -2,6 +2,7 @@ class AddHitsToArticles < ActiveRecord::Migration | ||
2 | def self.up | 2 | def self.up |
3 | add_column :articles, :hits, :integer, :default => 0 | 3 | add_column :articles, :hits, :integer, :default => 0 |
4 | add_column :article_versions, :hits, :integer, :default => 0 | 4 | add_column :article_versions, :hits, :integer, :default => 0 |
5 | + execute('update articles set hits = 0') | ||
5 | end | 6 | end |
6 | 7 | ||
7 | def self.down | 8 | def self.down |