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