Skip to content

Commit 43f9417

Browse files
committed
MAGETWO-95595: Index names are ignored by declarative schema
1 parent 0afc6c6 commit 43f9417

File tree

17 files changed

+52
-52
lines changed

17 files changed

+52
-52
lines changed

dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule1/etc/db_schema.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<column xsi:type="bigint" name="bigint_default_nullable" padding="2" nullable="true" default="1"
2222
unsigned="true"/>
2323
<column xsi:type="bigint" name="bigint_not_default_not_nullable" padding="2" nullable="false" unsigned="true"/>
24-
<constraint xsi:type="primary" name="tinyint_primary">
24+
<constraint xsi:type="primary" referenceId="tinyint_primary">
2525
<column name="tinyint_ref"/>
2626
</constraint>
2727
</table>
@@ -30,7 +30,7 @@
3030
nullable="true"/>
3131
<column xsi:type="smallint" name="int_disabled_auto_increment" default="0" identity="false" padding="12"
3232
unsigned="true" nullable="true"/>
33-
<constraint xsi:type="unique" name="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
33+
<constraint xsi:type="unique" referenceId="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
3434
<column name="int_auto_increment_with_nullable"/>
3535
</constraint>
3636
</table>
@@ -53,15 +53,15 @@
5353
<column xsi:type="boolean" name="boolean"/>
5454
<column xsi:type="varbinary" name="varbinary_rename" default="10101" disabled="true"/>
5555
<!--Constraints-->
56-
<constraint xsi:type="unique" name="TEST_TABLE_SMALLINT_BIGINT">
56+
<constraint xsi:type="unique" referenceId="TEST_TABLE_SMALLINT_BIGINT">
5757
<column name="smallint"/>
5858
<column name="bigint"/>
5959
</constraint>
60-
<constraint xsi:type="foreign" name="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
60+
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
6161
column="tinyint" table="test_table"
6262
referenceTable="reference_table" referenceColumn="tinyint_ref" onDelete="NO ACTION"/>
6363
<!--Indexes-->
64-
<index name="TEST_TABLE_TINYINT_BIGINT" indexType="btree">
64+
<index referenceId="TEST_TABLE_TINYINT_BIGINT" indexType="btree">
6565
<column name="tinyint"/>
6666
<column name="bigint"/>
6767
</index>

dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule1/revisions/base_update/db_schema.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
1010
<table name="reference_table" resource="default" comment="Reference table">
1111
<column xsi:type="smallint" name="smallint_ref" padding="6" nullable="false" unsigned="false" identity="true" comment="Smallint"/>
12-
<constraint xsi:type="primary" name="tinyint_primary">
12+
<constraint xsi:type="primary" referenceId="tinyint_primary">
1313
<column name="smallint_ref"/>
1414
</constraint>
1515
</table>
@@ -22,14 +22,14 @@
2222
<column xsi:type="mediumtext" name="mediumtext" comment="Mediumtext"/>
2323
<column xsi:type="varchar" name="varchar" length="254" nullable="true" comment="Varchar"/>
2424
<column xsi:type="boolean" name="boolean" comment="Boolean"/>
25-
<constraint xsi:type="unique" name="TEST_TABLE_SMALLINT_BIGINT">
25+
<constraint xsi:type="unique" referenceId="TEST_TABLE_SMALLINT_BIGINT">
2626
<column name="smallint"/>
2727
<column name="bigint"/>
2828
</constraint>
29-
<constraint xsi:type="foreign" name="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
29+
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
3030
column="smallint" table="test_table"
3131
referenceTable="reference_table" referenceColumn="smallint_ref" onDelete="CASCADE"/>
32-
<index name="TEST_TABLE_BIGINT" indexType="btree">
32+
<index referenceId="TEST_TABLE_BIGINT" indexType="btree">
3333
<column name="bigint"/>
3434
</index>
3535
</table>

dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule1/revisions/before_rollback/db_schema.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<table name="store_owner" comment="Store owner information" engine="innodb" resource="default">
2121
<column name="owner_id" xsi:type="smallint" nullable="false" unsigned="false" identity="true" />
2222
<column name="store_owner_name" onCreate="migrateDataFrom(label)" xsi:type="varchar" length="255" comment="Store Owner Name" />
23-
<constraint xsi:type="primary" name="PRIMARY">
23+
<constraint xsi:type="primary" referenceId="PRIMARY">
2424
<column name="owner_id" />
2525
</constraint>
2626
</table>

dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule1/revisions/column_modifications/db_schema.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
<column xsi:type="bigint" name="bigint_default_nullable" padding="2" nullable="true" default="123"
2222
unsigned="true"/>
2323
<column xsi:type="bigint" name="bigint_not_default_not_nullable" nullable="false" unsigned="false"/>
24-
<constraint xsi:type="primary" name="tinyint_primary">
24+
<constraint xsi:type="primary" referenceId="tinyint_primary">
2525
<column name="tinyint_ref"/>
2626
</constraint>
2727
</table>
2828
<table name="auto_increment_test" resource="default">
2929
<column xsi:type="int" name="int_auto_increment_with_nullable" padding="15" unsigned="true" nullable="true"/>
3030
<column xsi:type="smallint" name="int_disabled_auto_increment" default="0" identity="false" padding="12"
3131
unsigned="true" nullable="true"/>
32-
<constraint xsi:type="unique" name="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
32+
<constraint xsi:type="unique" referenceId="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
3333
<column name="int_auto_increment_with_nullable"/>
3434
</constraint>
3535
</table>
@@ -52,15 +52,15 @@
5252
<column xsi:type="boolean" name="boolean" default="true"/>
5353
<column xsi:type="varbinary" name="varbinary_rename" default="10101" disabled="true"/>
5454
<!--Constraints-->
55-
<constraint xsi:type="unique" name="TEST_TABLE_SMALLINT_BIGINT">
55+
<constraint xsi:type="unique" referenceId="TEST_TABLE_SMALLINT_BIGINT">
5656
<column name="smallint"/>
5757
<column name="bigint"/>
5858
</constraint>
59-
<constraint xsi:type="foreign" name="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
59+
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
6060
column="tinyint" table="test_table"
6161
referenceTable="reference_table" referenceColumn="tinyint_ref" onDelete="NO ACTION"/>
6262
<!--Indexes-->
63-
<index name="TEST_TABLE_TINYINT_BIGINT" indexType="btree">
63+
<index referenceId="TEST_TABLE_TINYINT_BIGINT" indexType="btree">
6464
<column name="tinyint"/>
6565
<column name="bigint"/>
6666
</index>

dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule1/revisions/column_removals/db_schema.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
<column xsi:type="bigint" name="bigint_default_nullable" padding="2" nullable="true" default="1"
2121
unsigned="true"/>
2222
<column xsi:type="bigint" name="bigint_not_default_not_nullable" padding="2" nullable="false" unsigned="true"/>
23-
<constraint xsi:type="primary" name="tinyint_primary">
23+
<constraint xsi:type="primary" referenceId="tinyint_primary">
2424
<column name="tinyint_ref"/>
2525
</constraint>
2626
</table>
2727
<table name="auto_increment_test" resource="default">
2828
<column xsi:type="int" name="int_auto_increment_with_nullable" identity="true" padding="12" unsigned="true"
2929
nullable="true"/>
30-
<constraint xsi:type="unique" name="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
30+
<constraint xsi:type="unique" referenceId="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
3131
<column name="int_auto_increment_with_nullable"/>
3232
</constraint>
3333
</table>
@@ -50,15 +50,15 @@
5050
<column xsi:type="boolean" name="boolean"/>
5151
<column xsi:type="varbinary" name="varbinary_rename" default="10101" disabled="false"/>
5252
<!--Constraints-->
53-
<constraint xsi:type="unique" name="TEST_TABLE_SMALLINT_BIGINT">
53+
<constraint xsi:type="unique" referenceId="TEST_TABLE_SMALLINT_BIGINT">
5454
<column name="smallint"/>
5555
<column name="bigint"/>
5656
</constraint>
57-
<constraint xsi:type="foreign" name="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
57+
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
5858
column="tinyint" table="test_table"
5959
referenceTable="reference_table" referenceColumn="tinyint_ref" onDelete="NO ACTION"/>
6060
<!--Indexes-->
61-
<index name="TEST_TABLE_TINYINT_BIGINT" indexType="btree">
61+
<index referenceId="TEST_TABLE_TINYINT_BIGINT" indexType="btree">
6262
<column name="tinyint"/>
6363
<column name="bigint"/>
6464
</index>

dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule1/revisions/constraint_modifications/db_schema.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
<column xsi:type="bigint" name="bigint_default_nullable" padding="2" nullable="true" default="1"
2323
unsigned="true"/>
2424
<column xsi:type="bigint" name="bigint_not_default_not_nullable" padding="2" nullable="false" unsigned="true"/>
25-
<constraint xsi:type="primary" name="tinyint_primary">
25+
<constraint xsi:type="primary" referenceId="tinyint_primary">
2626
<column name="tinyint_ref"/>
2727
<column name="smallint_ref"/>
2828
</constraint>
29-
<constraint xsi:type="unique" name="REFERENCE_TABLE_SMALLINT_REF">
29+
<constraint xsi:type="unique" referenceId="REFERENCE_TABLE_SMALLINT_REF">
3030
<column name="smallint_ref"/>
3131
</constraint>
3232
</table>
@@ -35,7 +35,7 @@
3535
nullable="true"/>
3636
<column xsi:type="smallint" name="int_disabled_auto_increment" default="0" identity="false" padding="12"
3737
unsigned="true" nullable="true"/>
38-
<constraint xsi:type="unique" name="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
38+
<constraint xsi:type="unique" referenceId="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
3939
<column name="int_auto_increment_with_nullable"/>
4040
</constraint>
4141
</table>
@@ -60,23 +60,23 @@
6060
<column xsi:type="boolean" name="boolean"/>
6161
<column xsi:type="varbinary" name="varbinary_rename" default="10101" disabled="true"/>
6262
<!--Constraints-->
63-
<constraint xsi:type="unique" name="TEST_TABLE_SMALLINT_FLOAT">
63+
<constraint xsi:type="unique" referenceId="TEST_TABLE_SMALLINT_FLOAT">
6464
<column name="smallint"/>
6565
<column name="float"/>
6666
</constraint>
67-
<constraint xsi:type="unique" name="TEST_TABLE_DOUBLE">
67+
<constraint xsi:type="unique" referenceId="TEST_TABLE_DOUBLE">
6868
<column name="double"/>
6969
</constraint>
70-
<constraint xsi:type="foreign" name="some_foreign_key_new" column="smallint_main" table="test_table"
70+
<constraint xsi:type="foreign" referenceId="some_foreign_key_new" column="smallint_main" table="test_table"
7171
referenceTable="reference_table" referenceColumn="smallint_ref" onDelete="CASCADE"/>
72-
<constraint xsi:type="foreign" name="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
72+
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
7373
column="tinyint" table="test_table"
7474
referenceTable="reference_table" referenceColumn="tinyint_ref" onDelete="SET NULL"/>
75-
<constraint xsi:type="foreign" name="FK_FB77604C299EB8612D01E4AF8D9931F2"
75+
<constraint xsi:type="foreign" referenceId="FK_FB77604C299EB8612D01E4AF8D9931F2"
7676
column="integer_main" table="test_table"
7777
referenceTable="auto_increment_test" referenceColumn="int_auto_increment_with_nullable"/>
7878
<!--Indexes-->
79-
<index name="TEST_TABLE_TINYINT_BIGINT" indexType="btree">
79+
<index referenceId="TEST_TABLE_TINYINT_BIGINT" indexType="btree">
8080
<column name="tinyint"/>
8181
<column name="bigint"/>
8282
</index>

dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule1/revisions/drop_table/db_schema.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
nullable="true"/>
1313
<column xsi:type="smallint" name="int_disabled_auto_increment" default="0" identity="false" padding="12"
1414
unsigned="true" nullable="true"/>
15-
<constraint xsi:type="unique" name="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
15+
<constraint xsi:type="unique" referenceId="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
1616
<column name="int_auto_increment_with_nullable"/>
1717
</constraint>
1818
</table>

dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule1/revisions/foreign_key_interpreter/db_schema.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</table>
1313
<table name="test_table" resource="default">
1414
<column xsi:type="tinyint" name="tinyint" default="0" padding="7" nullable="true" unsigned="false"/>
15-
<constraint xsi:type="foreign" name="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
15+
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
1616
column="tinyint" table="test_table"
1717
referenceTable="reference_table" referenceColumn="tinyint_ref"/>
1818
</table>

dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule1/revisions/old_diff/db_schema.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
1010
<table name="reference_table" resource="default" comment="Reference table">
1111
<column xsi:type="smallint" name="smallint_ref" padding="6" nullable="false" unsigned="false" identity="true" comment="Smallint"/>
12-
<constraint xsi:type="primary" name="tinyint_primary">
12+
<constraint xsi:type="primary" referenceId="tinyint_primary">
1313
<column name="smallint_ref"/>
1414
</constraint>
1515
</table>
@@ -22,14 +22,14 @@
2222
<column xsi:type="mediumtext" name="mediumtext" comment="Mediumtext"/>
2323
<column xsi:type="varchar" name="varchar" length="254" nullable="true" comment="Varchar"/>
2424
<column xsi:type="boolean" name="boolean" comment="Boolean"/>
25-
<constraint xsi:type="unique" name="TEST_TABLE_SMALLINT_BIGINT">
25+
<constraint xsi:type="unique" referenceId="TEST_TABLE_SMALLINT_BIGINT">
2626
<column name="smallint"/>
2727
<column name="bigint"/>
2828
</constraint>
29-
<constraint xsi:type="foreign" name="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
29+
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
3030
column="smallint" table="test_table"
3131
referenceTable="reference_table" referenceColumn="smallint_ref" onDelete="CASCADE"/>
32-
<index name="TEST_TABLE_BIGINT" indexType="btree">
32+
<index referenceId="TEST_TABLE_BIGINT" indexType="btree">
3333
<column name="bigint"/>
3434
</index>
3535
</table>

dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule3/etc/db_schema.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<column xsi:type="tinyint" name="tinyint_ref" padding="7" nullable="false" identity="true" unsigned="false"/>
1212
<column xsi:type="int" name="some_integer" default="0" nullable="false" unsigned="false"/>
1313
<column xsi:type="varchar" name="for_patch_testing" comment="For patch testing" />
14-
<constraint xsi:type="primary" name="tinyint_primary">
14+
<constraint xsi:type="primary" referenceId="tinyint_primary">
1515
<column name="tinyint_ref"/>
1616
</constraint>
1717
</table>
@@ -21,10 +21,10 @@
2121
<column xsi:type="tinyint" name="tinyint" padding="7" nullable="true" unsigned="false"/>
2222
<column xsi:type="varchar" name="varchar" length="254" nullable="true"/>
2323
<column xsi:type="varbinary" name="varbinary" default="10101" />
24-
<constraint xsi:type="foreign" name="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
24+
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
2525
column="tinyint" table="test_table"
2626
referenceTable="reference_table" referenceColumn="tinyint_ref" onDelete="CASCADE"/>
27-
<constraint xsi:type="primary" name="PRIMARY">
27+
<constraint xsi:type="primary" referenceId="PRIMARY">
2828
<column name="smallint" />
2929
</constraint>
3030
</table>

0 commit comments

Comments
 (0)