mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Explain why a index forbids more than a location
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user