ltsecurityinc安防产品在线商城代码
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
namespace Magento\TestSetupDeclarationModule1\Setup;
|
||||
|
||||
use Magento\Framework\Setup\InstallSchemaInterface;
|
||||
use Magento\Framework\Setup\ModuleContextInterface;
|
||||
use Magento\Framework\Setup\SchemaSetupInterface;
|
||||
|
||||
/**
|
||||
* InstallSchema mock class
|
||||
*/
|
||||
class InstallSchema implements InstallSchemaInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
*/
|
||||
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
|
||||
{
|
||||
$installer = $setup;
|
||||
$installer->startSetup();
|
||||
$installer->endSetup();
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="reference_table" resource="default">
|
||||
<column xsi:type="tinyint" name="tinyint_ref" padding="7" nullable="false" identity="true" unsigned="false"/>
|
||||
<column xsi:type="tinyint" name="tinyint_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="bigint" name="bigint_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="smallint" name="smallint_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="int" name="integer_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="smallint" name="smallint_with_big_padding" padding="254" default="0" nullable="false"
|
||||
unsigned="false"/>
|
||||
<column xsi:type="smallint" name="smallint_without_default" padding="2" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="int" name="int_without_unsigned" padding="2" nullable="true"/>
|
||||
<column xsi:type="int" name="int_unsigned" padding="2" nullable="true" unsigned="true"/>
|
||||
<column xsi:type="bigint" name="bigint_default_nullable" padding="2" nullable="true" default="1"
|
||||
unsigned="true"/>
|
||||
<column xsi:type="bigint" name="bigint_not_default_not_nullable" padding="2" nullable="false" unsigned="true"/>
|
||||
<constraint xsi:type="primary" referenceId="tinyint_primary">
|
||||
<column name="tinyint_ref"/>
|
||||
</constraint>
|
||||
</table>
|
||||
<table name="auto_increment_test" resource="default">
|
||||
<column xsi:type="int" name="int_auto_increment_with_nullable" identity="true" padding="12" unsigned="true"
|
||||
nullable="true"/>
|
||||
<column xsi:type="smallint" name="int_disabled_auto_increment" default="0" identity="false" padding="12"
|
||||
unsigned="true" nullable="true"/>
|
||||
<constraint xsi:type="unique" referenceId="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
|
||||
<column name="int_auto_increment_with_nullable"/>
|
||||
</constraint>
|
||||
</table>
|
||||
<table name="test_table" resource="default">
|
||||
<!--Columns-->
|
||||
<column xsi:type="smallint" identity="true" name="smallint" padding="3" nullable="true"/>
|
||||
<column xsi:type="tinyint" name="tinyint" padding="7" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="bigint" name="bigint" default="0" padding="13" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="float" name="float" default="0" scale="4" precision="12"/>
|
||||
<column xsi:type="decimal" name="double" default="11111111.111111" precision="14" scale="6"/>
|
||||
<column xsi:type="decimal" name="decimal" default="0" scale="4" precision="15"/>
|
||||
<column xsi:type="date" name="date"/>
|
||||
<column xsi:type="timestamp" name="timestamp" default="CURRENT_TIMESTAMP" on_update="true"/>
|
||||
<column xsi:type="datetime" name="datetime" default="0"/>
|
||||
<column xsi:type="longtext" name="longtext"/>
|
||||
<column xsi:type="mediumtext" name="mediumtext"/>
|
||||
<column xsi:type="varchar" name="varchar" length="254" nullable="true"/>
|
||||
<column xsi:type="char" name="char" length="255" nullable="true"/>
|
||||
<column xsi:type="mediumblob" name="mediumblob"/>
|
||||
<column xsi:type="blob" name="blob"/>
|
||||
<column xsi:type="boolean" name="boolean"/>
|
||||
<column xsi:type="varbinary" name="varbinary_rename" default="10101" disabled="true"/>
|
||||
<!--Constraints-->
|
||||
<constraint xsi:type="unique" referenceId="TEST_TABLE_UNIQUE">
|
||||
<column name="smallint"/>
|
||||
<column name="bigint"/>
|
||||
</constraint>
|
||||
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE"
|
||||
column="tinyint" table="test_table"
|
||||
referenceTable="reference_table" referenceColumn="tinyint_ref" onDelete="NO ACTION"/>
|
||||
<!--Indexes-->
|
||||
<index referenceId="TEST_TABLE_INDEX" indexType="btree">
|
||||
<column name="tinyint"/>
|
||||
<column name="bigint"/>
|
||||
</index>
|
||||
</table>
|
||||
</schema>
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"reference_table": {
|
||||
"column": {
|
||||
"tinyint_ref": true,
|
||||
"tinyint_without_padding": true,
|
||||
"bigint_without_padding": true,
|
||||
"integer_without_padding": true,
|
||||
"smallint_with_big_padding": true,
|
||||
"smallint_without_default": true,
|
||||
"int_without_unsigned": true,
|
||||
"int_unsigned": true,
|
||||
"bigint_default_nullable": true,
|
||||
"bigint_not_default_not_nullable": true,
|
||||
"smallint_without_padding": true
|
||||
},
|
||||
"constraint": {
|
||||
"tinyint_primary": true
|
||||
}
|
||||
},
|
||||
"auto_increment_test": {
|
||||
"column": {
|
||||
"int_auto_increment_with_nullable": true,
|
||||
"int_disabled_auto_increment": true
|
||||
},
|
||||
"constraint": {
|
||||
"AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE": true
|
||||
}
|
||||
},
|
||||
"test_table": {
|
||||
"column": {
|
||||
"smallint": true,
|
||||
"tinyint": true,
|
||||
"bigint": true,
|
||||
"float": true,
|
||||
"double": true,
|
||||
"decimal": true,
|
||||
"date": true,
|
||||
"timestamp": true,
|
||||
"datetime": true,
|
||||
"longtext": true,
|
||||
"mediumtext": true,
|
||||
"varchar": true,
|
||||
"mediumblob": true,
|
||||
"blob": true,
|
||||
"boolean": true,
|
||||
"varbinary_rename": true
|
||||
},
|
||||
"index": {
|
||||
"TEST_TABLE_TINYINT_BIGINT": true
|
||||
},
|
||||
"constraint": {
|
||||
"TEST_TABLE_SMALLINT_BIGINT": true,
|
||||
"TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF": true
|
||||
}
|
||||
},
|
||||
"store": {
|
||||
"column": {
|
||||
"store_owner_id": true,
|
||||
"store_owner": true
|
||||
},
|
||||
"constraint": {
|
||||
"STORE_STORE_OWNER_ID_STORE_OWNER_OWNER_ID": true
|
||||
}
|
||||
},
|
||||
"store_owner": {
|
||||
"column": {
|
||||
"owner_id": true,
|
||||
"label": true
|
||||
},
|
||||
"constraint": {
|
||||
"": true
|
||||
}
|
||||
},
|
||||
"some_table": {
|
||||
"column": {
|
||||
"some_column": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
|
||||
<module name="Magento_TestSetupDeclarationModule1" setup_version="0.0.1"/>
|
||||
</config>
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int(10) unsigned DEFAULT NULL,
|
||||
`int_disabled_auto_increment` smallint(5) unsigned DEFAULT \'0\',
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
'reference_table' => 'CREATE TABLE `reference_table` (
|
||||
`tinyint_ref` tinyint(7) NOT NULL AUTO_INCREMENT,
|
||||
`tinyint_without_padding` tinyint(4) NOT NULL,
|
||||
`bigint_without_padding` bigint(20) NOT NULL DEFAULT \'0\',
|
||||
`smallint_without_padding` smallint(5) NOT NULL DEFAULT \'0\',
|
||||
`integer_without_padding` int(11) NOT NULL DEFAULT \'0\',
|
||||
`smallint_with_big_padding` smallint(254) NOT NULL DEFAULT \'0\',
|
||||
`smallint_without_default` smallint(2) DEFAULT NULL,
|
||||
`int_without_unsigned` int(2) DEFAULT NULL,
|
||||
`int_unsigned` int(2) unsigned DEFAULT NULL,
|
||||
`bigint_default_nullable` bigint(2) unsigned DEFAULT \'123\',
|
||||
`bigint_not_default_not_nullable` bigint(20) NOT NULL,
|
||||
PRIMARY KEY (`tinyint_ref`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
'test_table' => 'CREATE TABLE `test_table` (
|
||||
`smallint` smallint(3) NOT NULL AUTO_INCREMENT,
|
||||
`tinyint` tinyint(7) DEFAULT NULL,
|
||||
`bigint` bigint(13) DEFAULT \'0\',
|
||||
`float` float(12,10) DEFAULT \'0.0000000000\',
|
||||
`double` double(245,10) DEFAULT NULL,
|
||||
`decimal` decimal(15,4) DEFAULT \'0.0000\',
|
||||
`date` date DEFAULT NULL,
|
||||
`timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`datetime` datetime DEFAULT \'0000-00-00 00:00:00\',
|
||||
`longtext` longtext,
|
||||
`mediumtext` mediumtext,
|
||||
`varchar` varchar(100) DEFAULT NULL,
|
||||
`char` char(255) DEFAULT NULL,
|
||||
`mediumblob` mediumblob,
|
||||
`blob` blob,
|
||||
`boolean` tinyint(1) DEFAULT \'1\',
|
||||
UNIQUE KEY `TEST_TABLE_SMALLINT_BIGINT` (`smallint`,`bigint`),
|
||||
KEY `TEST_TABLE_TINYINT_BIGINT` (`tinyint`,`bigint`),
|
||||
CONSTRAINT `TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF` FOREIGN KEY (`tinyint`)
|
||||
REFERENCES `reference_table` (`tinyint_ref`) ON DELETE NO ACTION
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
];
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
'reference_table' => 'CREATE TABLE `reference_table` (
|
||||
`tinyint_ref` tinyint(7) NOT NULL AUTO_INCREMENT,
|
||||
`tinyint_without_padding` tinyint(4) NOT NULL DEFAULT \'0\',
|
||||
`bigint_without_padding` bigint(20) NOT NULL DEFAULT \'0\',
|
||||
`integer_without_padding` int(11) NOT NULL DEFAULT \'0\',
|
||||
`smallint_with_big_padding` smallint(254) NOT NULL DEFAULT \'0\',
|
||||
`smallint_without_default` smallint(2) DEFAULT NULL,
|
||||
`int_without_unsigned` int(2) DEFAULT NULL,
|
||||
`int_unsigned` int(2) unsigned DEFAULT NULL,
|
||||
`bigint_default_nullable` bigint(2) unsigned DEFAULT \'1\',
|
||||
`bigint_not_default_not_nullable` bigint(2) unsigned NOT NULL,
|
||||
PRIMARY KEY (`tinyint_ref`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
'test_table' => 'CREATE TABLE `test_table` (
|
||||
`smallint` smallint(3) NOT NULL AUTO_INCREMENT,
|
||||
`tinyint` tinyint(7) DEFAULT NULL,
|
||||
`bigint` bigint(13) DEFAULT \'0\',
|
||||
`float` float(12,10) DEFAULT \'0.0000000000\',
|
||||
`double` double(245,10) DEFAULT \'11111111.1111110000\',
|
||||
`decimal` decimal(15,4) DEFAULT \'0.0000\',
|
||||
`date` date DEFAULT NULL,
|
||||
`timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`datetime` datetime DEFAULT \'0000-00-00 00:00:00\',
|
||||
`longtext` longtext,
|
||||
`mediumtext` mediumtext,
|
||||
`varchar` varchar(254) DEFAULT NULL,
|
||||
`blob` blob,
|
||||
`boolean` tinyint(1) DEFAULT NULL,
|
||||
`varbinary_rename` varbinary(255) DEFAULT \'10101\',
|
||||
UNIQUE KEY `TEST_TABLE_SMALLINT_BIGINT` (`smallint`,`bigint`),
|
||||
KEY `TEST_TABLE_TINYINT_BIGINT` (`tinyint`,`bigint`),
|
||||
CONSTRAINT `TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF` FOREIGN KEY (`tinyint`)
|
||||
REFERENCES `reference_table` (`tinyint_ref`) ON DELETE NO ACTION
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
];
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
// @codingStandardsIgnoreFile
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`int_disabled_auto_increment` smallint(5) unsigned DEFAULT 0,
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
'reference_table' => 'CREATE TABLE `reference_table` (
|
||||
`tinyint_ref` tinyint(4) NOT NULL AUTO_INCREMENT,
|
||||
`tinyint_without_padding` tinyint(4) NOT NULL DEFAULT 0,
|
||||
`bigint_without_padding` bigint(20) NOT NULL DEFAULT 0,
|
||||
`smallint_without_padding` smallint(6) NOT NULL DEFAULT 0,
|
||||
`integer_without_padding` int(11) NOT NULL DEFAULT 0,
|
||||
`smallint_with_big_padding` smallint(6) NOT NULL DEFAULT 0,
|
||||
`smallint_without_default` smallint(6) DEFAULT NULL,
|
||||
`int_without_unsigned` int(11) DEFAULT NULL,
|
||||
`int_unsigned` int(10) unsigned DEFAULT NULL,
|
||||
`bigint_default_nullable` bigint(20) unsigned DEFAULT 1,
|
||||
`bigint_not_default_not_nullable` bigint(20) unsigned NOT NULL,
|
||||
`smallint_ref` smallint(6) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`tinyint_ref`,`smallint_ref`),
|
||||
UNIQUE KEY `REFERENCE_TABLE_SMALLINT_REF` (`smallint_ref`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
'test_table' => 'CREATE TABLE `test_table` (
|
||||
`smallint` smallint(6) DEFAULT NULL,
|
||||
`tinyint` tinyint(4) DEFAULT NULL,
|
||||
`bigint` bigint(20) DEFAULT 0,
|
||||
`float` float(12,10) DEFAULT 0.0000000000,
|
||||
`double` double(245,10) DEFAULT 11111111.1111110000,
|
||||
`decimal` decimal(15,4) DEFAULT 0.0000,
|
||||
`date` date DEFAULT NULL,
|
||||
`timestamp` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||
`datetime` datetime DEFAULT \'0000-00-00 00:00:00\',
|
||||
`longtext` longtext DEFAULT NULL,
|
||||
`mediumtext` mediumtext DEFAULT NULL,
|
||||
`varchar` varchar(254) DEFAULT NULL,
|
||||
`char` char(255) DEFAULT NULL,
|
||||
`mediumblob` mediumblob DEFAULT NULL,
|
||||
`blob` blob DEFAULT NULL,
|
||||
`boolean` tinyint(1) DEFAULT NULL,
|
||||
`integer_main` int(10) unsigned DEFAULT NULL,
|
||||
`smallint_main` smallint(6) NOT NULL DEFAULT 0,
|
||||
UNIQUE KEY `TEST_TABLE_SMALLINT_FLOAT` (`smallint`,`float`),
|
||||
UNIQUE KEY `TEST_TABLE_DOUBLE` (`double`),
|
||||
KEY `TEST_TABLE_TINYINT_BIGINT` (`tinyint`,`bigint`),
|
||||
KEY `TEST_TABLE_SMALLINT_MAIN_REFERENCE_TABLE_SMALLINT_REF` (`smallint_main`),
|
||||
KEY `FK_FB77604C299EB8612D01E4AF8D9931F2` (`integer_main`),
|
||||
CONSTRAINT `FK_FB77604C299EB8612D01E4AF8D9931F2` FOREIGN KEY (`integer_main`) REFERENCES `auto_increment_test` (`int_auto_increment_with_nullable`) ON DELETE CASCADE,
|
||||
CONSTRAINT `TEST_TABLE_SMALLINT_MAIN_REFERENCE_TABLE_SMALLINT_REF` FOREIGN KEY (`smallint_main`) REFERENCES `reference_table` (`smallint_ref`) ON DELETE CASCADE,
|
||||
CONSTRAINT `TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF` FOREIGN KEY (`tinyint`) REFERENCES `reference_table` (`tinyint_ref`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
];
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`int_disabled_auto_increment` smallint(5) unsigned DEFAULT 0,
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci',
|
||||
'reference_table' => 'CREATE TABLE `reference_table` (
|
||||
`tinyint_ref` tinyint(4) NOT NULL AUTO_INCREMENT,
|
||||
`tinyint_without_padding` tinyint(4) NOT NULL DEFAULT 0,
|
||||
`bigint_without_padding` bigint(20) NOT NULL DEFAULT 0,
|
||||
`smallint_without_padding` smallint(6) NOT NULL DEFAULT 0,
|
||||
`integer_without_padding` int(11) NOT NULL DEFAULT 0,
|
||||
`smallint_with_big_padding` smallint(6) NOT NULL DEFAULT 0,
|
||||
`smallint_without_default` smallint(6) DEFAULT NULL,
|
||||
`int_without_unsigned` int(11) DEFAULT NULL,
|
||||
`int_unsigned` int(10) unsigned DEFAULT NULL,
|
||||
`bigint_default_nullable` bigint(20) unsigned DEFAULT 1,
|
||||
`bigint_not_default_not_nullable` bigint(20) unsigned NOT NULL,
|
||||
`smallint_ref` smallint(6) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`tinyint_ref`,`smallint_ref`),
|
||||
UNIQUE KEY `REFERENCE_TABLE_SMALLINT_REF` (`smallint_ref`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci',
|
||||
'test_table' => 'CREATE TABLE `test_table` (
|
||||
`smallint` smallint(6) DEFAULT NULL,
|
||||
`tinyint` tinyint(4) DEFAULT NULL,
|
||||
`bigint` bigint(20) DEFAULT 0,
|
||||
`float` float(12,10) DEFAULT 0.0000000000,
|
||||
`double` double(245,10) DEFAULT 11111111.1111110000,
|
||||
`decimal` decimal(15,4) DEFAULT 0.0000,
|
||||
`date` date DEFAULT NULL,
|
||||
`timestamp` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||
`datetime` datetime DEFAULT \'0000-00-00 00:00:00\',
|
||||
`longtext` longtext DEFAULT NULL,
|
||||
`mediumtext` mediumtext DEFAULT NULL,
|
||||
`varchar` varchar(254) DEFAULT NULL,
|
||||
`char` char(255) DEFAULT NULL,
|
||||
`mediumblob` mediumblob DEFAULT NULL,
|
||||
`blob` blob DEFAULT NULL,
|
||||
`boolean` tinyint(1) DEFAULT NULL,
|
||||
`integer_main` int(10) unsigned DEFAULT NULL,
|
||||
`smallint_main` smallint(6) NOT NULL DEFAULT 0,
|
||||
UNIQUE KEY `TEST_TABLE_SMALLINT_FLOAT` (`smallint`,`float`),
|
||||
UNIQUE KEY `TEST_TABLE_DOUBLE` (`double`),
|
||||
KEY `TEST_TABLE_TINYINT_BIGINT` (`tinyint`,`bigint`),
|
||||
KEY `TEST_TABLE_SMALLINT_MAIN_REFERENCE_TABLE_SMALLINT_REF` (`smallint_main`),
|
||||
KEY `FK_FB77604C299EB8612D01E4AF8D9931F2` (`integer_main`),
|
||||
CONSTRAINT `FK_FB77604C299EB8612D01E4AF8D9931F2` FOREIGN KEY (`integer_main`) REFERENCES `auto_increment_test` (`int_auto_increment_with_nullable`) ON DELETE CASCADE,
|
||||
CONSTRAINT `TEST_TABLE_SMALLINT_MAIN_REFERENCE_TABLE_SMALLINT_REF` FOREIGN KEY (`smallint_main`) REFERENCES `reference_table` (`smallint_ref`) ON DELETE CASCADE,
|
||||
CONSTRAINT `TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF` FOREIGN KEY (`tinyint`) REFERENCES `reference_table` (`tinyint_ref`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci',
|
||||
];
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`int_disabled_auto_increment` smallint(5) unsigned DEFAULT 0,
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
'reference_table' => 'CREATE TABLE `reference_table` (
|
||||
`tinyint_ref` tinyint(4) NOT NULL AUTO_INCREMENT,
|
||||
`tinyint_without_padding` tinyint(4) NOT NULL DEFAULT 0,
|
||||
`bigint_without_padding` bigint(20) NOT NULL DEFAULT 0,
|
||||
`smallint_without_padding` smallint(6) NOT NULL DEFAULT 0,
|
||||
`integer_without_padding` int(11) NOT NULL DEFAULT 0,
|
||||
`smallint_with_big_padding` smallint(6) NOT NULL DEFAULT 0,
|
||||
`smallint_without_default` smallint(6) DEFAULT NULL,
|
||||
`int_without_unsigned` int(11) DEFAULT NULL,
|
||||
`int_unsigned` int(10) unsigned DEFAULT NULL,
|
||||
`bigint_default_nullable` bigint(20) unsigned DEFAULT 1,
|
||||
`bigint_not_default_not_nullable` bigint(20) unsigned NOT NULL,
|
||||
`smallint_ref` smallint(6) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`tinyint_ref`,`smallint_ref`),
|
||||
UNIQUE KEY `REFERENCE_TABLE_SMALLINT_REF` (`smallint_ref`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
'test_table' => 'CREATE TABLE `test_table` (
|
||||
`smallint` smallint(6) DEFAULT NULL,
|
||||
`tinyint` tinyint(4) DEFAULT NULL,
|
||||
`bigint` bigint(20) DEFAULT 0,
|
||||
`float` float(12,10) DEFAULT 0.0000000000,
|
||||
`double` double(245,10) DEFAULT 11111111.1111110000,
|
||||
`decimal` decimal(15,4) DEFAULT 0.0000,
|
||||
`date` date DEFAULT NULL,
|
||||
`timestamp` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||
`datetime` datetime DEFAULT \'0000-00-00 00:00:00\',
|
||||
`longtext` longtext DEFAULT NULL,
|
||||
`mediumtext` mediumtext DEFAULT NULL,
|
||||
`varchar` varchar(254) DEFAULT NULL,
|
||||
`char` char(255) DEFAULT NULL,
|
||||
`mediumblob` mediumblob DEFAULT NULL,
|
||||
`blob` blob DEFAULT NULL,
|
||||
`boolean` tinyint(1) DEFAULT NULL,
|
||||
`integer_main` int(10) unsigned DEFAULT NULL,
|
||||
`smallint_main` smallint(6) NOT NULL DEFAULT 0,
|
||||
UNIQUE KEY `TEST_TABLE_SMALLINT_FLOAT` (`smallint`,`float`),
|
||||
UNIQUE KEY `TEST_TABLE_DOUBLE` (`double`),
|
||||
KEY `TEST_TABLE_TINYINT_BIGINT` (`tinyint`,`bigint`),
|
||||
KEY `TEST_TABLE_SMALLINT_MAIN_REFERENCE_TABLE_SMALLINT_REF` (`smallint_main`),
|
||||
KEY `FK_FB77604C299EB8612D01E4AF8D9931F2` (`integer_main`),
|
||||
CONSTRAINT `FK_FB77604C299EB8612D01E4AF8D9931F2` FOREIGN KEY (`integer_main`) REFERENCES `auto_increment_test` (`int_auto_increment_with_nullable`) ON DELETE CASCADE,
|
||||
CONSTRAINT `TEST_TABLE_SMALLINT_MAIN_REFERENCE_TABLE_SMALLINT_REF` FOREIGN KEY (`smallint_main`) REFERENCES `reference_table` (`smallint_ref`) ON DELETE CASCADE,
|
||||
CONSTRAINT `TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF` FOREIGN KEY (`tinyint`) REFERENCES `reference_table` (`tinyint_ref`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
];
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`int_disabled_auto_increment` smallint(5) unsigned DEFAULT 0,
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci',
|
||||
'reference_table' => 'CREATE TABLE `reference_table` (
|
||||
`tinyint_ref` tinyint(4) NOT NULL AUTO_INCREMENT,
|
||||
`tinyint_without_padding` tinyint(4) NOT NULL DEFAULT 0,
|
||||
`bigint_without_padding` bigint(20) NOT NULL DEFAULT 0,
|
||||
`smallint_without_padding` smallint(6) NOT NULL DEFAULT 0,
|
||||
`integer_without_padding` int(11) NOT NULL DEFAULT 0,
|
||||
`smallint_with_big_padding` smallint(6) NOT NULL DEFAULT 0,
|
||||
`smallint_without_default` smallint(6) DEFAULT NULL,
|
||||
`int_without_unsigned` int(11) DEFAULT NULL,
|
||||
`int_unsigned` int(10) unsigned DEFAULT NULL,
|
||||
`bigint_default_nullable` bigint(20) unsigned DEFAULT 1,
|
||||
`bigint_not_default_not_nullable` bigint(20) unsigned NOT NULL,
|
||||
`smallint_ref` smallint(6) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`tinyint_ref`,`smallint_ref`),
|
||||
UNIQUE KEY `REFERENCE_TABLE_SMALLINT_REF` (`smallint_ref`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci',
|
||||
'test_table' => 'CREATE TABLE `test_table` (
|
||||
`smallint` smallint(6) DEFAULT NULL,
|
||||
`tinyint` tinyint(4) DEFAULT NULL,
|
||||
`bigint` bigint(20) DEFAULT 0,
|
||||
`float` float(12,10) DEFAULT 0.0000000000,
|
||||
`double` double(245,10) DEFAULT 11111111.1111110000,
|
||||
`decimal` decimal(15,4) DEFAULT 0.0000,
|
||||
`date` date DEFAULT NULL,
|
||||
`timestamp` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||
`datetime` datetime DEFAULT \'0000-00-00 00:00:00\',
|
||||
`longtext` longtext DEFAULT NULL,
|
||||
`mediumtext` mediumtext DEFAULT NULL,
|
||||
`varchar` varchar(254) DEFAULT NULL,
|
||||
`char` char(255) DEFAULT NULL,
|
||||
`mediumblob` mediumblob DEFAULT NULL,
|
||||
`blob` blob DEFAULT NULL,
|
||||
`boolean` tinyint(1) DEFAULT NULL,
|
||||
`integer_main` int(10) unsigned DEFAULT NULL,
|
||||
`smallint_main` smallint(6) NOT NULL DEFAULT 0,
|
||||
UNIQUE KEY `TEST_TABLE_SMALLINT_FLOAT` (`smallint`,`float`),
|
||||
UNIQUE KEY `TEST_TABLE_DOUBLE` (`double`),
|
||||
KEY `TEST_TABLE_TINYINT_BIGINT` (`tinyint`,`bigint`),
|
||||
KEY `TEST_TABLE_SMALLINT_MAIN_REFERENCE_TABLE_SMALLINT_REF` (`smallint_main`),
|
||||
KEY `FK_FB77604C299EB8612D01E4AF8D9931F2` (`integer_main`),
|
||||
CONSTRAINT `FK_FB77604C299EB8612D01E4AF8D9931F2` FOREIGN KEY (`integer_main`) REFERENCES `auto_increment_test` (`int_auto_increment_with_nullable`) ON DELETE CASCADE,
|
||||
CONSTRAINT `TEST_TABLE_SMALLINT_MAIN_REFERENCE_TABLE_SMALLINT_REF` FOREIGN KEY (`smallint_main`) REFERENCES `reference_table` (`smallint_ref`) ON DELETE CASCADE,
|
||||
CONSTRAINT `TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF` FOREIGN KEY (`tinyint`) REFERENCES `reference_table` (`tinyint_ref`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci',
|
||||
];
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
// @codingStandardsIgnoreFile
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`int_disabled_auto_increment` smallint unsigned DEFAULT \'0\',
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
'reference_table' => 'CREATE TABLE `reference_table` (
|
||||
`tinyint_ref` tinyint NOT NULL AUTO_INCREMENT,
|
||||
`tinyint_without_padding` tinyint NOT NULL DEFAULT \'0\',
|
||||
`bigint_without_padding` bigint NOT NULL DEFAULT \'0\',
|
||||
`smallint_without_padding` smallint NOT NULL DEFAULT \'0\',
|
||||
`integer_without_padding` int NOT NULL DEFAULT \'0\',
|
||||
`smallint_with_big_padding` smallint NOT NULL DEFAULT \'0\',
|
||||
`smallint_without_default` smallint DEFAULT NULL,
|
||||
`int_without_unsigned` int DEFAULT NULL,
|
||||
`int_unsigned` int unsigned DEFAULT NULL,
|
||||
`bigint_default_nullable` bigint unsigned DEFAULT \'1\',
|
||||
`bigint_not_default_not_nullable` bigint unsigned NOT NULL,
|
||||
`smallint_ref` smallint NOT NULL DEFAULT \'0\',
|
||||
PRIMARY KEY (`tinyint_ref`,`smallint_ref`),
|
||||
UNIQUE KEY `REFERENCE_TABLE_SMALLINT_REF` (`smallint_ref`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
'test_table' => 'CREATE TABLE `test_table` (
|
||||
`smallint` smallint DEFAULT NULL,
|
||||
`tinyint` tinyint DEFAULT NULL,
|
||||
`bigint` bigint DEFAULT \'0\',
|
||||
`float` float(12,10) DEFAULT \'0.0000000000\',
|
||||
`double` double(245,10) DEFAULT \'11111111.1111110000\',
|
||||
`decimal` decimal(15,4) DEFAULT \'0.0000\',
|
||||
`date` date DEFAULT NULL,
|
||||
`timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`datetime` datetime DEFAULT \'0000-00-00 00:00:00\',
|
||||
`longtext` longtext,
|
||||
`mediumtext` mediumtext,
|
||||
`varchar` varchar(254) DEFAULT NULL,
|
||||
`char` char(255) DEFAULT NULL,
|
||||
`mediumblob` mediumblob,
|
||||
`blob` blob,
|
||||
`boolean` tinyint(1) DEFAULT NULL,
|
||||
`integer_main` int unsigned DEFAULT NULL,
|
||||
`smallint_main` smallint NOT NULL DEFAULT \'0\',
|
||||
UNIQUE KEY `TEST_TABLE_SMALLINT_FLOAT` (`smallint`,`float`),
|
||||
UNIQUE KEY `TEST_TABLE_DOUBLE` (`double`),
|
||||
KEY `TEST_TABLE_TINYINT_BIGINT` (`tinyint`,`bigint`),
|
||||
KEY `TEST_TABLE_SMALLINT_MAIN_REFERENCE_TABLE_SMALLINT_REF` (`smallint_main`),
|
||||
KEY `FK_FB77604C299EB8612D01E4AF8D9931F2` (`integer_main`),
|
||||
CONSTRAINT `FK_FB77604C299EB8612D01E4AF8D9931F2` FOREIGN KEY (`integer_main`) REFERENCES `auto_increment_test` (`int_auto_increment_with_nullable`) ON DELETE CASCADE,
|
||||
CONSTRAINT `TEST_TABLE_SMALLINT_MAIN_REFERENCE_TABLE_SMALLINT_REF` FOREIGN KEY (`smallint_main`) REFERENCES `reference_table` (`smallint_ref`) ON DELETE CASCADE,
|
||||
CONSTRAINT `TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF` FOREIGN KEY (`tinyint`) REFERENCES `reference_table` (`tinyint_ref`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
];
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`int_disabled_auto_increment` smallint unsigned DEFAULT \'0\',
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
'reference_table' => 'CREATE TABLE `reference_table` (
|
||||
`tinyint_ref` tinyint NOT NULL AUTO_INCREMENT,
|
||||
`tinyint_without_padding` tinyint NOT NULL DEFAULT \'0\',
|
||||
`bigint_without_padding` bigint NOT NULL DEFAULT \'0\',
|
||||
`smallint_without_padding` smallint NOT NULL DEFAULT \'0\',
|
||||
`integer_without_padding` int NOT NULL DEFAULT \'0\',
|
||||
`smallint_with_big_padding` smallint NOT NULL DEFAULT \'0\',
|
||||
`smallint_without_default` smallint DEFAULT NULL,
|
||||
`int_without_unsigned` int DEFAULT NULL,
|
||||
`int_unsigned` int unsigned DEFAULT NULL,
|
||||
`bigint_default_nullable` bigint unsigned DEFAULT \'1\',
|
||||
`bigint_not_default_not_nullable` bigint unsigned NOT NULL,
|
||||
`smallint_ref` smallint NOT NULL DEFAULT \'0\',
|
||||
PRIMARY KEY (`tinyint_ref`,`smallint_ref`),
|
||||
UNIQUE KEY `REFERENCE_TABLE_SMALLINT_REF` (`smallint_ref`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
'test_table' => 'CREATE TABLE `test_table` (
|
||||
`smallint` smallint DEFAULT NULL,
|
||||
`tinyint` tinyint DEFAULT NULL,
|
||||
`bigint` bigint DEFAULT \'0\',
|
||||
`float` float(12,10) DEFAULT \'0.0000000000\',
|
||||
`double` double(245,10) DEFAULT \'11111111.1111110000\',
|
||||
`decimal` decimal(15,4) DEFAULT \'0.0000\',
|
||||
`date` date DEFAULT NULL,
|
||||
`timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`datetime` datetime DEFAULT \'0000-00-00 00:00:00\',
|
||||
`longtext` longtext,
|
||||
`mediumtext` mediumtext,
|
||||
`varchar` varchar(254) DEFAULT NULL,
|
||||
`char` char(255) DEFAULT NULL,
|
||||
`mediumblob` mediumblob,
|
||||
`blob` blob,
|
||||
`boolean` tinyint(1) DEFAULT NULL,
|
||||
`integer_main` int unsigned DEFAULT NULL,
|
||||
`smallint_main` smallint NOT NULL DEFAULT \'0\',
|
||||
UNIQUE KEY `TEST_TABLE_SMALLINT_FLOAT` (`smallint`,`float`),
|
||||
UNIQUE KEY `TEST_TABLE_DOUBLE` (`double`),
|
||||
KEY `TEST_TABLE_TINYINT_BIGINT` (`tinyint`,`bigint`),
|
||||
KEY `TEST_TABLE_SMALLINT_MAIN_REFERENCE_TABLE_SMALLINT_REF` (`smallint_main`),
|
||||
KEY `FK_FB77604C299EB8612D01E4AF8D9931F2` (`integer_main`),
|
||||
CONSTRAINT `FK_FB77604C299EB8612D01E4AF8D9931F2` FOREIGN KEY (`integer_main`) REFERENCES `auto_increment_test` (`int_auto_increment_with_nullable`) ON DELETE CASCADE,
|
||||
CONSTRAINT `TEST_TABLE_SMALLINT_MAIN_REFERENCE_TABLE_SMALLINT_REF` FOREIGN KEY (`smallint_main`) REFERENCES `reference_table` (`smallint_ref`) ON DELETE CASCADE,
|
||||
CONSTRAINT `TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF` FOREIGN KEY (`tinyint`) REFERENCES `reference_table` (`tinyint_ref`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
];
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
// @codingStandardsIgnoreFile
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`int_disabled_auto_increment` smallint(5) unsigned DEFAULT \'0\',
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
'reference_table' => 'CREATE TABLE `reference_table` (
|
||||
`tinyint_ref` tinyint(4) NOT NULL AUTO_INCREMENT,
|
||||
`tinyint_without_padding` tinyint(4) NOT NULL DEFAULT \'0\',
|
||||
`bigint_without_padding` bigint(20) NOT NULL DEFAULT \'0\',
|
||||
`smallint_without_padding` smallint(6) NOT NULL DEFAULT \'0\',
|
||||
`integer_without_padding` int(11) NOT NULL DEFAULT \'0\',
|
||||
`smallint_with_big_padding` smallint(6) NOT NULL DEFAULT \'0\',
|
||||
`smallint_without_default` smallint(6) DEFAULT NULL,
|
||||
`int_without_unsigned` int(11) DEFAULT NULL,
|
||||
`int_unsigned` int(10) unsigned DEFAULT NULL,
|
||||
`bigint_default_nullable` bigint(20) unsigned DEFAULT \'1\',
|
||||
`bigint_not_default_not_nullable` bigint(20) unsigned NOT NULL,
|
||||
`smallint_ref` smallint(6) NOT NULL DEFAULT \'0\',
|
||||
PRIMARY KEY (`tinyint_ref`,`smallint_ref`),
|
||||
UNIQUE KEY `REFERENCE_TABLE_SMALLINT_REF` (`smallint_ref`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
'test_table' => 'CREATE TABLE `test_table` (
|
||||
`smallint` smallint(6) DEFAULT NULL,
|
||||
`tinyint` tinyint(4) DEFAULT NULL,
|
||||
`bigint` bigint(20) DEFAULT \'0\',
|
||||
`float` float(12,10) DEFAULT \'0.0000000000\',
|
||||
`double` double(245,10) DEFAULT \'11111111.1111110000\',
|
||||
`decimal` decimal(15,4) DEFAULT \'0.0000\',
|
||||
`date` date DEFAULT NULL,
|
||||
`timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`datetime` datetime DEFAULT \'0000-00-00 00:00:00\',
|
||||
`longtext` longtext,
|
||||
`mediumtext` mediumtext,
|
||||
`varchar` varchar(254) DEFAULT NULL,
|
||||
`char` char(255) DEFAULT NULL,
|
||||
`mediumblob` mediumblob,
|
||||
`blob` blob,
|
||||
`boolean` tinyint(1) DEFAULT NULL,
|
||||
`integer_main` int(10) unsigned DEFAULT NULL,
|
||||
`smallint_main` smallint(6) NOT NULL DEFAULT \'0\',
|
||||
UNIQUE KEY `TEST_TABLE_SMALLINT_FLOAT` (`smallint`,`float`),
|
||||
UNIQUE KEY `TEST_TABLE_DOUBLE` (`double`),
|
||||
KEY `TEST_TABLE_TINYINT_BIGINT` (`tinyint`,`bigint`),
|
||||
KEY `TEST_TABLE_SMALLINT_MAIN_REFERENCE_TABLE_SMALLINT_REF` (`smallint_main`),
|
||||
KEY `FK_FB77604C299EB8612D01E4AF8D9931F2` (`integer_main`),
|
||||
CONSTRAINT `FK_FB77604C299EB8612D01E4AF8D9931F2` FOREIGN KEY (`integer_main`) REFERENCES `auto_increment_test` (`int_auto_increment_with_nullable`) ON DELETE CASCADE,
|
||||
CONSTRAINT `TEST_TABLE_SMALLINT_MAIN_REFERENCE_TABLE_SMALLINT_REF` FOREIGN KEY (`smallint_main`) REFERENCES `reference_table` (`smallint_ref`) ON DELETE CASCADE,
|
||||
CONSTRAINT `TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF` FOREIGN KEY (`tinyint`) REFERENCES `reference_table` (`tinyint_ref`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
];
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`int_disabled_auto_increment` smallint(10) unsigned DEFAULT \'0\',
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
'reference_table' => 'CREATE TABLE `reference_table` (
|
||||
`tinyint_ref` tinyint(7) NOT NULL AUTO_INCREMENT,
|
||||
`tinyint_without_padding` tinyint(4) NOT NULL DEFAULT \'0\',
|
||||
`bigint_without_padding` bigint(20) NOT NULL DEFAULT \'0\',
|
||||
`smallint_without_padding` smallint(5) NOT NULL DEFAULT \'0\',
|
||||
`integer_without_padding` int(11) NOT NULL DEFAULT \'0\',
|
||||
`smallint_with_big_padding` smallint(254) NOT NULL DEFAULT \'0\',
|
||||
`smallint_without_default` smallint(2) DEFAULT NULL,
|
||||
`int_without_unsigned` int(2) DEFAULT NULL,
|
||||
`int_unsigned` int(2) unsigned DEFAULT NULL,
|
||||
`bigint_default_nullable` bigint(2) unsigned DEFAULT \'1\',
|
||||
`bigint_not_default_not_nullable` bigint(2) unsigned NOT NULL,
|
||||
PRIMARY KEY (`tinyint_ref`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
'test_table' => 'CREATE TABLE `test_table` (
|
||||
`smallint` smallint(3) NOT NULL AUTO_INCREMENT,
|
||||
`tinyint` tinyint(7) DEFAULT NULL,
|
||||
`bigint` bigint(13) DEFAULT \'0\',
|
||||
`float` float(12,4) DEFAULT \'0.0000\',
|
||||
`double` decimal(14,6) DEFAULT \'11111111.111111\',
|
||||
`decimal` decimal(15,4) DEFAULT \'0.0000\',
|
||||
`date` date DEFAULT NULL,
|
||||
`timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`datetime` datetime DEFAULT \'0000-00-00 00:00:00\',
|
||||
`longtext` longtext,
|
||||
`mediumtext` mediumtext,
|
||||
`varchar` varchar(254) DEFAULT NULL,
|
||||
`mediumblob` mediumblob,
|
||||
`blob` blob,
|
||||
`boolean` tinyint(1) DEFAULT NULL,
|
||||
UNIQUE KEY `TEST_TABLE_SMALLINT_BIGINT` (`smallint`,`bigint`),
|
||||
KEY `TEST_TABLE_TINYINT_BIGINT` (`tinyint`,`bigint`),
|
||||
CONSTRAINT `TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF` FOREIGN KEY (`tinyint`)
|
||||
REFERENCES `reference_table` (`tinyint_ref`) ON DELETE NO ACTION
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
];
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
return [
|
||||
'before' => [
|
||||
'store' => 'CREATE TABLE `store` (
|
||||
`store_owner_id` smallint(6) DEFAULT NULL COMMENT \'Store Owner Reference\',
|
||||
KEY `STORE_STORE_OWNER_ID_STORE_OWNER_OWNER_ID` (`store_owner_id`),
|
||||
CONSTRAINT `STORE_STORE_OWNER_ID_STORE_OWNER_OWNER_ID` FOREIGN KEY (`store_owner_id`) REFERENCES `store_owner` (`owner_id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci',
|
||||
'store_owner' => 'CREATE TABLE `store_owner` (
|
||||
`owner_id` smallint(6) NOT NULL AUTO_INCREMENT,
|
||||
`store_owner_name` varchar(255) DEFAULT NULL COMMENT \'Store Owner Name\',
|
||||
PRIMARY KEY (`owner_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT=\'Store owner information\''
|
||||
],
|
||||
'after' => [
|
||||
'store' => 'CREATE TABLE `store` (
|
||||
`store_owner` varchar(255) DEFAULT NULL COMMENT \'Store Owner Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci'
|
||||
]
|
||||
];
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
return [
|
||||
'before' => [
|
||||
'store' => 'CREATE TABLE `store` (
|
||||
`store_owner_id` smallint(6) DEFAULT NULL COMMENT \'Store Owner Reference\',
|
||||
KEY `STORE_STORE_OWNER_ID_STORE_OWNER_OWNER_ID` (`store_owner_id`),
|
||||
CONSTRAINT `STORE_STORE_OWNER_ID_STORE_OWNER_OWNER_ID` FOREIGN KEY (`store_owner_id`) REFERENCES `store_owner` (`owner_id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
'store_owner' => 'CREATE TABLE `store_owner` (
|
||||
`owner_id` smallint(6) NOT NULL AUTO_INCREMENT,
|
||||
`store_owner_name` varchar(255) DEFAULT NULL COMMENT \'Store Owner Name\',
|
||||
PRIMARY KEY (`owner_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT=\'Store owner information\''
|
||||
],
|
||||
'after' => [
|
||||
'store' => 'CREATE TABLE `store` (
|
||||
`store_owner` varchar(255) DEFAULT NULL COMMENT \'Store Owner Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3'
|
||||
]
|
||||
];
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
return [
|
||||
'before' => [
|
||||
'store' => 'CREATE TABLE `store` (
|
||||
`store_owner_id` smallint(6) DEFAULT NULL COMMENT \'Store Owner Reference\',
|
||||
KEY `STORE_STORE_OWNER_ID_STORE_OWNER_OWNER_ID` (`store_owner_id`),
|
||||
CONSTRAINT `STORE_STORE_OWNER_ID_STORE_OWNER_OWNER_ID` FOREIGN KEY (`store_owner_id`) REFERENCES `store_owner` (`owner_id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci',
|
||||
'store_owner' => 'CREATE TABLE `store_owner` (
|
||||
`owner_id` smallint(6) NOT NULL AUTO_INCREMENT,
|
||||
`store_owner_name` varchar(255) DEFAULT NULL COMMENT \'Store Owner Name\',
|
||||
PRIMARY KEY (`owner_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT=\'Store owner information\''
|
||||
],
|
||||
'after' => [
|
||||
'store' => 'CREATE TABLE `store` (
|
||||
`store_owner` varchar(255) DEFAULT NULL COMMENT \'Store Owner Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci'
|
||||
]
|
||||
];
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
return [
|
||||
'before' => [
|
||||
'store' => 'CREATE TABLE `store` (
|
||||
`store_owner_id` smallint DEFAULT NULL COMMENT \'Store Owner Reference\',
|
||||
KEY `STORE_STORE_OWNER_ID_STORE_OWNER_OWNER_ID` (`store_owner_id`),
|
||||
CONSTRAINT `STORE_STORE_OWNER_ID_STORE_OWNER_OWNER_ID` FOREIGN KEY (`store_owner_id`) REFERENCES `store_owner` (`owner_id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
'store_owner' => 'CREATE TABLE `store_owner` (
|
||||
`owner_id` smallint NOT NULL AUTO_INCREMENT,
|
||||
`store_owner_name` varchar(255) DEFAULT NULL COMMENT \'Store Owner Name\',
|
||||
PRIMARY KEY (`owner_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT=\'Store owner information\''
|
||||
],
|
||||
'after' => [
|
||||
'store' => 'CREATE TABLE `store` (
|
||||
`store_owner` varchar(255) DEFAULT NULL COMMENT \'Store Owner Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3'
|
||||
]
|
||||
];
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
return [
|
||||
'before' => [
|
||||
'store' => 'CREATE TABLE `store` (
|
||||
`store_owner_id` smallint DEFAULT NULL COMMENT \'Store Owner Reference\',
|
||||
KEY `STORE_STORE_OWNER_ID_STORE_OWNER_OWNER_ID` (`store_owner_id`),
|
||||
CONSTRAINT `STORE_STORE_OWNER_ID_STORE_OWNER_OWNER_ID` FOREIGN KEY (`store_owner_id`) REFERENCES `store_owner` (`owner_id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
'store_owner' => 'CREATE TABLE `store_owner` (
|
||||
`owner_id` smallint NOT NULL AUTO_INCREMENT,
|
||||
`store_owner_name` varchar(255) DEFAULT NULL COMMENT \'Store Owner Name\',
|
||||
PRIMARY KEY (`owner_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT=\'Store owner information\''
|
||||
],
|
||||
'after' => [
|
||||
'store' => 'CREATE TABLE `store` (
|
||||
`store_owner` varchar(255) DEFAULT NULL COMMENT \'Store Owner Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3'
|
||||
]
|
||||
];
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
return [
|
||||
'before' => [
|
||||
'store' => 'CREATE TABLE `store` (
|
||||
`store_owner_id` smallint(6) DEFAULT NULL COMMENT \'Store Owner Reference\',
|
||||
KEY `STORE_STORE_OWNER_ID_STORE_OWNER_OWNER_ID` (`store_owner_id`),
|
||||
CONSTRAINT `STORE_STORE_OWNER_ID_STORE_OWNER_OWNER_ID` FOREIGN KEY (`store_owner_id`)
|
||||
REFERENCES `store_owner` (`owner_id`) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
'store_owner' => 'CREATE TABLE `store_owner` (
|
||||
`owner_id` smallint(6) NOT NULL AUTO_INCREMENT,
|
||||
`store_owner_name` varchar(255) DEFAULT NULL COMMENT \'Store Owner Name\',
|
||||
PRIMARY KEY (`owner_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=\'Store owner information\''
|
||||
],
|
||||
'after' => [
|
||||
'store' => 'CREATE TABLE `store` (
|
||||
`store_owner` varchar(255) DEFAULT NULL COMMENT \'Store Owner Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8'
|
||||
]
|
||||
];
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`int_disabled_auto_increment` smallint(5) unsigned DEFAULT 0,
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8'
|
||||
];
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`int_disabled_auto_increment` smallint(5) unsigned DEFAULT 0,
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci'
|
||||
];
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`int_disabled_auto_increment` smallint(5) unsigned DEFAULT 0,
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3'
|
||||
];
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`int_disabled_auto_increment` smallint(5) unsigned DEFAULT 0,
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci'
|
||||
];
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`int_disabled_auto_increment` smallint unsigned DEFAULT \'0\',
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3'
|
||||
];
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int unsigned NOT NULL AUTO_INCREMENT,
|
||||
`int_disabled_auto_increment` smallint unsigned DEFAULT \'0\',
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3'
|
||||
];
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
return [
|
||||
'auto_increment_test' => 'CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`int_disabled_auto_increment` smallint(5) unsigned DEFAULT \'0\',
|
||||
UNIQUE KEY `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8'
|
||||
];
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'before' => 'CREATE TABLE `some_table` (
|
||||
`some_column` varchar(255) DEFAULT NULL COMMENT \'Some Column Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci',
|
||||
'after' => 'CREATE TABLE `some_table_renamed` (
|
||||
`some_column` varchar(255) DEFAULT NULL COMMENT \'Some Column Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci',
|
||||
];
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'before' => 'CREATE TABLE `some_table` (
|
||||
`some_column` varchar(255) DEFAULT NULL COMMENT \'Some Column Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
'after' => 'CREATE TABLE `some_table_renamed` (
|
||||
`some_column` varchar(255) DEFAULT NULL COMMENT \'Some Column Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
];
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'before' => 'CREATE TABLE `some_table` (
|
||||
`some_column` varchar(255) DEFAULT NULL COMMENT \'Some Column Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci',
|
||||
'after' => 'CREATE TABLE `some_table_renamed` (
|
||||
`some_column` varchar(255) DEFAULT NULL COMMENT \'Some Column Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci',
|
||||
];
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'before' => 'CREATE TABLE `some_table` (
|
||||
`some_column` varchar(255) DEFAULT NULL COMMENT \'Some Column Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
'after' => 'CREATE TABLE `some_table_renamed` (
|
||||
`some_column` varchar(255) DEFAULT NULL COMMENT \'Some Column Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
];
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'before' => 'CREATE TABLE `some_table` (
|
||||
`some_column` varchar(255) DEFAULT NULL COMMENT \'Some Column Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
'after' => 'CREATE TABLE `some_table_renamed` (
|
||||
`some_column` varchar(255) DEFAULT NULL COMMENT \'Some Column Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3',
|
||||
];
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'before' => 'CREATE TABLE `some_table` (
|
||||
`some_column` varchar(255) DEFAULT NULL COMMENT \'Some Column Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
'after' => 'CREATE TABLE `some_table_renamed` (
|
||||
`some_column` varchar(255) DEFAULT NULL COMMENT \'Some Column Name\'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8',
|
||||
];
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
return ['CREATE TABLE `reference_table` (
|
||||
`tinyint_ref` tinyint NOT NULL AUTO_INCREMENT ,
|
||||
`tinyint_without_padding` tinyint NOT NULL DEFAULT 0 ,
|
||||
`bigint_without_padding` bigint NOT NULL DEFAULT 0 ,
|
||||
`smallint_without_padding` smallint NOT NULL DEFAULT 0 ,
|
||||
`integer_without_padding` int NOT NULL DEFAULT 0 ,
|
||||
`smallint_with_big_padding` smallint NOT NULL DEFAULT 0 ,
|
||||
`smallint_without_default` smallint NULL ,
|
||||
`int_without_unsigned` int NULL ,
|
||||
`int_unsigned` int UNSIGNED NULL ,
|
||||
`bigint_default_nullable` bigint UNSIGNED NULL DEFAULT 1 ,
|
||||
`bigint_not_default_not_nullable` bigint UNSIGNED NOT NULL ,
|
||||
CONSTRAINT PRIMARY KEY (`tinyint_ref`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8mb3 DEFAULT COLLATE=utf8mb3_general_ci
|
||||
|
||||
CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int UNSIGNED NOT NULL AUTO_INCREMENT ,
|
||||
`int_disabled_auto_increment` smallint UNSIGNED NULL DEFAULT 0 ,
|
||||
CONSTRAINT `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` UNIQUE KEY (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8mb3 DEFAULT COLLATE=utf8mb3_general_ci
|
||||
|
||||
CREATE TABLE `test_table` (
|
||||
`smallint` smallint NOT NULL AUTO_INCREMENT ,
|
||||
`tinyint` tinyint NULL ,
|
||||
`bigint` bigint NULL DEFAULT 0 ,
|
||||
`float` float(12, 4) NULL DEFAULT 0 ,
|
||||
`double` decimal(14, 6) NULL DEFAULT 11111111.111111 ,
|
||||
`decimal` decimal(15, 4) NULL DEFAULT 0 ,
|
||||
`date` date NULL ,
|
||||
`timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
|
||||
`datetime` datetime NULL DEFAULT 0 ,
|
||||
`longtext` longtext NULL ,
|
||||
`mediumtext` mediumtext NULL ,
|
||||
`varchar` varchar(254) NULL ,
|
||||
`char` char(255) NULL ,
|
||||
`mediumblob` mediumblob NULL ,
|
||||
`blob` blob NULL ,
|
||||
`boolean` BOOLEAN NULL ,
|
||||
CONSTRAINT `TEST_TABLE_SMALLINT_BIGINT` UNIQUE KEY (`smallint`,`bigint`),
|
||||
CONSTRAINT `TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF` FOREIGN KEY (`tinyint`) REFERENCES `reference_table` (`tinyint_ref`) ON DELETE NO ACTION,
|
||||
INDEX `TEST_TABLE_TINYINT_BIGINT` (`tinyint`,`bigint`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8mb3 DEFAULT COLLATE=utf8mb3_general_ci
|
||||
|
||||
CREATE TABLE `patch_list` (
|
||||
`patch_id` int NOT NULL AUTO_INCREMENT COMMENT "Patch Auto Increment",
|
||||
`patch_name` varchar(1024) NOT NULL COMMENT "Patch Class Name",
|
||||
CONSTRAINT PRIMARY KEY (`patch_id`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8mb3 DEFAULT COLLATE=utf8mb3_general_ci COMMENT="List of data/schema patches"
|
||||
|
||||
'];
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
return ['CREATE TABLE `reference_table` (
|
||||
`tinyint_ref` tinyint NOT NULL AUTO_INCREMENT ,
|
||||
`tinyint_without_padding` tinyint NOT NULL DEFAULT 0 ,
|
||||
`bigint_without_padding` bigint NOT NULL DEFAULT 0 ,
|
||||
`smallint_without_padding` smallint NOT NULL DEFAULT 0 ,
|
||||
`integer_without_padding` int NOT NULL DEFAULT 0 ,
|
||||
`smallint_with_big_padding` smallint NOT NULL DEFAULT 0 ,
|
||||
`smallint_without_default` smallint NULL ,
|
||||
`int_without_unsigned` int NULL ,
|
||||
`int_unsigned` int UNSIGNED NULL ,
|
||||
`bigint_default_nullable` bigint UNSIGNED NULL DEFAULT 1 ,
|
||||
`bigint_not_default_not_nullable` bigint UNSIGNED NOT NULL ,
|
||||
CONSTRAINT PRIMARY KEY (`tinyint_ref`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8mb3 DEFAULT COLLATE=utf8mb3_general_ci
|
||||
|
||||
CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int UNSIGNED NOT NULL AUTO_INCREMENT ,
|
||||
`int_disabled_auto_increment` smallint UNSIGNED NULL DEFAULT 0 ,
|
||||
CONSTRAINT `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` UNIQUE KEY (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8mb3 DEFAULT COLLATE=utf8mb3_general_ci
|
||||
|
||||
CREATE TABLE `test_table` (
|
||||
`smallint` smallint NOT NULL AUTO_INCREMENT ,
|
||||
`tinyint` tinyint NULL ,
|
||||
`bigint` bigint NULL DEFAULT 0 ,
|
||||
`float` float(12, 4) NULL DEFAULT 0 ,
|
||||
`double` decimal(14, 6) NULL DEFAULT 11111111.111111 ,
|
||||
`decimal` decimal(15, 4) NULL DEFAULT 0 ,
|
||||
`date` date NULL ,
|
||||
`timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
|
||||
`datetime` datetime NULL DEFAULT 0 ,
|
||||
`longtext` longtext NULL ,
|
||||
`mediumtext` mediumtext NULL ,
|
||||
`varchar` varchar(254) NULL ,
|
||||
`char` char(255) NULL ,
|
||||
`mediumblob` mediumblob NULL ,
|
||||
`blob` blob NULL ,
|
||||
`boolean` BOOLEAN NULL ,
|
||||
CONSTRAINT `TEST_TABLE_SMALLINT_BIGINT` UNIQUE KEY (`smallint`,`bigint`),
|
||||
CONSTRAINT `TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF` FOREIGN KEY (`tinyint`) REFERENCES `reference_table` (`tinyint_ref`) ON DELETE NO ACTION,
|
||||
INDEX `TEST_TABLE_TINYINT_BIGINT` (`tinyint`,`bigint`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8mb3 DEFAULT COLLATE=utf8mb3_general_ci
|
||||
|
||||
CREATE TABLE `patch_list` (
|
||||
`patch_id` int NOT NULL AUTO_INCREMENT COMMENT "Patch Auto Increment",
|
||||
`patch_name` varchar(1024) NOT NULL COMMENT "Patch Class Name",
|
||||
CONSTRAINT PRIMARY KEY (`patch_id`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8mb3 DEFAULT COLLATE=utf8mb3_general_ci COMMENT="List of data/schema patches"
|
||||
|
||||
'];
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// @codingStandardsIgnoreFile
|
||||
return ['CREATE TABLE `reference_table` (
|
||||
`tinyint_ref` tinyint NOT NULL AUTO_INCREMENT ,
|
||||
`tinyint_without_padding` tinyint NOT NULL DEFAULT 0 ,
|
||||
`bigint_without_padding` bigint NOT NULL DEFAULT 0 ,
|
||||
`smallint_without_padding` smallint NOT NULL DEFAULT 0 ,
|
||||
`integer_without_padding` int NOT NULL DEFAULT 0 ,
|
||||
`smallint_with_big_padding` smallint NOT NULL DEFAULT 0 ,
|
||||
`smallint_without_default` smallint NULL ,
|
||||
`int_without_unsigned` int NULL ,
|
||||
`int_unsigned` int UNSIGNED NULL ,
|
||||
`bigint_default_nullable` bigint UNSIGNED NULL DEFAULT 1 ,
|
||||
`bigint_not_default_not_nullable` bigint UNSIGNED NOT NULL ,
|
||||
CONSTRAINT PRIMARY KEY (`tinyint_ref`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8mb3 DEFAULT COLLATE=utf8mb3_general_ci
|
||||
|
||||
CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int UNSIGNED NOT NULL AUTO_INCREMENT ,
|
||||
`int_disabled_auto_increment` smallint UNSIGNED NULL DEFAULT 0 ,
|
||||
CONSTRAINT `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` UNIQUE KEY (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8mb3 DEFAULT COLLATE=utf8mb3_general_ci
|
||||
|
||||
CREATE TABLE `test_table` (
|
||||
`smallint` smallint NOT NULL AUTO_INCREMENT ,
|
||||
`tinyint` tinyint NULL ,
|
||||
`bigint` bigint NULL DEFAULT 0 ,
|
||||
`float` float(12, 4) NULL DEFAULT 0 ,
|
||||
`double` decimal(14, 6) NULL DEFAULT 11111111.111111 ,
|
||||
`decimal` decimal(15, 4) NULL DEFAULT 0 ,
|
||||
`date` date NULL ,
|
||||
`timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
|
||||
`datetime` datetime NULL DEFAULT 0 ,
|
||||
`longtext` longtext NULL ,
|
||||
`mediumtext` mediumtext NULL ,
|
||||
`varchar` varchar(254) NULL ,
|
||||
`char` char(255) NULL ,
|
||||
`mediumblob` mediumblob NULL ,
|
||||
`blob` blob NULL ,
|
||||
`boolean` BOOLEAN NULL ,
|
||||
CONSTRAINT `TEST_TABLE_SMALLINT_BIGINT` UNIQUE KEY (`smallint`,`bigint`),
|
||||
CONSTRAINT `TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF` FOREIGN KEY (`tinyint`) REFERENCES `reference_table` (`tinyint_ref`) ON DELETE NO ACTION,
|
||||
INDEX `TEST_TABLE_TINYINT_BIGINT` (`tinyint`,`bigint`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8mb3 DEFAULT COLLATE=utf8mb3_general_ci
|
||||
|
||||
CREATE TABLE `patch_list` (
|
||||
`patch_id` int NOT NULL AUTO_INCREMENT COMMENT "Patch Auto Increment",
|
||||
`patch_name` varchar(1024) NOT NULL COMMENT "Patch Class Name",
|
||||
CONSTRAINT PRIMARY KEY (`patch_id`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8mb3 DEFAULT COLLATE=utf8mb3_general_ci COMMENT="List of data/schema patches"
|
||||
|
||||
'];
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
// @codingStandardsIgnoreFile
|
||||
return ['CREATE TABLE `reference_table` (
|
||||
`tinyint_ref` tinyint NOT NULL AUTO_INCREMENT ,
|
||||
`tinyint_without_padding` tinyint NOT NULL DEFAULT 0 ,
|
||||
`bigint_without_padding` bigint NOT NULL DEFAULT 0 ,
|
||||
`smallint_without_padding` smallint NOT NULL DEFAULT 0 ,
|
||||
`integer_without_padding` int NOT NULL DEFAULT 0 ,
|
||||
`smallint_with_big_padding` smallint NOT NULL DEFAULT 0 ,
|
||||
`smallint_without_default` smallint NULL ,
|
||||
`int_without_unsigned` int NULL ,
|
||||
`int_unsigned` int UNSIGNED NULL ,
|
||||
`bigint_default_nullable` bigint UNSIGNED NULL DEFAULT 1 ,
|
||||
`bigint_not_default_not_nullable` bigint UNSIGNED NOT NULL ,
|
||||
CONSTRAINT PRIMARY KEY (`tinyint_ref`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8 DEFAULT COLLATE=utf8_general_ci
|
||||
|
||||
CREATE TABLE `auto_increment_test` (
|
||||
`int_auto_increment_with_nullable` int UNSIGNED NOT NULL AUTO_INCREMENT ,
|
||||
`int_disabled_auto_increment` smallint UNSIGNED NULL DEFAULT 0 ,
|
||||
CONSTRAINT `AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE` UNIQUE KEY (`int_auto_increment_with_nullable`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8 DEFAULT COLLATE=utf8_general_ci
|
||||
|
||||
CREATE TABLE `test_table` (
|
||||
`smallint` smallint NOT NULL AUTO_INCREMENT ,
|
||||
`tinyint` tinyint NULL ,
|
||||
`bigint` bigint NULL DEFAULT 0 ,
|
||||
`float` float(12, 4) NULL DEFAULT 0 ,
|
||||
`double` decimal(14, 6) NULL DEFAULT 11111111.111111 ,
|
||||
`decimal` decimal(15, 4) NULL DEFAULT 0 ,
|
||||
`date` date NULL ,
|
||||
`timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
|
||||
`datetime` datetime NULL DEFAULT 0 ,
|
||||
`longtext` longtext NULL ,
|
||||
`mediumtext` mediumtext NULL ,
|
||||
`varchar` varchar(254) NULL ,
|
||||
`char` char(255) NULL ,
|
||||
`mediumblob` mediumblob NULL ,
|
||||
`blob` blob NULL ,
|
||||
`boolean` BOOLEAN NULL ,
|
||||
CONSTRAINT `TEST_TABLE_SMALLINT_BIGINT` UNIQUE KEY (`smallint`,`bigint`),
|
||||
CONSTRAINT `TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF` FOREIGN KEY (`tinyint`) REFERENCES `reference_table` (`tinyint_ref`) ON DELETE NO ACTION,
|
||||
INDEX `TEST_TABLE_TINYINT_BIGINT` (`tinyint`,`bigint`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8 DEFAULT COLLATE=utf8_general_ci
|
||||
|
||||
CREATE TABLE `patch_list` (
|
||||
`patch_id` int NOT NULL AUTO_INCREMENT COMMENT "Patch Auto Increment",
|
||||
`patch_name` varchar(1024) NOT NULL COMMENT "Patch Class Name",
|
||||
CONSTRAINT PRIMARY KEY (`patch_id`)
|
||||
) ENGINE=innodb DEFAULT CHARSET=utf8 DEFAULT COLLATE=utf8_general_ci COMMENT="List of data/schema patches"
|
||||
|
||||
'];
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
// @codingStandardsIgnoreFile
|
||||
return ['ALTER TABLE `reference_table` MODIFY COLUMN `tinyint_without_padding` tinyint NOT NULL , MODIFY COLUMN `bigint_default_nullable` bigint UNSIGNED NULL DEFAULT 123 , MODIFY COLUMN `bigint_not_default_not_nullable` bigint NOT NULL
|
||||
|
||||
ALTER TABLE `auto_increment_test` MODIFY COLUMN `int_auto_increment_with_nullable` int UNSIGNED NULL
|
||||
|
||||
ALTER TABLE `test_table` MODIFY COLUMN `float` float(12, 10) NULL DEFAULT 0 , MODIFY COLUMN `double` double(245, 10) NULL , MODIFY COLUMN `timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP , MODIFY COLUMN `varchar` varchar(100) NULL , MODIFY COLUMN `boolean` BOOLEAN NULL DEFAULT 1
|
||||
|
||||
'];
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
return [
|
||||
'table' => [
|
||||
'reference_table' => [
|
||||
'column' => [
|
||||
'tinyint_ref' => [
|
||||
'type' => 'tinyint',
|
||||
'name' => 'tinyint_ref',
|
||||
'default' => '0',
|
||||
'padding' => '7',
|
||||
'nullable' => 'true',
|
||||
'unsigned' => 'false',
|
||||
],
|
||||
],
|
||||
'name' => 'reference_table',
|
||||
'resource' => 'default',
|
||||
],
|
||||
'test_table' => [
|
||||
'column' => [
|
||||
'tinyint' => [
|
||||
'type' => 'tinyint',
|
||||
'name' => 'tinyint',
|
||||
'default' => '0',
|
||||
'padding' => '7',
|
||||
'nullable' => 'true',
|
||||
'unsigned' => 'false',
|
||||
],
|
||||
],
|
||||
'constraint' => [
|
||||
'TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF' => [
|
||||
'type' => 'foreign',
|
||||
'referenceId' => 'TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF',
|
||||
'column' => 'tinyint',
|
||||
'table' => 'test_table',
|
||||
'referenceTable' => 'reference_table',
|
||||
'referenceColumn' => 'tinyint_ref',
|
||||
],
|
||||
],
|
||||
'name' => 'test_table',
|
||||
'resource' => 'default',
|
||||
],
|
||||
],
|
||||
];
|
||||
+266
@@ -0,0 +1,266 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
return [
|
||||
'table' => [
|
||||
'reference_table' => [
|
||||
'column' => [
|
||||
'tinyint_ref' => [
|
||||
'type' => 'tinyint',
|
||||
'name' => 'tinyint_ref',
|
||||
'padding' => '7',
|
||||
'nullable' => 'false',
|
||||
'identity' => 'true',
|
||||
'unsigned' => 'false',
|
||||
],
|
||||
'tinyint_without_padding' => [
|
||||
'type' => 'tinyint',
|
||||
'name' => 'tinyint_without_padding',
|
||||
'default' => '0',
|
||||
'nullable' => 'false',
|
||||
'unsigned' => 'false',
|
||||
],
|
||||
'bigint_without_padding' => [
|
||||
'type' => 'bigint',
|
||||
'name' => 'bigint_without_padding',
|
||||
'default' => '0',
|
||||
'nullable' => 'false',
|
||||
'unsigned' => 'false',
|
||||
],
|
||||
'smallint_without_padding' => [
|
||||
'type' => 'smallint',
|
||||
'name' => 'smallint_without_padding',
|
||||
'default' => '0',
|
||||
'nullable' => 'false',
|
||||
'unsigned' => 'false',
|
||||
],
|
||||
'integer_without_padding' => [
|
||||
'type' => 'int',
|
||||
'name' => 'integer_without_padding',
|
||||
'default' => '0',
|
||||
'nullable' => 'false',
|
||||
'unsigned' => 'false',
|
||||
],
|
||||
'smallint_with_big_padding' => [
|
||||
'type' => 'smallint',
|
||||
'name' => 'smallint_with_big_padding',
|
||||
'padding' => '254',
|
||||
'default' => '0',
|
||||
'nullable' => 'false',
|
||||
'unsigned' => 'false',
|
||||
],
|
||||
'smallint_without_default' => [
|
||||
'type' => 'smallint',
|
||||
'name' => 'smallint_without_default',
|
||||
'padding' => '2',
|
||||
'nullable' => 'true',
|
||||
'unsigned' => 'false',
|
||||
],
|
||||
'int_without_unsigned' => [
|
||||
'type' => 'int',
|
||||
'name' => 'int_without_unsigned',
|
||||
'padding' => '2',
|
||||
'nullable' => 'true',
|
||||
],
|
||||
'int_unsigned' => [
|
||||
'type' => 'int',
|
||||
'name' => 'int_unsigned',
|
||||
'padding' => '2',
|
||||
'nullable' => 'true',
|
||||
'unsigned' => 'true',
|
||||
],
|
||||
'bigint_default_nullable' => [
|
||||
'type' => 'bigint',
|
||||
'name' => 'bigint_default_nullable',
|
||||
'padding' => '2',
|
||||
'nullable' => 'true',
|
||||
'default' => '1',
|
||||
'unsigned' => 'true',
|
||||
],
|
||||
'bigint_not_default_not_nullable' => [
|
||||
'type' => 'bigint',
|
||||
'name' => 'bigint_not_default_not_nullable',
|
||||
'padding' => '2',
|
||||
'nullable' => 'false',
|
||||
'unsigned' => 'true',
|
||||
],
|
||||
],
|
||||
'constraint' => [
|
||||
'tinyint_primary' => [
|
||||
'column' => [
|
||||
'tinyint_ref' => 'tinyint_ref',
|
||||
],
|
||||
'type' => 'primary',
|
||||
'referenceId' => 'tinyint_primary',
|
||||
],
|
||||
],
|
||||
'name' => 'reference_table',
|
||||
'resource' => 'default',
|
||||
],
|
||||
'auto_increment_test' => [
|
||||
'column' => [
|
||||
'int_auto_increment_with_nullable' => [
|
||||
'type' => 'int',
|
||||
'name' => 'int_auto_increment_with_nullable',
|
||||
'identity' => 'true',
|
||||
'padding' => '12',
|
||||
'unsigned' => 'true',
|
||||
'nullable' => 'true',
|
||||
],
|
||||
'int_disabled_auto_increment' => [
|
||||
'type' => 'smallint',
|
||||
'name' => 'int_disabled_auto_increment',
|
||||
'default' => '0',
|
||||
'identity' => 'false',
|
||||
'padding' => '12',
|
||||
'unsigned' => 'true',
|
||||
'nullable' => 'true',
|
||||
],
|
||||
],
|
||||
'constraint' => [
|
||||
'AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE' => [
|
||||
'column' => [
|
||||
'int_auto_increment_with_nullable' => 'int_auto_increment_with_nullable',
|
||||
],
|
||||
'type' => 'unique',
|
||||
'referenceId' => 'AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE',
|
||||
],
|
||||
],
|
||||
'name' => 'auto_increment_test',
|
||||
'resource' => 'default',
|
||||
],
|
||||
'test_table' => [
|
||||
'column' => [
|
||||
'smallint' => [
|
||||
'type' => 'smallint',
|
||||
'identity' => 'true',
|
||||
'name' => 'smallint',
|
||||
'padding' => '3',
|
||||
'nullable' => 'true',
|
||||
],
|
||||
'tinyint' => [
|
||||
'type' => 'tinyint',
|
||||
'name' => 'tinyint',
|
||||
'padding' => '7',
|
||||
'nullable' => 'true',
|
||||
'unsigned' => 'false',
|
||||
],
|
||||
'bigint' => [
|
||||
'type' => 'bigint',
|
||||
'name' => 'bigint',
|
||||
'default' => '0',
|
||||
'padding' => '13',
|
||||
'nullable' => 'true',
|
||||
'unsigned' => 'false',
|
||||
],
|
||||
'float' => [
|
||||
'type' => 'float',
|
||||
'name' => 'float',
|
||||
'default' => '0',
|
||||
'scale' => '4',
|
||||
'precision' => '12',
|
||||
],
|
||||
'double' => [
|
||||
'type' => 'decimal',
|
||||
'name' => 'double',
|
||||
'default' => '11111111.111111',
|
||||
'precision' => '14',
|
||||
'scale' => '6',
|
||||
],
|
||||
'decimal' => [
|
||||
'type' => 'decimal',
|
||||
'name' => 'decimal',
|
||||
'default' => '0',
|
||||
'scale' => '4',
|
||||
'precision' => '15',
|
||||
],
|
||||
'date' => [
|
||||
'type' => 'date',
|
||||
'name' => 'date',
|
||||
],
|
||||
'timestamp' => [
|
||||
'type' => 'timestamp',
|
||||
'name' => 'timestamp',
|
||||
'default' => 'CURRENT_TIMESTAMP',
|
||||
'on_update' => 'true',
|
||||
],
|
||||
'datetime' => [
|
||||
'type' => 'datetime',
|
||||
'name' => 'datetime',
|
||||
'default' => '0',
|
||||
],
|
||||
'longtext' => [
|
||||
'type' => 'longtext',
|
||||
'name' => 'longtext',
|
||||
],
|
||||
'mediumtext' => [
|
||||
'type' => 'mediumtext',
|
||||
'name' => 'mediumtext',
|
||||
],
|
||||
'char' => [
|
||||
'type' => 'char',
|
||||
'name' => 'char',
|
||||
'length' => '255',
|
||||
'nullable' => 'true',
|
||||
],
|
||||
'varchar' => [
|
||||
'type' => 'varchar',
|
||||
'name' => 'varchar',
|
||||
'length' => '254',
|
||||
'nullable' => 'true',
|
||||
],
|
||||
'mediumblob' => [
|
||||
'type' => 'mediumblob',
|
||||
'name' => 'mediumblob',
|
||||
],
|
||||
'blob' => [
|
||||
'type' => 'blob',
|
||||
'name' => 'blob',
|
||||
],
|
||||
'boolean' => [
|
||||
'type' => 'boolean',
|
||||
'name' => 'boolean',
|
||||
],
|
||||
'varbinary_rename' => [
|
||||
'type' => 'varbinary',
|
||||
'name' => 'varbinary_rename',
|
||||
'default' => '10101',
|
||||
'disabled' => 'true',
|
||||
],
|
||||
],
|
||||
'constraint' => [
|
||||
'TEST_TABLE_UNIQUE' => [
|
||||
'column' => [
|
||||
'smallint' => 'smallint',
|
||||
'bigint' => 'bigint',
|
||||
],
|
||||
'type' => 'unique',
|
||||
'referenceId' => 'TEST_TABLE_UNIQUE',
|
||||
],
|
||||
'TEST_TABLE_TINYINT_REFERENCE' => [
|
||||
'type' => 'foreign',
|
||||
'referenceId' => 'TEST_TABLE_TINYINT_REFERENCE',
|
||||
'column' => 'tinyint',
|
||||
'table' => 'test_table',
|
||||
'referenceTable' => 'reference_table',
|
||||
'referenceColumn' => 'tinyint_ref',
|
||||
'onDelete' => 'NO ACTION',
|
||||
],
|
||||
],
|
||||
'index' => [
|
||||
'TEST_TABLE_INDEX' => [
|
||||
'column' => [
|
||||
'tinyint' => 'tinyint',
|
||||
'bigint' => 'bigint',
|
||||
],
|
||||
'referenceId' => 'TEST_TABLE_INDEX',
|
||||
'indexType' => 'btree',
|
||||
],
|
||||
],
|
||||
'name' => 'test_table',
|
||||
'resource' => 'default',
|
||||
],
|
||||
],
|
||||
];
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
use Magento\Framework\Component\ComponentRegistrar;
|
||||
|
||||
$registrar = new ComponentRegistrar();
|
||||
if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestSetupDeclarationModule1') === null) {
|
||||
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestSetupDeclarationModule1', __DIR__);
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="store">
|
||||
<column name="store_owner" xsi:type="varchar" length="255" comment="Store Owner Name" />
|
||||
</table>
|
||||
</schema>
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Magento\TestSetupDeclarationModule1\Setup;
|
||||
|
||||
use Magento\Framework\Setup\InstallSchemaInterface;
|
||||
use Magento\Framework\Setup\ModuleContextInterface;
|
||||
use Magento\Framework\Setup\SchemaSetupInterface;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class InstallSchema implements InstallSchemaInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
*/
|
||||
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
|
||||
{
|
||||
$installer = $setup;
|
||||
|
||||
$installer->startSetup();
|
||||
|
||||
//Create first table
|
||||
$table = $installer->getConnection()
|
||||
->newTable($installer->getTable('reference_table'))
|
||||
->addColumn(
|
||||
'smallint_ref',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
|
||||
3,
|
||||
['primary' => true, 'identity' => true, 'nullable' => false],
|
||||
'Smallint'
|
||||
)
|
||||
->setComment('Reference table');
|
||||
$installer->getConnection()->createTable($table);
|
||||
|
||||
$testTable = $installer->getConnection()->newTable($installer->getTable('test_table'))
|
||||
->addColumn(
|
||||
'smallint',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
|
||||
2,
|
||||
['nullable' => true, 'default' => 0],
|
||||
'Smallint'
|
||||
)
|
||||
->addColumn(
|
||||
'bigint',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_BIGINT,
|
||||
10,
|
||||
['nullable' => true, 'unsigned' => false, 'default' => 0],
|
||||
'Bigint'
|
||||
)
|
||||
->addColumn(
|
||||
'float',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_FLOAT,
|
||||
null,
|
||||
['default' => 0],
|
||||
'Float'
|
||||
)
|
||||
->addColumn(
|
||||
'date',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_DATE,
|
||||
null,
|
||||
[],
|
||||
'Date'
|
||||
)
|
||||
->addColumn(
|
||||
'timestamp',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
|
||||
null,
|
||||
['default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE],
|
||||
'Timestamp'
|
||||
)
|
||||
->addColumn(
|
||||
'mediumtext',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
|
||||
11222222,
|
||||
[],
|
||||
'Mediumtext'
|
||||
)
|
||||
->addColumn(
|
||||
'varchar',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
|
||||
254,
|
||||
['nullable' => true],
|
||||
'Varchar'
|
||||
)
|
||||
->addColumn(
|
||||
'boolean',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN,
|
||||
1,
|
||||
[],
|
||||
'Boolean'
|
||||
)
|
||||
->addIndex(
|
||||
$installer->getIdxName('test_table', ['smallint', 'bigint']),
|
||||
['smallint', 'bigint'],
|
||||
['type' => \Magento\Framework\DB\Adapter\Pdo\Mysql::INDEX_TYPE_UNIQUE]
|
||||
)
|
||||
->addIndex(
|
||||
$installer->getIdxName('test_table', ['bigint']),
|
||||
['bigint']
|
||||
)
|
||||
->addForeignKey(
|
||||
$installer->getFkName(
|
||||
$installer->getTable('test_table'),
|
||||
'smallint',
|
||||
'reference_table',
|
||||
'smallint_ref'
|
||||
),
|
||||
'smallint',
|
||||
$installer->getTable('reference_table'),
|
||||
'smallint_ref',
|
||||
\Magento\Framework\DB\Ddl\Table::ACTION_CASCADE
|
||||
)
|
||||
->setComment('Test Table');
|
||||
$installer->getConnection()->createTable($testTable);
|
||||
|
||||
$installer->endSetup();
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="reference_table" resource="default" comment="Reference table">
|
||||
<column xsi:type="smallint" name="smallint_ref" padding="6" nullable="false" unsigned="false" identity="true" comment="Smallint"/>
|
||||
<constraint xsi:type="primary" referenceId="tinyint_primary">
|
||||
<column name="smallint_ref"/>
|
||||
</constraint>
|
||||
</table>
|
||||
<table name="test_table" resource="default" comment="Test Table">
|
||||
<column xsi:type="smallint" name="smallint" default="0" padding="6" nullable="true" unsigned="false" comment="Smallint"/>
|
||||
<column xsi:type="bigint" name="bigint" default="0" padding="20" nullable="true" unsigned="false" comment="Bigint"/>
|
||||
<column xsi:type="float" name="float" default="0" scale="0" precision="10" comment="Float"/>
|
||||
<column xsi:type="date" name="date" comment="Date"/>
|
||||
<column xsi:type="timestamp" name="timestamp" default="CURRENT_TIMESTAMP" on_update="true" comment="Timestamp"/>
|
||||
<column xsi:type="mediumtext" name="mediumtext" comment="Mediumtext"/>
|
||||
<column xsi:type="varchar" name="varchar" length="254" nullable="true" comment="Varchar"/>
|
||||
<column xsi:type="boolean" name="boolean" comment="Boolean"/>
|
||||
<constraint xsi:type="unique" referenceId="TEST_TABLE_SMALLINT_BIGINT">
|
||||
<column name="smallint"/>
|
||||
<column name="bigint"/>
|
||||
</constraint>
|
||||
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
|
||||
column="smallint" table="test_table"
|
||||
referenceTable="reference_table" referenceColumn="smallint_ref" onDelete="CASCADE"/>
|
||||
<index referenceId="TEST_TABLE_BIGINT" indexType="btree">
|
||||
<column name="bigint"/>
|
||||
</index>
|
||||
</table>
|
||||
</schema>
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="store">
|
||||
<column name="store_owner_id" xsi:type="smallint" nullable="true" comment="Store Owner Reference" />
|
||||
<constraint xsi:type="foreign"
|
||||
name="STORE_STORE_OWNER_ID_STORE_OWNER_OWNER_ID"
|
||||
column="store_owner_id"
|
||||
table="store"
|
||||
referenceTable="store_owner"
|
||||
referenceColumn="owner_id"
|
||||
onDelete="SET NULL" />
|
||||
</table>
|
||||
<table name="store_owner" comment="Store owner information" engine="innodb" resource="default">
|
||||
<column name="owner_id" xsi:type="smallint" nullable="false" unsigned="false" identity="true" />
|
||||
<column name="store_owner_name" onCreate="migrateDataFrom(label)" xsi:type="varchar" length="255" comment="Store Owner Name" />
|
||||
<constraint xsi:type="primary" referenceId="PRIMARY">
|
||||
<column name="owner_id" />
|
||||
</constraint>
|
||||
</table>
|
||||
</schema>
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="reference_table" resource="default">
|
||||
<column xsi:type="tinyint" name="tinyint_ref" padding="7" nullable="false" identity="true" unsigned="false"/>
|
||||
<column xsi:type="tinyint" name="tinyint_without_padding" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="bigint" name="bigint_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="smallint" name="smallint_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="int" name="integer_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="smallint" name="smallint_with_big_padding" padding="254" default="0" nullable="false"
|
||||
unsigned="false"/>
|
||||
<column xsi:type="smallint" name="smallint_without_default" padding="2" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="int" name="int_without_unsigned" padding="2" nullable="true"/>
|
||||
<column xsi:type="int" name="int_unsigned" padding="2" nullable="true" unsigned="true"/>
|
||||
<column xsi:type="bigint" name="bigint_default_nullable" padding="2" nullable="true" default="123"
|
||||
unsigned="true"/>
|
||||
<column xsi:type="bigint" name="bigint_not_default_not_nullable" nullable="false" unsigned="false"/>
|
||||
<constraint xsi:type="primary" referenceId="tinyint_primary">
|
||||
<column name="tinyint_ref"/>
|
||||
</constraint>
|
||||
</table>
|
||||
<table name="auto_increment_test" resource="default">
|
||||
<column xsi:type="int" name="int_auto_increment_with_nullable" padding="15" unsigned="true" nullable="true"/>
|
||||
<column xsi:type="smallint" name="int_disabled_auto_increment" default="0" identity="false" padding="12"
|
||||
unsigned="true" nullable="true"/>
|
||||
<constraint xsi:type="unique" referenceId="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
|
||||
<column name="int_auto_increment_with_nullable"/>
|
||||
</constraint>
|
||||
</table>
|
||||
<table name="test_table" resource="default">
|
||||
<!--Columns-->
|
||||
<column xsi:type="smallint" identity="true" name="smallint" padding="3" nullable="true"/>
|
||||
<column xsi:type="tinyint" name="tinyint" padding="7" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="bigint" name="bigint" default="0" padding="13" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="float" name="float" default="0" precision="12" scale="10"/>
|
||||
<column xsi:type="double" name="double" precision="245" scale="10"/>
|
||||
<column xsi:type="decimal" name="decimal" default="0" scale="4" precision="15"/>
|
||||
<column xsi:type="date" name="date"/>
|
||||
<column xsi:type="timestamp" name="timestamp" default="CURRENT_TIMESTAMP" on_update="false"/>
|
||||
<column xsi:type="datetime" name="datetime" default="0"/>
|
||||
<column xsi:type="longtext" name="longtext"/>
|
||||
<column xsi:type="mediumtext" name="mediumtext"/>
|
||||
<column xsi:type="varchar" name="varchar" length="100" nullable="true"/>
|
||||
<column xsi:type="mediumblob" name="mediumblob"/>
|
||||
<column xsi:type="blob" name="blob"/>
|
||||
<column xsi:type="boolean" name="boolean" default="true"/>
|
||||
<column xsi:type="varbinary" name="varbinary_rename" default="10101" disabled="true"/>
|
||||
<!--Constraints-->
|
||||
<constraint xsi:type="unique" referenceId="TEST_TABLE_SMALLINT_BIGINT">
|
||||
<column name="smallint"/>
|
||||
<column name="bigint"/>
|
||||
</constraint>
|
||||
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
|
||||
column="tinyint" table="test_table"
|
||||
referenceTable="reference_table" referenceColumn="tinyint_ref" onDelete="NO ACTION"/>
|
||||
<!--Indexes-->
|
||||
<index referenceId="TEST_TABLE_TINYINT_BIGINT" indexType="btree">
|
||||
<column name="tinyint"/>
|
||||
<column name="bigint"/>
|
||||
</index>
|
||||
</table>
|
||||
</schema>
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="reference_table" resource="default">
|
||||
<column xsi:type="tinyint" name="tinyint_ref" padding="7" nullable="false" identity="true" unsigned="false"/>
|
||||
<column xsi:type="tinyint" name="tinyint_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="bigint" name="bigint_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="int" name="integer_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="smallint" name="smallint_with_big_padding" padding="254" default="0" nullable="false"
|
||||
unsigned="false"/>
|
||||
<column xsi:type="smallint" name="smallint_without_default" padding="2" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="int" name="int_without_unsigned" padding="2" nullable="true"/>
|
||||
<column xsi:type="int" name="int_unsigned" padding="2" nullable="true" unsigned="true"/>
|
||||
<column xsi:type="bigint" name="bigint_default_nullable" padding="2" nullable="true" default="1"
|
||||
unsigned="true"/>
|
||||
<column xsi:type="bigint" name="bigint_not_default_not_nullable" padding="2" nullable="false" unsigned="true"/>
|
||||
<constraint xsi:type="primary" referenceId="tinyint_primary">
|
||||
<column name="tinyint_ref"/>
|
||||
</constraint>
|
||||
</table>
|
||||
<table name="auto_increment_test" resource="default">
|
||||
<column xsi:type="int" name="int_auto_increment_with_nullable" identity="true" padding="12" unsigned="true"
|
||||
nullable="true"/>
|
||||
<constraint xsi:type="unique" referenceId="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
|
||||
<column name="int_auto_increment_with_nullable"/>
|
||||
</constraint>
|
||||
</table>
|
||||
<table name="test_table" resource="default">
|
||||
<!--Columns-->
|
||||
<column xsi:type="smallint" identity="true" name="smallint" padding="3" nullable="true"/>
|
||||
<column xsi:type="tinyint" name="tinyint" padding="7" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="bigint" name="bigint" default="0" padding="13" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="float" name="float" default="0" scale="10" precision="12"/>
|
||||
<column xsi:type="double" name="double" default="11111111.111111" precision="245" scale="10"/>
|
||||
<column xsi:type="decimal" name="decimal" default="0" scale="4" precision="15"/>
|
||||
<column xsi:type="date" name="date"/>
|
||||
<column xsi:type="timestamp" name="timestamp" default="CURRENT_TIMESTAMP" on_update="true"/>
|
||||
<column xsi:type="datetime" name="datetime" default="0"/>
|
||||
<column xsi:type="longtext" name="longtext"/>
|
||||
<column xsi:type="mediumtext" name="mediumtext"/>
|
||||
<column xsi:type="varchar" name="varchar" length="254" nullable="true"/>
|
||||
<column xsi:type="mediumblob" name="mediumblob" disabled="true"/>
|
||||
<column xsi:type="blob" name="blob"/>
|
||||
<column xsi:type="boolean" name="boolean"/>
|
||||
<column xsi:type="varbinary" name="varbinary_rename" default="10101" disabled="false"/>
|
||||
<!--Constraints-->
|
||||
<constraint xsi:type="unique" referenceId="TEST_TABLE_SMALLINT_BIGINT">
|
||||
<column name="smallint"/>
|
||||
<column name="bigint"/>
|
||||
</constraint>
|
||||
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
|
||||
column="tinyint" table="test_table"
|
||||
referenceTable="reference_table" referenceColumn="tinyint_ref" onDelete="NO ACTION"/>
|
||||
<!--Indexes-->
|
||||
<index referenceId="TEST_TABLE_TINYINT_BIGINT" indexType="btree">
|
||||
<column name="tinyint"/>
|
||||
<column name="bigint"/>
|
||||
</index>
|
||||
</table>
|
||||
</schema>
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"reference_table": {
|
||||
"column": {
|
||||
"tinyint_ref": true,
|
||||
"tinyint_without_padding": true,
|
||||
"bigint_without_padding": true,
|
||||
"integer_without_padding": true,
|
||||
"smallint_with_big_padding": true,
|
||||
"smallint_without_default": true,
|
||||
"int_without_unsigned": true,
|
||||
"int_unsigned": true,
|
||||
"bigint_default_nullable": true,
|
||||
"bigint_not_default_not_nullable": true,
|
||||
"smallint_without_padding": true
|
||||
},
|
||||
"constraint": {
|
||||
"tinyint_primary": true
|
||||
}
|
||||
},
|
||||
"auto_increment_test": {
|
||||
"column": {
|
||||
"int_auto_increment_with_nullable": true,
|
||||
"int_disabled_auto_increment": true
|
||||
},
|
||||
"constraint": {
|
||||
"AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE": true
|
||||
}
|
||||
},
|
||||
"test_table": {
|
||||
"column": {
|
||||
"smallint": true,
|
||||
"tinyint": true,
|
||||
"bigint": true,
|
||||
"float": true,
|
||||
"double": true,
|
||||
"decimal": true,
|
||||
"date": true,
|
||||
"timestamp": true,
|
||||
"datetime": true,
|
||||
"longtext": true,
|
||||
"mediumtext": true,
|
||||
"varchar": true,
|
||||
"mediumblob": true,
|
||||
"blob": true,
|
||||
"boolean": true,
|
||||
"varbinary_rename": true
|
||||
},
|
||||
"index": {
|
||||
"TEST_TABLE_TINYINT_BIGINT": true
|
||||
},
|
||||
"constraint": {
|
||||
"TEST_TABLE_SMALLINT_BIGINT": true,
|
||||
"TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF": true
|
||||
}
|
||||
}
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="reference_table" resource="default">
|
||||
<column xsi:type="tinyint" name="tinyint_ref" padding="7" nullable="false" identity="true" unsigned="false"/>
|
||||
<column xsi:type="tinyint" name="tinyint_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="bigint" name="bigint_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="smallint" name="smallint_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="int" name="integer_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="smallint" name="smallint_with_big_padding" padding="254" default="0" nullable="false"
|
||||
unsigned="false"/>
|
||||
<column xsi:type="smallint" name="smallint_ref" padding="254" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="smallint" name="smallint_without_default" padding="2" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="int" name="int_without_unsigned" padding="2" nullable="true"/>
|
||||
<column xsi:type="int" name="int_unsigned" padding="2" nullable="true" unsigned="true"/>
|
||||
<column xsi:type="bigint" name="bigint_default_nullable" padding="2" nullable="true" default="1"
|
||||
unsigned="true"/>
|
||||
<column xsi:type="bigint" name="bigint_not_default_not_nullable" padding="2" nullable="false" unsigned="true"/>
|
||||
<constraint xsi:type="primary" referenceId="tinyint_primary">
|
||||
<column name="tinyint_ref"/>
|
||||
<column name="smallint_ref"/>
|
||||
</constraint>
|
||||
<constraint xsi:type="unique" referenceId="REFERENCE_TABLE_SMALLINT_REF">
|
||||
<column name="smallint_ref"/>
|
||||
</constraint>
|
||||
</table>
|
||||
<table name="auto_increment_test" resource="default">
|
||||
<column xsi:type="int" name="int_auto_increment_with_nullable" identity="true" padding="12" unsigned="true"
|
||||
nullable="true"/>
|
||||
<column xsi:type="smallint" name="int_disabled_auto_increment" default="0" identity="false" padding="12"
|
||||
unsigned="true" nullable="true"/>
|
||||
<constraint xsi:type="unique" referenceId="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
|
||||
<column name="int_auto_increment_with_nullable"/>
|
||||
</constraint>
|
||||
</table>
|
||||
<table name="test_table" resource="default">
|
||||
<!--Columns-->
|
||||
<column xsi:type="int" name="integer_main" padding="12" unsigned="true" nullable="true"/>
|
||||
<column xsi:type="smallint" name="smallint" padding="3" nullable="true"/>
|
||||
<column xsi:type="tinyint" name="tinyint" padding="7" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="bigint" name="bigint" default="0" padding="13" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="float" name="float" default="0" scale="10" precision="12"/>
|
||||
<column xsi:type="smallint" name="smallint_main" padding="254" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="double" name="double" default="11111111.111111" precision="245" scale="10"/>
|
||||
<column xsi:type="decimal" name="decimal" default="0" scale="4" precision="15"/>
|
||||
<column xsi:type="date" name="date"/>
|
||||
<column xsi:type="timestamp" name="timestamp" default="CURRENT_TIMESTAMP" on_update="true"/>
|
||||
<column xsi:type="datetime" name="datetime" default="0"/>
|
||||
<column xsi:type="longtext" name="longtext"/>
|
||||
<column xsi:type="mediumtext" name="mediumtext"/>
|
||||
<column xsi:type="varchar" name="varchar" length="254" nullable="true"/>
|
||||
<column xsi:type="mediumblob" name="mediumblob"/>
|
||||
<column xsi:type="blob" name="blob"/>
|
||||
<column xsi:type="boolean" name="boolean"/>
|
||||
<column xsi:type="varbinary" name="varbinary_rename" default="10101" disabled="true"/>
|
||||
<!--Constraints-->
|
||||
<constraint xsi:type="unique" referenceId="TEST_TABLE_SMALLINT_FLOAT">
|
||||
<column name="smallint"/>
|
||||
<column name="float"/>
|
||||
</constraint>
|
||||
<constraint xsi:type="unique" referenceId="TEST_TABLE_DOUBLE">
|
||||
<column name="double"/>
|
||||
</constraint>
|
||||
<constraint xsi:type="foreign" referenceId="some_foreign_key_new" column="smallint_main" table="test_table"
|
||||
referenceTable="reference_table" referenceColumn="smallint_ref" onDelete="CASCADE"/>
|
||||
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
|
||||
column="tinyint" table="test_table"
|
||||
referenceTable="reference_table" referenceColumn="tinyint_ref" onDelete="SET NULL"/>
|
||||
<constraint xsi:type="foreign" referenceId="FK_FB77604C299EB8612D01E4AF8D9931F2"
|
||||
column="integer_main" table="test_table"
|
||||
referenceTable="auto_increment_test" referenceColumn="int_auto_increment_with_nullable"/>
|
||||
<!--Indexes-->
|
||||
<index referenceId="TEST_TABLE_TINYINT_BIGINT" indexType="btree">
|
||||
<column name="tinyint"/>
|
||||
<column name="bigint"/>
|
||||
</index>
|
||||
</table>
|
||||
</schema>
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"reference_table": {
|
||||
"column": {
|
||||
"tinyint_ref": true,
|
||||
"tinyint_without_padding": true,
|
||||
"bigint_without_padding": true,
|
||||
"integer_without_padding": true,
|
||||
"smallint_with_big_padding": true,
|
||||
"smallint_without_default": true,
|
||||
"int_without_unsigned": true,
|
||||
"int_unsigned": true,
|
||||
"bigint_default_nullable": true,
|
||||
"bigint_not_default_not_nullable": true,
|
||||
"smallint_without_padding": true
|
||||
},
|
||||
"constraint": {
|
||||
"PRIMARY": true
|
||||
}
|
||||
},
|
||||
"auto_increment_test": {
|
||||
"column": {
|
||||
"int_auto_increment_with_nullable": true,
|
||||
"int_disabled_auto_increment": true
|
||||
},
|
||||
"constraint": {
|
||||
"AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE": true
|
||||
}
|
||||
},
|
||||
"test_table": {
|
||||
"column": {
|
||||
"smallint": true,
|
||||
"tinyint": true,
|
||||
"bigint": true,
|
||||
"float": true,
|
||||
"double": true,
|
||||
"decimal": true,
|
||||
"date": true,
|
||||
"timestamp": true,
|
||||
"datetime": true,
|
||||
"longtext": true,
|
||||
"mediumtext": true,
|
||||
"varchar": true,
|
||||
"mediumblob": true,
|
||||
"blob": true,
|
||||
"boolean": true,
|
||||
"varbinary_rename": true
|
||||
},
|
||||
"index": {
|
||||
"TEST_TABLE_TINYINT_BIGINT": true
|
||||
},
|
||||
"constraint": {
|
||||
"TEST_TABLE_SMALLINT_BIGINT": true,
|
||||
"TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF": true
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="auto_increment_test" resource="default">
|
||||
<column xsi:type="int" name="int_auto_increment_with_nullable" identity="true" padding="12" unsigned="true"
|
||||
nullable="true"/>
|
||||
<column xsi:type="smallint" name="int_disabled_auto_increment" default="0" identity="false" padding="12"
|
||||
unsigned="true" nullable="true"/>
|
||||
<constraint xsi:type="unique" referenceId="AUTO_INCREMENT_TEST_INT_AUTO_INCREMENT_WITH_NULLABLE">
|
||||
<column name="int_auto_increment_with_nullable"/>
|
||||
</constraint>
|
||||
</table>
|
||||
</schema>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
|
||||
<module name="Magento_TestSetupDeclarationModule1" />
|
||||
</config>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="test_table" resource="default">
|
||||
<!--Columns-->
|
||||
<column xsi:type="smallint" name="smallint" default="0" scale="1" padding="3"/>
|
||||
</table>
|
||||
</schema>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="test_table" resource="default">
|
||||
<!--Columns-->
|
||||
<column xsi:type="smallint" name="smallint" default="0" padding="3"/>
|
||||
</table>
|
||||
</schema>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="reference_table" resource="default">
|
||||
<column xsi:type="tinyint" name="tinyint_ref" default="0" padding="7" nullable="true" unsigned="false"/>
|
||||
</table>
|
||||
<table name="test_table" resource="default">
|
||||
<column xsi:type="tinyint" name="tinyint" default="0" padding="7" nullable="true" unsigned="false"/>
|
||||
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
|
||||
column="tinyint" table="test_table"
|
||||
referenceTable="reference_table" referenceColumn="tinyint_ref"/>
|
||||
</table>
|
||||
</schema>
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="test_table" resource="default">
|
||||
<!--Columns-->
|
||||
<column xsi:type="smallint" identity="true" name="smallint" padding="3" nullable="true"/>
|
||||
<column xsi:type="tinyint" name="tinyint" padding="7" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="bigint" name="bigint" default="0" padding="13" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="varchar" name="varchar" length="254" nullable="true"/>
|
||||
<!--Constraints-->
|
||||
<constraint xsi:type="unique" referenceId="TEST_TABLE_UNIQUE">
|
||||
<column name="smallint"/>
|
||||
<column name="bigint"/>
|
||||
</constraint>
|
||||
<!--Indexes-->
|
||||
<index referenceId="TEST_TABLE_INDEX" indexType="btree">
|
||||
<column name="tinyint"/>
|
||||
<column name="bigint"/>
|
||||
</index>
|
||||
<index referenceId="TEST_TABLE_INDEX_VARCHAR" indexType="btree">
|
||||
<column name="varchar"/>
|
||||
</index>
|
||||
</table>
|
||||
</schema>
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
namespace Magento\TestSetupDeclarationModule1\Setup;
|
||||
|
||||
use Magento\Framework\Setup\InstallSchemaInterface;
|
||||
use Magento\Framework\Setup\ModuleContextInterface;
|
||||
use Magento\Framework\Setup\SchemaSetupInterface;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class InstallSchema implements InstallSchemaInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
*/
|
||||
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
|
||||
{
|
||||
$installer = $setup;
|
||||
|
||||
$installer->startSetup();
|
||||
|
||||
//Create first table
|
||||
$table = $installer->getConnection()
|
||||
->newTable($installer->getTable('reference_table'))
|
||||
->addColumn(
|
||||
'smallint_ref',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
|
||||
3,
|
||||
['primary' => true, 'identity' => true, 'nullable' => false],
|
||||
'Smallint'
|
||||
)
|
||||
->setComment('Reference table');
|
||||
$installer->getConnection()->createTable($table);
|
||||
|
||||
$testTable = $installer->getConnection()->newTable('test_table')
|
||||
->addColumn(
|
||||
'smallint',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
|
||||
2,
|
||||
['nullable' => true, 'default' => 0],
|
||||
'Smallint'
|
||||
)
|
||||
->addColumn(
|
||||
'bigint',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_BIGINT,
|
||||
10,
|
||||
['nullable' => true, 'unsigned' => false, 'default' => 0],
|
||||
'Bigint'
|
||||
)
|
||||
->addColumn(
|
||||
'float',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_FLOAT,
|
||||
null,
|
||||
['default' => 0],
|
||||
'Float'
|
||||
)
|
||||
->addColumn(
|
||||
'date',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_DATE,
|
||||
null,
|
||||
[],
|
||||
'Date'
|
||||
)
|
||||
->addColumn(
|
||||
'timestamp',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
|
||||
null,
|
||||
['default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE],
|
||||
'Timestamp'
|
||||
)
|
||||
->addColumn(
|
||||
'mediumtext',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
|
||||
11222222,
|
||||
[],
|
||||
'Mediumtext'
|
||||
)
|
||||
->addColumn(
|
||||
'varchar',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
|
||||
254,
|
||||
['nullable' => true],
|
||||
'Varchar'
|
||||
)
|
||||
->addColumn(
|
||||
'boolean',
|
||||
\Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN,
|
||||
1,
|
||||
[],
|
||||
'Boolean'
|
||||
)
|
||||
->addIndex(
|
||||
$installer->getIdxName($installer->getTable('test_table'), ['smallint', 'bigint']),
|
||||
['smallint', 'bigint'],
|
||||
['type' => \Magento\Framework\DB\Adapter\Pdo\Mysql::INDEX_TYPE_UNIQUE]
|
||||
)
|
||||
->addIndex(
|
||||
$installer->getIdxName($installer->getTable('test_table'), ['bigint']),
|
||||
['bigint']
|
||||
)
|
||||
->addForeignKey(
|
||||
$installer->getFkName(
|
||||
$installer->getTable('test_table'),
|
||||
'smallint',
|
||||
$installer->getTable('reference_table'),
|
||||
'smallint_ref'
|
||||
),
|
||||
'smallint',
|
||||
$installer->getTable('reference_table'),
|
||||
'smallint_ref',
|
||||
\Magento\Framework\DB\Ddl\Table::ACTION_CASCADE
|
||||
)
|
||||
->setComment('Test Table');
|
||||
$installer->getConnection()->createTable($testTable);
|
||||
|
||||
$installer->endSetup();
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="reference_table" resource="default" comment="Reference table">
|
||||
<column xsi:type="smallint" name="smallint_ref" padding="6" nullable="false" unsigned="false" identity="true" comment="Smallint"/>
|
||||
<constraint xsi:type="primary" referenceId="tinyint_primary">
|
||||
<column name="smallint_ref"/>
|
||||
</constraint>
|
||||
</table>
|
||||
<table name="test_table" resource="default" comment="Test Table">
|
||||
<column xsi:type="smallint" name="smallint" default="0" padding="6" nullable="true" unsigned="false" comment="Smallint"/>
|
||||
<column xsi:type="bigint" name="bigint" default="1" padding="20" nullable="true" unsigned="false" comment="Bigint"/>
|
||||
<column xsi:type="float" name="float" default="0" scale="0" precision="10" comment="Float"/>
|
||||
<column xsi:type="date" name="date" comment="Date"/>
|
||||
<column xsi:type="timestamp" name="timestamp" default="CURRENT_TIMESTAMP" on_update="true" comment="Timestamp"/>
|
||||
<column xsi:type="mediumtext" name="mediumtext" comment="Mediumtext"/>
|
||||
<column xsi:type="varchar" name="varchar" length="254" nullable="true" comment="Varchar"/>
|
||||
<column xsi:type="boolean" name="boolean" comment="Boolean"/>
|
||||
<constraint xsi:type="unique" referenceId="TEST_TABLE_SMALLINT_BIGINT">
|
||||
<column name="smallint"/>
|
||||
<column name="bigint"/>
|
||||
</constraint>
|
||||
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF"
|
||||
column="smallint" table="test_table"
|
||||
referenceTable="reference_table" referenceColumn="smallint_ref" onDelete="CASCADE"/>
|
||||
<index referenceId="TEST_TABLE_BIGINT" indexType="btree">
|
||||
<column name="bigint"/>
|
||||
</index>
|
||||
</table>
|
||||
</schema>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
</schema>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="some_table">
|
||||
<column name="some_column" xsi:type="varchar" length="255" comment="Some Column Name" />
|
||||
</table>
|
||||
</schema>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="some_table_renamed" onCreate="migrateDataFromAnotherTable(some_table)">
|
||||
<column name="some_column" xsi:type="varchar" length="255" comment="Some Column Name" />
|
||||
</table>
|
||||
</schema>
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="reference_table" resource="default">
|
||||
<column xsi:type="tinyint" name="tinyint_ref" padding="7" nullable="false" identity="true" unsigned="false"/>
|
||||
<column xsi:type="tinyint" name="tinyint_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="bigint" name="bigint_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="smallint" name="smallint_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="int" name="integer_without_padding" default="0" nullable="false" unsigned="false"/>
|
||||
<column xsi:type="smallint" name="smallint_with_big_padding" padding="254" default="0" nullable="false"
|
||||
unsigned="false"/>
|
||||
<column xsi:type="smallint" name="smallint_without_default" padding="2" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="int" name="int_without_unsigned" padding="2" nullable="true"/>
|
||||
<column xsi:type="int" name="int_unsigned" padding="2" nullable="true" unsigned="true"/>
|
||||
<column xsi:type="bigint" name="bigint_default_nullable" padding="2" nullable="true" default="1"
|
||||
unsigned="true"/>
|
||||
<column xsi:type="bigint" name="bigint_not_default_not_nullable" padding="2" nullable="false" unsigned="true"/>
|
||||
<constraint xsi:type="primary" referenceId="tinyint_primary">
|
||||
<column name="tinyint_ref"/>
|
||||
</constraint>
|
||||
</table>
|
||||
<table name="test_table" resource="default">
|
||||
<!--Columns-->
|
||||
<column xsi:type="smallint" identity="true" name="smallint" padding="3" nullable="true"/>
|
||||
<column xsi:type="tinyint" name="tinyint" padding="7" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="bigint" name="bigint" default="0" padding="13" nullable="true" unsigned="false"/>
|
||||
<column xsi:type="float" name="float" default="0" scale="4" precision="12"/>
|
||||
<column xsi:type="decimal" name="double" default="11111111.111111" precision="14" scale="6"/>
|
||||
<column xsi:type="decimal" name="decimal" default="0" scale="4" precision="15"/>
|
||||
<column xsi:type="date" name="date"/>
|
||||
<column xsi:type="timestamp" name="timestamp" default="CURRENT_TIMESTAMP" on_update="true"/>
|
||||
<column xsi:type="datetime" name="datetime" default="0"/>
|
||||
<column xsi:type="longtext" name="longtext"/>
|
||||
<column xsi:type="mediumtext" name="mediumtext"/>
|
||||
<column xsi:type="varchar" name="varchar" length="254" nullable="true"/>
|
||||
<column xsi:type="mediumblob" name="mediumblob"/>
|
||||
<column xsi:type="blob" name="blob"/>
|
||||
<column xsi:type="boolean" name="boolean"/>
|
||||
<column xsi:type="varbinary" name="varbinary_rename" default="10101" disabled="true"/>
|
||||
<!--Constraints-->
|
||||
<constraint xsi:type="unique" referenceId="TEST_TABLE_UNIQUE">
|
||||
<column name="smallint"/>
|
||||
<column name="bigint"/>
|
||||
</constraint>
|
||||
<constraint xsi:type="foreign" referenceId="TEST_TABLE_TINYINT_REFERENCE"
|
||||
column="tinyint" table="test_table"
|
||||
referenceTable="reference_table" referenceColumn="tinyint_ref" onDelete="NO ACTION"/>
|
||||
<!--Indexes-->
|
||||
<index referenceId="TEST_TABLE_INDEX" indexType="btree">
|
||||
<column name="tinyint"/>
|
||||
<column name="bigint"/>
|
||||
</index>
|
||||
</table>
|
||||
</schema>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
|
||||
<module name="Magento_TestSetupDeclarationModule1"/>
|
||||
</config>
|
||||
Reference in New Issue
Block a user