Sha256: fad0d66d66e6e125eaa8b3bca6a6cebda9de02dc6530e5f1b9c825b272f4790a

Contents?: true

Size: 814 Bytes

Versions: 36

Compression:

Stored size: 814 Bytes

Contents

class AddSpreeFieldsToCustomUserTable < ActiveRecord::Migration[4.2]
  def up
    if table_exists?(<%= table_name.inspect %>)
      add_column <%= table_name.inspect %>, :spree_api_key, :string, :limit => 48 unless column_exists?(<%= table_name.inspect %>, :spree_api_key)
      add_column <%= table_name.inspect %>, :ship_address_id, :integer unless column_exists?(<%= table_name.inspect %>, :ship_address_id)
      add_column <%= table_name.inspect %>, :bill_address_id, :integer unless column_exists?(<%= table_name.inspect %>, :bill_address_id)
      add_column <%= table_name.inspect %>, :deleted_at, :datetime unless column_exists?(<%= table_name.inspect %>, :deleted_at)
      add_index  <%= table_name.inspect %>, :deleted_at unless column_exists?(<%= table_name.inspect %>, :deleted_at)
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
solidus_core-4.4.2 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.4.1 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.4.0 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.3.4 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.2.4 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.1.5 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.3.3 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.3.2 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.1.4 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.3.1 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.3.0 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.2.3 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.1.3 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.0.4 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-3.4.6 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.0.3 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.1.2 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.2.2 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-3.4.5 lib/generators/spree/custom_user/templates/migration.rb.tt
solidus_core-4.2.1 lib/generators/spree/custom_user/templates/migration.rb.tt