Sha256: cc5967563bf3ed7e29a1442115637e85852c18a9dedc6ad7d09d83f7f59f8d68

Contents?: true

Size: 1.31 KB

Versions: 7

Compression:

Stored size: 1.31 KB

Contents

# This migration comes from spree (originally 20091008091614)
class MoveToConfigurableGateways < ActiveRecord::Migration
  def up
    drop_table :gateways
    drop_table :gateway_options
    drop_table :gateway_option_values
    drop_table :gateway_configurations

    create_table :gateways, :force => true do |t|
      t.string   :type, :name
      t.text     :description
      t.boolean  :active, :default => true
      t.string   :environment, :default => 'development'
      t.string   :server, :default => 'test'
      t.boolean  :test_mode, :default => true

      t.timestamps
    end
  end

  def down
    drop_table :gateways

    create_table :gateway_configurations, :force => true do |t|
      t.references :gateway

      t.timestamps
    end

    create_table :gateway_option_values, :force => true do |t|
      t.text     :value
      t.references :gateway_configuration
      t.references :gateway_option

      t.timestamps
    end

    create_table :gateway_options, :force => true do |t|
      t.string   :name
      t.text     :description
      t.boolean  :textarea, :default => false
      t.references :gateway

      t.timestamps
    end

    create_table :gateways, :force => true do |t|
      t.string   :clazz, :name
      t.text     :description
      t.boolean  :active

      t.timestamps
    end
  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/20121121030144_move_to_configurable_gateways.spree.rb
spree_mercado_pago_payment_method-0.1.1 spec/dummy/db/migrate/20121121030144_move_to_configurable_gateways.spree.rb
spree_mercado_pago_payment_method-0.1.0 spec/dummy/db/migrate/20121121030144_move_to_configurable_gateways.spree.rb
datashift_spree-0.3.0 spec/sandbox/db/migrate/20121023154363_move_to_configurable_gateways.spree.rb
datashift_spree-0.2.1 spec/sandbox/db/migrate/20121015151156_move_to_configurable_gateways.spree.rb
datashift_spree-0.2.0 spec/sandbox/db/migrate/20120925192724_move_to_configurable_gateways.spree.rb
datashift_spree-0.1.0 spec/sandbox/db/migrate/20120918081455_move_to_configurable_gateways.spree.rb