Permalink
Browse files

Fix playcounts

  • Loading branch information...
holman committed Nov 5, 2011
1 parent 8f6d792 commit 254c8da9c0c734a70f22ee4d03e8a5bcc8d64cdb
Showing with 9 additions and 0 deletions.
  1. +9 −0 db/migrate/04_update_playcounts.rb
@@ -0,0 +1,9 @@
class UpdatePlaycounts < ActiveRecord::Migration
def self.up
Play::History.connection.execute("UPDATE songs SET playcount = (SELECT count(song_id) FROM histories WHERE song_id = songs.id)")
end
def self.down
# no-op
end
end

0 comments on commit 254c8da

Please sign in to comment.