Sha256: 804f9d37848bbd23fb1be01a236f938b6e4f5e642419e1d1b912f79e505acb68

Contents?: true

Size: 1.39 KB

Versions: 14

Compression:

Stored size: 1.39 KB

Contents

class CreateSpreeReturnAuthorizationReasons < ActiveRecord::Migration
  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
        if defined?(Spree::ReturnAuthorizationReason)
          Spree::ReturnAuthorizationReason.create!(name: 'Better price available')
          Spree::ReturnAuthorizationReason.create!(name: 'Missed estimated delivery date')
          Spree::ReturnAuthorizationReason.create!(name: 'Missing parts or accessories')
          Spree::ReturnAuthorizationReason.create!(name: 'Damaged/Defective')
          Spree::ReturnAuthorizationReason.create!(name: 'Different from what was ordered')
          Spree::ReturnAuthorizationReason.create!(name: 'Different from description')
          Spree::ReturnAuthorizationReason.create!(name: 'No longer needed/wanted')
          Spree::ReturnAuthorizationReason.create!(name: 'Accidental order')
          Spree::ReturnAuthorizationReason.create!(name: 'Unauthorized purchase')
        end
      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

14 entries across 14 versions & 1 rubygems

Version Path
solidus_core-1.0.7 db/migrate/20140713140455_create_spree_return_authorization_reasons.rb
solidus_core-1.0.6 db/migrate/20140713140455_create_spree_return_authorization_reasons.rb
solidus_core-1.0.5 db/migrate/20140713140455_create_spree_return_authorization_reasons.rb
solidus_core-1.0.4 db/migrate/20140713140455_create_spree_return_authorization_reasons.rb
solidus_core-1.0.3 db/migrate/20140713140455_create_spree_return_authorization_reasons.rb
solidus_core-1.1.0.pre1 db/migrate/20140713140455_create_spree_return_authorization_reasons.rb
solidus_core-1.1.0.beta1 db/migrate/20140713140455_create_spree_return_authorization_reasons.rb
solidus_core-1.0.2 db/migrate/20140713140455_create_spree_return_authorization_reasons.rb
solidus_core-1.0.1 db/migrate/20140713140455_create_spree_return_authorization_reasons.rb
solidus_core-1.0.0 db/migrate/20140713140455_create_spree_return_authorization_reasons.rb
solidus_core-1.0.0.rc2 db/migrate/20140713140455_create_spree_return_authorization_reasons.rb
solidus_core-1.0.0.rc1 db/migrate/20140713140455_create_spree_return_authorization_reasons.rb
solidus_core-1.0.0.pre3 db/migrate/20140713140455_create_spree_return_authorization_reasons.rb
solidus_core-1.0.0.pre2 db/migrate/20140713140455_create_spree_return_authorization_reasons.rb