Sha256: 117d566b55c3e0ec1952ee937bef8faf4c2d3940220a27b76865eb1c84c346c2

Contents?: true

Size: 1.23 KB

Versions: 19

Compression:

Stored size: 1.23 KB

Contents

class CreateShoppePayments < ActiveRecord::Migration
  def up
    create_table :shoppe_payments do |t|
      t.integer :order_id
      t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0
      t.string :reference, :method
      t.boolean :confirmed, :default => true
      t.boolean :refundable, :default => false
      t.decimal :amount_refunded, :precision => 8, :scale => 2, :default => 0.0
      t.integer :parent_payment_id
      t.boolean :exported, :default => false
      t.timestamps
    end
    remove_column :shoppe_orders, :paid_at
    remove_column :shoppe_orders, :payment_reference
    remove_column :shoppe_orders, :payment_method
    
    add_column :shoppe_orders, :amount_paid, :decimal, :precision => 8, :scale => 2, :default => 0.0
    add_column :shoppe_orders, :exported, :boolean, :default => false
    add_column :shoppe_orders, :invoice_number, :string
  end
  
  def down
    drop_table :shoppe_payments
    add_column :shoppe_orders, :paid_at, :datetime
    add_column :shoppe_orders, :payment_reference, :string
    add_column :shoppe_orders, :payment_method, :string
    remove_column :shoppe_orders, :amount_paid
    remove_column :shoppe_orders, :exported
    remove_column :shoppe_orders, :invoice_number
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
shoppe-1.1.2 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-1.1.1 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-1.1.0 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-1.0.9 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-1.0.8 db/migrate/20131024204815_create_shoppe_payments.rb
kylekthompson-shoppe-1.0.7 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-1.0.7 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-1.0.6 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/shoppe-1.0.5/db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-1.0.5 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-1.0.3 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-1.0.2 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-1.0.1 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-1.0.0 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-0.0.21 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-0.0.20 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-0.0.19 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-0.0.18 db/migrate/20131024204815_create_shoppe_payments.rb
shoppe-0.0.17 db/migrate/20131024204815_create_shoppe_payments.rb