Sha256: ee426d91078c957754c75a84845255cecbd273514ad1465d22136f5a72b81fbb

Contents?: true

Size: 1.43 KB

Versions: 2

Compression:

Stored size: 1.43 KB

Contents

# This migration comes from spree (originally 20140713140455)
class CreateSpreeReturnAuthorizationReasons < ActiveRecord::Migration
  class ReturnAuthorizationReason < ActiveRecord::Base
    self.table_name = 'spree_return_authorization_reasons'
  end

  def change
    create_table :spree_return_authorization_reasons do |t|
      t.string :name
      t.boolean :active, default: true
      t.boolean :mutable, default: true

      t.timestamps null: true
    end

    reversible do |direction|
      direction.up do
        ReturnAuthorizationReason.create!(name: 'Better price available')
        ReturnAuthorizationReason.create!(name: 'Missed estimated delivery date')
        ReturnAuthorizationReason.create!(name: 'Missing parts or accessories')
        ReturnAuthorizationReason.create!(name: 'Damaged/Defective')
        ReturnAuthorizationReason.create!(name: 'Different from what was ordered')
        ReturnAuthorizationReason.create!(name: 'Different from description')
        ReturnAuthorizationReason.create!(name: 'No longer needed/wanted')
        ReturnAuthorizationReason.create!(name: 'Accidental order')
        ReturnAuthorizationReason.create!(name: 'Unauthorized purchase')
      end
    end

    add_column :spree_return_authorizations, :return_authorization_reason_id, :integer
    add_index :spree_return_authorizations, :return_authorization_reason_id, name: 'index_return_authorizations_on_return_authorization_reason_id'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_order_reporting-0.0.2 spec/dummy/db/migrate/20160707103508_create_spree_return_authorization_reasons.spree.rb
spree_order_reporting-0.0.1 spec/dummy/db/migrate/20160706112460_create_spree_return_authorization_reasons.spree.rb