File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
dev/tests/setup-integration
_files/Magento/TestSetupDeclarationModule8/revisions/disable_index_by_external_module Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © Magento, Inc. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+ -->
8
+ <schema xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
9
+ xsi : noNamespaceSchemaLocation =" urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd" >
10
+ <table name =" test_table" resource =" default" >
11
+ <index referenceId =" TEST_TABLE_TINYINT_BIGINT" disabled =" 1" />
12
+ </table >
13
+ </schema >
Original file line number Diff line number Diff line change @@ -317,4 +317,29 @@ public function testForeignKeyReferenceId()
317
317
$ this ->assertRegExp ('/CONSTRAINT\s`DEPENDENT_PAGE_ID_ON_TEST_TABLE_PAGE_ID`/ ' , $ tableSql );
318
318
$ this ->assertRegExp ('/CONSTRAINT\s`DEPENDENT_SCOPE_ID_ON_TEST_SCOPE_TABLE_SCOPE_ID`/ ' , $ tableSql );
319
319
}
320
+
321
+ /**
322
+ * @moduleName Magento_TestSetupDeclarationModule1
323
+ * @moduleName Magento_TestSetupDeclarationModule8
324
+ */
325
+ public function testDisableIndexByExternalModule ()
326
+ {
327
+ $ this ->cliCommad ->install (
328
+ ['Magento_TestSetupDeclarationModule1 ' , 'Magento_TestSetupDeclarationModule8 ' ]
329
+ );
330
+ $ this ->moduleManager ->updateRevision (
331
+ 'Magento_TestSetupDeclarationModule8 ' ,
332
+ 'disable_index_by_external_module ' ,
333
+ 'db_schema.xml ' ,
334
+ 'etc '
335
+ );
336
+ $ this ->cliCommad ->upgrade ();
337
+ $ tableStatements = $ this ->describeTable ->describeShard ('default ' );
338
+ $ tableSql = $ tableStatements ['test_table ' ];
339
+ $ this ->assertNotRegExp (
340
+ '/KEY\s+`TEST_TABLE_TINYINT_BIGINT`\s+\(`tinyint`,`bigint`\)/ ' ,
341
+ $ tableSql ,
342
+ 'Index is not being disabled by external module '
343
+ );
344
+ }
320
345
}
You can’t perform that action at this time.
0 commit comments