  class AddFirstSubscribedAtToUsers < ActiveRecord::Migration
    
    def self.up
      execute("ALTER TABLE users ADD COLUMN first_subscribed_at TIMESTAMP WITHOUT TIME ZONE")
      execute("UPDATE users SET first_subscribed_at = NOW() WHERE recurly_subscription_id IS NOT NULL")
    end
    
    def self.down
      execute("ALTER TABLE users DROP COLUMN first_subscribed_at")
    end
  end
