Skip to content

Commit 4e7ad4e

Browse files
committed
MAGETWO-95595: Index names are ignored by declarative schema
1 parent e17662c commit 4e7ad4e

File tree

3 files changed

+8
-9
lines changed
  • dev/tests
  • lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Constraints

3 files changed

+8
-9
lines changed

dev/tests/api-functional/_files/Magento/TestModuleDefaultHydrator/etc/db_schema.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true"/>
1212
<column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="false" identity="false"/>
1313
<column xsi:type="varchar" name="value" nullable="true" length="255"/>
14-
<constraint xsi:type="primary" name="PRIMARY">
14+
<constraint xsi:type="primary" referenceId="PRIMARY">
1515
<column name="entity_id"/>
1616
</constraint>
17-
<constraint xsi:type="foreign" name="CSTR_EXTENSION_ATTR_ENTT_CSTR_ID_CSTR_ENTT_ENTT_ID"
17+
<constraint xsi:type="foreign" referenceId="CSTR_EXTENSION_ATTR_ENTT_CSTR_ID_CSTR_ENTT_ENTT_ID"
1818
table="testmodule_default_hydrator_extension_attribute_entity" column="customer_id"
1919
referenceTable="customer_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
2020
</table>

dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule1/fixture/valid_xml_revision_1.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,17 @@
225225
],
226226
],
227227
'constraint' => [
228-
'TEST_TABLE_SMALLINT_BIGINT' => [
228+
'TEST_TABLE_UNIQUE' => [
229229
'column' => [
230230
'smallint' => 'smallint',
231231
'bigint' => 'bigint',
232232
],
233233
'type' => 'unique',
234-
'referenceId' => 'TEST_TABLE_SMALLINT_BIGINT',
234+
'referenceId' => 'TEST_TABLE_UNIQUE',
235235
],
236-
'TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF' => [
236+
'TEST_TABLE_TINYINT_REFERENCE' => [
237237
'type' => 'foreign',
238-
'referenceId' => 'TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF',
238+
'referenceId' => 'TEST_TABLE_TINYINT_REFERENCE',
239239
'column' => 'tinyint',
240240
'table' => 'test_table',
241241
'referenceTable' => 'reference_table',
@@ -244,12 +244,12 @@
244244
],
245245
],
246246
'index' => [
247-
'TEST_TABLE_TINYINT_BIGINT' => [
247+
'TEST_TABLE_INDEX' => [
248248
'column' => [
249249
'tinyint' => 'tinyint',
250250
'bigint' => 'bigint',
251251
],
252-
'referenceId' => 'TEST_TABLE_TINYINT_BIGINT',
252+
'referenceId' => 'TEST_TABLE_INDEX',
253253
'indexType' => 'btree',
254254
],
255255
],

lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Constraints/ForeignKey.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public function __construct(ResourceConnection $resourceConnection)
4343
}
4444

4545
/**
46-
* @param Reference $foreignKey
4746
* @inheritdoc
4847
*/
4948
public function toDefinition(ElementInterface $foreignKey)

0 commit comments

Comments
 (0)