Sha256: e0d464ed2a7e671f88103a4df5c2d7a461bbc773a9252ac6bb6e898bc914ba3d

Contents?: true

Size: 450 Bytes

Versions: 9

Compression:

Stored size: 450 Bytes

Contents

# This migration comes from spree (originally 20161014145148)
class AddCreatedAtToVariant < ActiveRecord::Migration[5.0]
  def change
    add_column :spree_variants, :created_at, :datetime
    Spree::Variant.reset_column_information
    Spree::Variant.unscoped.where.not(updated_at: nil).update_all('created_at = updated_at')
    Spree::Variant.unscoped.where(updated_at: nil).update_all(created_at: Time.current, updated_at: Time.current)
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
spree_purchase_order-3.7.0 spec/dummy/db/migrate/20191113195938_add_created_at_to_variant.spree.rb
spree_billing_sisow-0.9.2 spec/dummy/db/migrate/20190729091879_add_created_at_to_variant.spree.rb
spree_billing_sisow-0.9.1 spec/dummy/db/migrate/20190729091879_add_created_at_to_variant.spree.rb
spree_purchase_order-3.6.0 spec/dummy/db/migrate/20180516182067_add_created_at_to_variant.spree.rb
spree_purchase_order-3.5.0 spec/dummy/db/migrate/20180516182067_add_created_at_to_variant.spree.rb
spree_purchase_order-3.5.0.rc1 spec/dummy/db/migrate/20180516182067_add_created_at_to_variant.spree.rb
spree_purchase_order-3.4.0 spec/dummy/db/migrate/20180516182067_add_created_at_to_variant.spree.rb
spree_purchase_order-3.3.0 spec/dummy/db/migrate/20180516182067_add_created_at_to_variant.spree.rb
spree_purchase_order-3.2.0 spec/dummy/db/migrate/20180516182067_add_created_at_to_variant.spree.rb