diff --git a/db/migrate/20110911213207_counter_cache_on_post_comments.rb.rb b/db/migrate/20110911213207_counter_cache_on_post_comments.rb.rb index 3e6443fa9..65f6fef00 100644 --- a/db/migrate/20110911213207_counter_cache_on_post_comments.rb.rb +++ b/db/migrate/20110911213207_counter_cache_on_post_comments.rb.rb @@ -4,7 +4,7 @@ class CounterCacheOnPostComments < ActiveRecord::Migration add_column :posts, :comments_count, :integer, :default => 0 execute < 0 UPDATE posts - SET posts.comments_count = (SELECT COUNT(*) FROM comments WHERE comments.post_id = posts.id) + SET comments_count = (SELECT COUNT(*) FROM comments WHERE comments.post_id = posts.id) SQL end