Skip to content

Commit dc4bb0e

Browse files
author
Sergii Kovalenko
committed
MAGETWO-85326: Tool for generating schema
--stabilize CE
1 parent 4a8e192 commit dc4bb0e

File tree

34 files changed

+1272
-909
lines changed

34 files changed

+1272
-909
lines changed

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

Lines changed: 257 additions & 272 deletions
Large diffs are not rendered by default.

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

Lines changed: 114 additions & 74 deletions
Large diffs are not rendered by default.

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
default="0"/>
2121
<column xsi:type="decimal" name="qty" scale="12" precission="4" unsigned="false" nullable="true"/>
2222
<column xsi:type="decimal" name="min_qty" scale="12" precission="4" unsigned="false" nullable="false"
23-
default="0.0000"/>
23+
default="0"/>
2424
<column xsi:type="smallint" name="use_config_min_qty" padding="6" unsigned="true" nullable="false"
2525
identity="false" default="1"/>
2626
<column xsi:type="smallint" name="is_qty_decimal" padding="6" unsigned="true" nullable="false" identity="false"
@@ -30,17 +30,18 @@
3030
<column xsi:type="smallint" name="use_config_backorders" padding="6" unsigned="true" nullable="false"
3131
identity="false" default="1"/>
3232
<column xsi:type="decimal" name="min_sale_qty" scale="12" precission="4" unsigned="false" nullable="false"
33-
default="1.0000"/>
33+
default="1"/>
3434
<column xsi:type="smallint" name="use_config_min_sale_qty" padding="6" unsigned="true" nullable="false"
3535
identity="false" default="1"/>
3636
<column xsi:type="decimal" name="max_sale_qty" scale="12" precission="4" unsigned="false" nullable="false"
37-
default="0.0000"/>
37+
default="0"/>
3838
<column xsi:type="smallint" name="use_config_max_sale_qty" padding="6" unsigned="true" nullable="false"
3939
identity="false" default="1"/>
4040
<column xsi:type="smallint" name="is_in_stock" padding="6" unsigned="true" nullable="false" identity="false"
4141
default="0"/>
4242
<column xsi:type="timestamp" name="low_stock_date" on_update="false" nullable="true"/>
43-
<column xsi:type="decimal" name="notify_stock_qty" scale="12" precission="4" unsigned="false" nullable="true"/>
43+
<column xsi:type="decimal" name="notify_stock_qty" scale="12" precission="4" unsigned="false" nullable="true"
44+
default="0"/>
4445
<column xsi:type="smallint" name="use_config_notify_stock_qty" padding="6" unsigned="true" nullable="false"
4546
identity="false" default="1"/>
4647
<column xsi:type="smallint" name="manage_stock" padding="6" unsigned="true" nullable="false" identity="false"
@@ -52,7 +53,7 @@
5253
<column xsi:type="smallint" name="use_config_qty_increments" padding="6" unsigned="true" nullable="false"
5354
identity="false" default="1"/>
5455
<column xsi:type="decimal" name="qty_increments" scale="12" precission="4" unsigned="false" nullable="false"
55-
default="0.0000"/>
56+
default="0"/>
5657
<column xsi:type="smallint" name="use_config_enable_qty_inc" padding="6" unsigned="true" nullable="false"
5758
identity="false" default="1"/>
5859
<column xsi:type="smallint" name="enable_qty_increments" padding="6" unsigned="true" nullable="false"
@@ -85,8 +86,7 @@
8586
<column xsi:type="int" name="product_id" padding="11" unsigned="true" nullable="false" identity="false"/>
8687
<column xsi:type="smallint" name="website_id" padding="6" unsigned="true" nullable="false" identity="false"/>
8788
<column xsi:type="smallint" name="stock_id" padding="6" unsigned="true" nullable="false" identity="false"/>
88-
<column xsi:type="decimal" name="qty" scale="12" precission="4" unsigned="false" nullable="false"
89-
default="0.0000"/>
89+
<column xsi:type="decimal" name="qty" scale="12" precission="4" unsigned="false" nullable="false" default="0"/>
9090
<column xsi:type="smallint" name="stock_status" padding="6" unsigned="true" nullable="false" identity="false"/>
9191
<constraint xsi:type="primary" name="PRIMARY">
9292
<column name="product_id"/>
@@ -107,8 +107,7 @@
107107
<column xsi:type="int" name="product_id" padding="11" unsigned="true" nullable="false" identity="false"/>
108108
<column xsi:type="smallint" name="website_id" padding="6" unsigned="true" nullable="false" identity="false"/>
109109
<column xsi:type="smallint" name="stock_id" padding="6" unsigned="true" nullable="false" identity="false"/>
110-
<column xsi:type="decimal" name="qty" scale="12" precission="4" unsigned="false" nullable="false"
111-
default="0.0000"/>
110+
<column xsi:type="decimal" name="qty" scale="12" precission="4" unsigned="false" nullable="false" default="0"/>
112111
<column xsi:type="smallint" name="stock_status" padding="6" unsigned="true" nullable="false" identity="false"/>
113112
<constraint xsi:type="primary" name="PRIMARY">
114113
<column name="product_id"/>
@@ -126,8 +125,7 @@
126125
<column xsi:type="int" name="product_id" padding="11" unsigned="true" nullable="false" identity="false"/>
127126
<column xsi:type="smallint" name="website_id" padding="6" unsigned="true" nullable="false" identity="false"/>
128127
<column xsi:type="smallint" name="stock_id" padding="6" unsigned="true" nullable="false" identity="false"/>
129-
<column xsi:type="decimal" name="qty" scale="12" precission="4" unsigned="false" nullable="false"
130-
default="0.0000"/>
128+
<column xsi:type="decimal" name="qty" scale="12" precission="4" unsigned="false" nullable="false" default="0"/>
131129
<column xsi:type="smallint" name="stock_status" padding="6" unsigned="true" nullable="false" identity="false"/>
132130
<constraint xsi:type="primary" name="PRIMARY">
133131
<column name="product_id"/>

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@
4646
default="0"/>
4747
<column xsi:type="varchar" name="action_operator" nullable="true" length="10" default="to_fixed"/>
4848
<column xsi:type="decimal" name="action_amount" scale="12" precission="4" unsigned="false" nullable="false"
49-
default="0.0000"/>
49+
default="0"/>
5050
<column xsi:type="smallint" name="action_stop" padding="6" unsigned="false" nullable="false" identity="false"
5151
default="0"/>
5252
<column xsi:type="int" name="sort_order" padding="11" unsigned="true" nullable="false" identity="false"
5353
default="0"/>
5454
<column xsi:type="smallint" name="website_id" padding="6" unsigned="true" nullable="false" identity="false"/>
5555
<column xsi:type="varchar" name="sub_simple_action" nullable="true" length="32"/>
5656
<column xsi:type="decimal" name="sub_discount_amount" scale="12" precission="4" unsigned="false"
57-
nullable="false" default="0.0000"/>
57+
nullable="false" default="0"/>
5858
<constraint xsi:type="primary" name="PRIMARY">
5959
<column name="rule_product_id"/>
6060
</constraint>
@@ -91,7 +91,7 @@
9191
<column xsi:type="int" name="product_id" padding="11" unsigned="true" nullable="false" identity="false"
9292
default="0"/>
9393
<column xsi:type="decimal" name="rule_price" scale="12" precission="4" unsigned="false" nullable="false"
94-
default="0.0000"/>
94+
default="0"/>
9595
<column xsi:type="smallint" name="website_id" padding="6" unsigned="true" nullable="false" identity="false"/>
9696
<column xsi:type="date" name="latest_start_date"/>
9797
<column xsi:type="date" name="earliest_end_date"/>
@@ -126,15 +126,10 @@
126126
<column name="customer_group_id"/>
127127
<column name="website_id"/>
128128
</constraint>
129-
<constraint xsi:type="foreign" name="CATRULE_GROUP_WS_CSTR_GROUP_ID_CSTR_GROUP_CSTR_GROUP_ID"
130-
table="catalogrule_group_website" column="customer_group_id" referenceTable="customer_group"
131-
referenceColumn="customer_group_id" onDelete="CASCADE"/>
132-
<constraint xsi:type="foreign" name="CATALOGRULE_GROUP_WEBSITE_RULE_ID_CATALOGRULE_RULE_ID"
133-
table="catalogrule_group_website" column="rule_id" referenceTable="catalogrule"
134-
referenceColumn="rule_id" onDelete="CASCADE"/>
129+
<constraint xsi:type="foreign" name="CATRULE_GROUP_WS_CSTR_GROUP_ID_CSTR_GROUP_CSTR_GROUP_ID" disabled="1"/>
130+
<constraint xsi:type="foreign" name="CATALOGRULE_GROUP_WEBSITE_RULE_ID_CATALOGRULE_RULE_ID" disabled="1"/>
135131
<constraint xsi:type="foreign" name="CATALOGRULE_GROUP_WEBSITE_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID"
136-
table="catalogrule_group_website" column="website_id" referenceTable="store_website"
137-
referenceColumn="website_id" onDelete="CASCADE"/>
132+
disabled="1"/>
138133
<index name="CATALOGRULE_GROUP_WEBSITE_CUSTOMER_GROUP_ID" indexType="btree">
139134
<column name="customer_group_id"/>
140135
</index>
Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
11
<?xml version="1.0"?>
2-
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="urn:magento:setup:Model/Declaration/Schema/etc/schema.xsd">
4-
<table name="catalog_eav_attribute" resource="default">
5-
<column xsi:type="float" name="search_weight" scale="10" precission="0" unsigned="true" nullable="false"
6-
default="1"/>
7-
</table>
2+
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:setup:Model/Declaration/Schema/etc/schema.xsd">
3+
<table name="catalog_eav_attribute" resource="default">
4+
<column xsi:type="float" name="search_weight" scale="10" precission="0" unsigned="true" nullable="false" default="1"/>
5+
</table>
6+
<table name="catalogsearch_fulltext_scope1_tmp" resource="default">
7+
<column xsi:type="int" name="entity_id" padding="11" unsigned="true" nullable="false" identity="false"/>
8+
<column xsi:type="int" name="attribute_id" padding="11" unsigned="true" nullable="false" identity="false"/>
9+
<column xsi:type="longtext" name="data_index" nullable="true"/>
10+
<constraint xsi:type="primary" name="IDX_PRIMARY">
11+
<column name="entity_id"/>
12+
<column name="attribute_id"/>
13+
</constraint>
14+
<index name="FTI_FULLTEXT_DATA_INDEX" indexType="fulltext">
15+
<column name="data_index"/>
16+
</index>
17+
</table>
18+
<table name="catalogsearch_fulltext_scope1_tmp" resource="default">
19+
<column xsi:type="int" name="entity_id" padding="11" unsigned="true" nullable="false" identity="false"/>
20+
<column xsi:type="int" name="attribute_id" padding="11" unsigned="true" nullable="false" identity="false"/>
21+
<column xsi:type="longtext" name="data_index" nullable="true"/>
22+
<constraint xsi:type="primary" name="IDX_PRIMARY">
23+
<column name="entity_id"/>
24+
<column name="attribute_id"/>
25+
</constraint>
26+
<index name="FTI_FULLTEXT_DATA_INDEX" indexType="fulltext">
27+
<column name="data_index"/>
28+
</index>
29+
</table>
830
</schema>
Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
<?xml version="1.0"?>
22
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:noNamespaceSchemaLocation="urn:magento:setup:Model/Declaration/Schema/etc/schema.xsd">
4-
<table name="catalog_url_rewrite_product_category" resource="default">
5-
<column xsi:type="int" name="url_rewrite_id" padding="11" unsigned="true" nullable="false" identity="false"/>
6-
<column xsi:type="int" name="category_id" padding="11" unsigned="true" nullable="false" identity="false"/>
7-
<column xsi:type="int" name="product_id" padding="11" unsigned="true" nullable="false" identity="false"/>
8-
<constraint xsi:type="foreign" name="CAT_URL_REWRITE_PRD_CTGR_PRD_ID_CAT_PRD_ENTT_ENTT_ID"
9-
table="catalog_url_rewrite_product_category" column="product_id"
10-
referenceTable="catalog_product_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
11-
<constraint xsi:type="foreign" name="FK_BB79E64705D7F17FE181F23144528FC8"
12-
table="catalog_url_rewrite_product_category" column="url_rewrite_id" referenceTable="url_rewrite"
13-
referenceColumn="url_rewrite_id" onDelete="CASCADE"/>
14-
<index name="CATALOG_URL_REWRITE_PRODUCT_CATEGORY_CATEGORY_ID_PRODUCT_ID" indexType="btree">
15-
<column name="category_id"/>
16-
<column name="product_id"/>
17-
</index>
18-
</table>
4+
<table name="catalog_url_rewrite_product_category" resource="default">
5+
<column xsi:type="int" name="url_rewrite_id" padding="11" unsigned="true" nullable="false" identity="false"/>
6+
<column xsi:type="int" name="category_id" padding="11" unsigned="true" nullable="false" identity="false"/>
7+
<column xsi:type="int" name="product_id" padding="11" unsigned="true" nullable="false" identity="false"/>
8+
<constraint xsi:type="foreign" name="CAT_URL_REWRITE_PRD_CTGR_PRD_ID_CAT_PRD_ENTT_ENTT_ID"
9+
table="catalog_url_rewrite_product_category" column="product_id" referenceTable="catalog_product_entity"
10+
referenceColumn="entity_id" onDelete="CASCADE"/>
11+
<constraint xsi:type="foreign" name="FK_BB79E64705D7F17FE181F23144528FC8"
12+
table="catalog_url_rewrite_product_category" column="url_rewrite_id" referenceTable="url_rewrite"
13+
referenceColumn="url_rewrite_id" onDelete="CASCADE"/>
14+
<constraint xsi:type="foreign" name="CAT_URL_REWRITE_PRD_CTGR_CTGR_ID_CAT_CTGR_ENTT_ENTT_ID"
15+
table="catalog_url_rewrite_product_category" column="category_id"
16+
referenceTable="catalog_category_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
17+
<index name="CATALOG_URL_REWRITE_PRODUCT_CATEGORY_CATEGORY_ID_PRODUCT_ID" indexType="btree">
18+
<column name="category_id"/>
19+
<column name="product_id"/>
20+
</index>
21+
</table>
1922
</schema>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Customer\Setup;
8+
9+
use Magento\Framework\Indexer\IndexerRegistry;
10+
use Magento\Framework\Setup\InstallDataInterface;
11+
use Magento\Framework\Setup\ModuleContextInterface;
12+
use Magento\Framework\Setup\ModuleDataSetupInterface;
13+
use Magento\Customer\Model\Customer;
14+
15+
/**
16+
* Upgrade registered themes
17+
*/
18+
class RecurringData implements InstallDataInterface
19+
{
20+
/**
21+
* @var IndexerRegistry
22+
*/
23+
private $indexerRegistry;
24+
25+
/**
26+
* Init
27+
*
28+
* @param IndexerRegistry $indexerRegistry
29+
*/
30+
public function __construct(IndexerRegistry $indexerRegistry)
31+
{
32+
$this->indexerRegistry = $indexerRegistry;
33+
}
34+
35+
/**
36+
* {@inheritdoc}
37+
*/
38+
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
39+
{
40+
$indexer = $this->indexerRegistry->get(Customer::CUSTOMER_GRID_INDEXER_ID);
41+
$indexer->reindexAll();
42+
43+
}
44+
}

app/code/Magento/Customer/Setup/UpgradeData.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
159159
$this->upgradeVersionTwoZeroTwelve($customerSetup);
160160
}
161161

162-
$indexer = $this->indexerRegistry->get(Customer::CUSTOMER_GRID_INDEXER_ID);
163-
$indexer->reindexAll();
164162
$this->eavConfig->clear();
165163
$setup->endSetup();
166164
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
<column xsi:type="int" name="entity_id" padding="11" unsigned="true" nullable="false" identity="false"
135135
default="0"/>
136136
<column xsi:type="decimal" name="value" scale="12" precission="4" unsigned="false" nullable="false"
137-
default="0.0000"/>
137+
default="0"/>
138138
<constraint xsi:type="primary" name="PRIMARY">
139139
<column name="value_id"/>
140140
</constraint>
@@ -276,7 +276,7 @@
276276
<column xsi:type="int" name="entity_id" padding="11" unsigned="true" nullable="false" identity="false"
277277
default="0"/>
278278
<column xsi:type="decimal" name="value" scale="12" precission="4" unsigned="false" nullable="false"
279-
default="0.0000"/>
279+
default="0"/>
280280
<constraint xsi:type="primary" name="PRIMARY">
281281
<column name="value_id"/>
282282
</constraint>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<column xsi:type="varchar" name="currency_from" nullable="false" length="3"/>
5555
<column xsi:type="varchar" name="currency_to" nullable="false" length="3"/>
5656
<column xsi:type="decimal" name="rate" scale="24" precission="12" unsigned="false" nullable="false"
57-
default="0.000000000000"/>
57+
default="0"/>
5858
<constraint xsi:type="primary" name="PRIMARY">
5959
<column name="currency_from"/>
6060
<column name="currency_to"/>

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<column xsi:type="smallint" name="website_id" padding="6" unsigned="true" nullable="false" identity="false"
3636
default="0"/>
3737
<column xsi:type="decimal" name="price" scale="12" precission="4" unsigned="false" nullable="false"
38-
default="0.0000"/>
38+
default="0"/>
3939
<constraint xsi:type="primary" name="PRIMARY">
4040
<column name="price_id"/>
4141
</constraint>
@@ -201,9 +201,9 @@
201201
identity="false"/>
202202
<column xsi:type="smallint" name="website_id" padding="6" unsigned="true" nullable="false" identity="false"/>
203203
<column xsi:type="decimal" name="min_price" scale="12" precission="4" unsigned="false" nullable="false"
204-
default="0.0000"/>
204+
default="0"/>
205205
<column xsi:type="decimal" name="max_price" scale="12" precission="4" unsigned="false" nullable="false"
206-
default="0.0000"/>
206+
default="0"/>
207207
<constraint xsi:type="primary" name="PRIMARY">
208208
<column name="entity_id"/>
209209
<column name="customer_group_id"/>
@@ -216,9 +216,9 @@
216216
identity="false"/>
217217
<column xsi:type="smallint" name="website_id" padding="6" unsigned="true" nullable="false" identity="false"/>
218218
<column xsi:type="decimal" name="min_price" scale="12" precission="4" unsigned="false" nullable="false"
219-
default="0.0000"/>
219+
default="0"/>
220220
<column xsi:type="decimal" name="max_price" scale="12" precission="4" unsigned="false" nullable="false"
221-
default="0.0000"/>
221+
default="0"/>
222222
<constraint xsi:type="primary" name="PRIMARY">
223223
<column name="entity_id"/>
224224
<column name="customer_group_id"/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
<column xsi:type="int" name="entity_id" padding="11" unsigned="true" nullable="false" identity="false"
110110
default="0"/>
111111
<column xsi:type="decimal" name="value" scale="12" precission="4" unsigned="false" nullable="false"
112-
default="0.0000"/>
112+
default="0"/>
113113
<constraint xsi:type="primary" name="PRIMARY">
114114
<column name="value_id"/>
115115
</constraint>

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,24 @@
1212
<column name="gift_message_id"/>
1313
</constraint>
1414
</table>
15+
<table name="quote" resource="default">
16+
<column xsi:type="int" name="gift_message_id" padding="11" unsigned="false" nullable="true" identity="false"/>
17+
</table>
18+
<table name="quote_address" resource="default">
19+
<column xsi:type="int" name="gift_message_id" padding="11" unsigned="false" nullable="true" identity="false"/>
20+
</table>
21+
<table name="quote_item" resource="default">
22+
<column xsi:type="int" name="gift_message_id" padding="11" unsigned="false" nullable="true" identity="false"/>
23+
</table>
24+
<table name="quote_address_item" resource="default">
25+
<column xsi:type="int" name="gift_message_id" padding="11" unsigned="false" nullable="true" identity="false"/>
26+
</table>
27+
<table name="sales_order" resource="default">
28+
<column xsi:type="int" name="gift_message_id" padding="11" unsigned="false" nullable="true" identity="false"/>
29+
</table>
30+
<table name="sales_order_item" resource="default">
31+
<column xsi:type="int" name="gift_message_id" padding="11" unsigned="false" nullable="true" identity="false"/>
32+
<column xsi:type="int" name="gift_message_available" padding="11" unsigned="false" nullable="true"
33+
identity="false"/>
34+
</table>
1535
</schema>

0 commit comments

Comments
 (0)