Sha256: 767f814af163f9c7f14559c4f1fc909f2f216361d7df1089f05f6e568bc49d6c

Contents?: true

Size: 355 Bytes

Versions: 9

Compression:

Stored size: 355 Bytes

Contents

class AddNotNullConstraintToSourcesPaymentType < SolidusSupport::Migration[4.2]
  def change
    reversible do |dir|
      dir.up do
        SolidusPaypalBraintree::Source.where(payment_type: nil).
          update_all(payment_type: 'CreditCard')
      end
    end
    change_column_null(:solidus_paypal_braintree_sources, :payment_type, false)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
solidus_paypal_braintree-1.2.0 db/migrate/20170508085402_add_not_null_constraint_to_sources_payment_type.rb
solidus_paypal_braintree-1.1.2 db/migrate/20170508085402_add_not_null_constraint_to_sources_payment_type.rb
solidus_paypal_braintree-1.1.1 db/migrate/20170508085402_add_not_null_constraint_to_sources_payment_type.rb
solidus_paypal_braintree-1.1.0 db/migrate/20170508085402_add_not_null_constraint_to_sources_payment_type.rb
solidus_paypal_braintree-1.0.0 db/migrate/20170508085402_add_not_null_constraint_to_sources_payment_type.rb
solidus_paypal_braintree-0.4.0 db/migrate/20170508085402_add_not_null_constraint_to_sources_payment_type.rb
solidus_paypal_braintree-0.3.0 db/migrate/20170508085402_add_not_null_constraint_to_sources_payment_type.rb
solidus_paypal_braintree-0.2.0 db/migrate/20170508085402_add_not_null_constraint_to_sources_payment_type.rb
solidus_paypal_braintree-0.1.0 db/migrate/20170508085402_add_not_null_constraint_to_sources_payment_type.rb