Starting from the early 2015 when our development team was working on the first instance of UB Data Migration tool, we had chance to dive in and explore Magento 2, especially the differences between Magento 1 and Magento 2 database. And we see there are a significant number of changes in the database structure that are worth highlighting.
It took us pretty much of time to update the changes in accordance with Magento 2 development process. However it’s beneficial to our internal product development indeed. And we think this would also be good to anyone new to Magento 2 who wants to become familiar with the key changes in Magento 2. So we end up with the idea to create an infographic that puts those findings together.
The infographic is formatted to give a quick overview of key changes in Magento 2 database structures, compared to Magento 1. Please note the comparison is for quick reference rather than detailing every aspect of the database.
Feel free to embed and share this infographic on your site, copy and paste the code below:
<img src=”//static.ubertheme.com/infographic/magento-1-vs-magento-2-database-structure-infographic.png” />Magento 1 vs Magento 2 Database Structure -- An infographic by <a href=”https://www.ubertheme.com”>Ubertheme</a>
A short note regarding key changes in Magento CE 2.x database
For your convenience, we include below the significant changes in Magento CE 2.x database that you see in the infographic:
Websites, Stores, Store Views |
---|
1. The ‘core_website’ table was replaced with ‘store_website’ (The structure was changed) 2. The ‘core_store’ table was replaced with ‘store’ (The structure was not changed) 3. The ‘core_store_group’ table was replaced with ‘store_group’ (The structure was not changed) |
Core Product Attributes, Custom Product Attributes |
---|
1. A new field ‘is_required_in_admin_store’ was added to the ‘catalog_eav_attribute’ table 2. Two new fields ‘attribute_group_code’ & ‘tab_group_code’ were added to the ‘eav_attribute_group’ table 3. The product attribute ‘msrp_enabled’ was replaced with ‘msrp’. Magento 2 deleted 2 core attributes ‘group_price’, ‘msrp_enabled’ and the ‘group_price’ data was converted to ‘tier_price’ 4. The category attribute ‘thumbnail’ was deleted |
Categories |
---|
1. Structure of tables’ changes: -- The ‘entity_type_id’ field was deleted -- Some FOREIGN KEYs were changed 2. The ‘core_url_rewrite’ table was changed to ‘url_rewrite’ and structure was changed. |
Products |
---|
1. Have more than 44 related tables
2. The structure of tables was changed: 3. Product Images: A new field ‘enity_id’ was added to the ‘catalog_product_entity_media_gallery_value’ table 4. The catalog_product_index_tier_price table changes: 5. Stock: |
Customers |
---|
1. The ‘customer_entity’, ‘customer_address_entity ‘tables removed the ‘entity_type_id’, ‘attribute_set_id’ fields
2. The ‘customer_address_entity_datetime’, ‘customer_address_entity_decimal’, ‘customer_address_entity_int’, ‘customer_address_entity_text’, ‘customer_address_entity_varchar’, ‘customer_entity_datetime’, ‘customer_entity_decimal’, ‘customer_entity_int’, ‘customer_entity_text’, ‘customer_entity_varchar’ tables removed the ‘entity_type_id’ field 3. The ‘customer_eav_attribute’ table: 4. EAV of customer data structure was changed, some attributes were moved to the main table: 5. EAV of customer_address_entity data structure was changed, some attributes were moved from the child tables to the main table `customer_address_entity`: 6. Magento CE 2.x changed the method of hashing passwords from md5() to sha256(). Magento 2 still supports the option md5() providing that the string ‘:0’ must be appended to the end of ‘password_hash’ |
Sale Orders, Sale Quote, Sale Invoices, Sale Payments, Sale Shipments, Bestseller information, Sales Rules & Coupons, |
---|
The name of some tables in Sales database structure were changed (removed the “_flat” in the table name)
1. Sales Orders tables changes: 2. Max length changes in the `sales_order` table: 3. The `sales_order_item` table changes: 4. Sales Quote: -- In the `quote_address ` table: 5. Sales Payments: 6. Sales Invoices: 7. Sales Shipments 8. In the `sales_invoice_item` table, Magento 2 changed the method to save value of the `weee_tax_applied` field to database: serialize() -> json_encode() function. 9. In the `sales_shipment_item` table, the `weight` field has max length 12 chars 10. Sales Credit Memo: Name of tables was changed (the string “_flat” was deleted) -- The `sales_creditmemo_grid` table: some new fields and value are required in Magento 2 like ‘updated_at’, ‘customer_name’ 11. Sales Rules: Sales Rules Models Class Name changes: 12. Magento 2 added new tables for sales data ‘sales_sequence_meta’ and ‘sequece_tables’ (default table in a clean Magento installation). Magento 2 will automatically generate ‘Sequence_tables’ related to ‘sales_sequence_meta’ (for instance: “sequence_invoice_0, sequence_order_0…) |
Catalog Rules |
---|
Catalog Rule Model Class Name changes:
-- The ‘catalogrule/rule_condition_combine’ was replaced with ‘Magento\CatalogRule\Model\Rule\Condition\Combine’ |