Sha256: cb56d0415606e3c4523a3d075ae6fe689e85ddc02e9310c3b49a1f83907b6c15

Contents?: true

Size: 472 Bytes

Versions: 56

Compression:

Stored size: 472 Bytes

Contents

class StiForTransactions < ActiveRecord::Migration
  def self.up
    rename_table "creditcard_txns", "transactions"
    add_column "transactions", "type", :string
    remove_column "transactions", "creditcard_id"
    Transaction.update_all(:type => 'CreditcardTxn') if defined? Transaction
  end

  def self.down
    rename_table "transactions", "creditcard_txns"
    remove_column "transactions", "type"
    add_column "transactions", "creditcard_id", :integer
  end
end

Version data entries

56 entries across 44 versions & 9 rubygems

Version Path
spree_core-0.70.7 db/migrate/20100223170312_sti_for_transactions.rb
spree_core-0.70.6 db/migrate/20100223170312_sti_for_transactions.rb
apispree_core-0.0.0 db/migrate/20100223170312_sti_for_transactions.rb
My-Commerce_core-1.1.0 db/migrate/20100223170312_sti_for_transactions.rb
My-Commerce_core-1.0.0 db/migrate/20100223170312_sti_for_transactions.rb
MyCommerceapi-1.0.0 auth/spec/test_app/db/migrate/20100223170312_sti_for_transactions.rb
MyCommerceapi-1.0.0 sandbox/db/migrate/20100223170312_sti_for_transactions.rb
MyCommerceapi-1.0.0 core/spec/test_app/db/migrate/20100223170312_sti_for_transactions.rb
MyCommerceapi-1.0.0 api/spec/test_app/db/migrate/20100223170312_sti_for_transactions.rb
MyCommerceapi-1.0.0 dash/spec/test_app/db/migrate/20100223170312_sti_for_transactions.rb
MyCommerceapi-1.0.0 promo/spec/test_app/db/migrate/20100223170312_sti_for_transactions.rb
MyCommerceapi-1.0.0 core/db/migrate/20100223170312_sti_for_transactions.rb
MyCommerce-0.0.3 auth/spec/test_app/db/migrate/20100223170312_sti_for_transactions.rb
MyCommerce-0.0.3 core/spec/test_app/db/migrate/20100223170312_sti_for_transactions.rb
MyCommerce-0.0.3 api/spec/test_app/db/migrate/20100223170312_sti_for_transactions.rb
MyCommerce-0.0.3 sandbox/db/migrate/20100223170312_sti_for_transactions.rb
MyCommerce-0.0.3 promo/spec/test_app/db/migrate/20100223170312_sti_for_transactions.rb
MyCommerce-0.0.3 dash/spec/test_app/db/migrate/20100223170312_sti_for_transactions.rb
MyCommerce-0.0.3 core/db/migrate/20100223170312_sti_for_transactions.rb
rfcommerce_sandbox-0.0.3 db/migrate/20100223170312_sti_for_transactions.rb