Explain why a index forbids more than a location

This commit is contained in:
Pau Perez
2019-01-09 18:56:40 +01:00
parent 10a678bdfe
commit 817bf4caa1

View File

@@ -1,3 +1,6 @@
# Since OFN has only a single default StockLocation, variants in OFN can only
# have a stock item. By adding this unique index we constraint that at DB level
# ensuring data integrity.
class AddUniquenessOfVariantIdToSpreeStockItems < ActiveRecord::Migration
def change
add_index :spree_stock_items, :variant_id, unique: true