Sha256: 9e786a724a2083f3ca8ade4cbf7fdc7cb4e1379713b4f3746643a8b19e511746

Contents?: true

Size: 423 Bytes

Versions: 2

Compression:

Stored size: 423 Bytes

Contents

# This migration comes from spree (originally 20151219020209)
class AddStockItemUniqueIndex < ActiveRecord::Migration
  def change
    # Add a database-level uniqueness constraint for databases that support it
    # (postgres & sqlite)
    if connection.adapter_name =~ /postgres|sqlite/i
      add_index 'spree_stock_items', ['variant_id', 'stock_location_id'], where: 'deleted_at is null', unique: true
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_order_reporting-0.0.2 spec/dummy/db/migrate/20160707103630_add_stock_item_unique_index.spree.rb
spree_order_reporting-0.0.1 spec/dummy/db/migrate/20160706112582_add_stock_item_unique_index.spree.rb