class ChangeTxnTypeToInt < ActiveRecord::Migration
  def self.up
    if postgresql_version > 80000
      execute('ALTER TABLE "creditcard_txns" ALTER COLUMN "txn_type" TYPE integer USING to_number(creditcard_txns.txn_type,\'S9999999\')')
    else
      change_column :creditcard_txns, :txn_type, :integer
    end
  end

  def self.down
  end
end

class ChangeTxnTypeToInt < ActiveRecord::Migration
  def self.up
    change_column :creditcard_txns, :txn_type, :integer
  end

  def self.down
  end
end

Revert "Fixed migration failure for postgres > 8.0"
Revert "Fixed migration failure for postgres > 8.0"

This reverts commit 40bffa0909174b7e141bf717b138d74600096613.
