Sha256: d45905b7e556b1e382d9ca4c9c701bc8e8967d56d9f9a2d857bd83ab26216c01

Contents?: true

Size: 436 Bytes

Versions: 7

Compression:

Stored size: 436 Bytes

Contents

# This migration comes from spree (originally 20091209202200)
class MakeStateEventsPolymorphic < ActiveRecord::Migration
  def up
    rename_column :state_events, :order_id, :stateful_id
    add_column :state_events, :stateful_type, :string
    execute "UPDATE state_events SET stateful_type = 'Order'"
  end

  def down
    rename_column :state_events, :stateful_id, :order_id
    remove_column :state_events, :stateful_type
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
spree_mercado_pago_payment_method-0.0.2 spec/dummy/db/migrate/20121121030153_make_state_events_polymorphic.spree.rb
spree_mercado_pago_payment_method-0.1.1 spec/dummy/db/migrate/20121121030153_make_state_events_polymorphic.spree.rb
spree_mercado_pago_payment_method-0.1.0 spec/dummy/db/migrate/20121121030153_make_state_events_polymorphic.spree.rb
datashift_spree-0.3.0 spec/sandbox/db/migrate/20121023154372_make_state_events_polymorphic.spree.rb
datashift_spree-0.2.1 spec/sandbox/db/migrate/20121015151165_make_state_events_polymorphic.spree.rb
datashift_spree-0.2.0 spec/sandbox/db/migrate/20120925192733_make_state_events_polymorphic.spree.rb
datashift_spree-0.1.0 spec/sandbox/db/migrate/20120918081464_make_state_events_polymorphic.spree.rb