Skip to content

Commit 3b217e7

Browse files
authored
ENGCOM-5956: Added unique key on eav_attribute_option_value table #24720
2 parents 328ebeb + 9d6892d commit 3b217e7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

app/code/Magento/Eav/etc/db_schema.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,10 @@
458458
<constraint xsi:type="foreign" referenceId="EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID_STORE_STORE_ID"
459459
table="eav_attribute_option_value" column="store_id" referenceTable="store"
460460
referenceColumn="store_id" onDelete="CASCADE"/>
461+
<constraint xsi:type="unique" referenceId="EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID_OPTION_ID">
462+
<column name="store_id"/>
463+
<column name="option_id"/>
464+
</constraint>
461465
<index referenceId="EAV_ATTRIBUTE_OPTION_VALUE_OPTION_ID" indexType="btree">
462466
<column name="option_id"/>
463467
</index>

app/code/Magento/Eav/etc/db_schema_whitelist.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@
287287
"constraint": {
288288
"PRIMARY": true,
289289
"EAV_ATTR_OPT_VAL_OPT_ID_EAV_ATTR_OPT_OPT_ID": true,
290-
"EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID_STORE_STORE_ID": true
290+
"EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID_STORE_STORE_ID": true,
291+
"EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID_OPTION_ID": true
291292
}
292293
},
293294
"eav_attribute_label": {

0 commit comments

Comments
 (0)