Sha256: 1fb586f42d9005f4853b55fae6b733be2f149ef15bc6414ebadc7c7d7792eb93
Contents?: true
Size: 1.01 KB
Versions: 3
Compression:
Stored size: 1.01 KB
Contents
class CreateSpreeLegacyReturnAuthorizations < ActiveRecord::Migration def up # If this is a migrated database that had legacy returns in it then the table will already exist. # But if this is a dev box, etc that's just including this extension then we need to create the table. if !table_exists?(:spree_legacy_return_authorizations) create_table :spree_legacy_return_authorizations do |t| t.string "number" t.string "state" t.decimal "amount", precision: 10, scale: 2, default: 0.0, null: false t.integer "order_id" t.text "reason" t.datetime "created_at" t.datetime "updated_at" t.integer "stock_location_id" end add_column :spree_inventory_units, :legacy_return_authorization_id, :integer add_index :spree_inventory_units, :legacy_return_authorization_id end end def down drop_table :spree_legacy_return_authorizations remove_column :spree_inventory_units, :legacy_return_authorization_id end end
Version data entries
3 entries across 3 versions & 1 rubygems