Magento2.3 - What is the benefit of Declarative DB Schema over Traditional installation schema for DB management?

magento.stackexchange https://magento.stackexchange.com/questions/303723

  •  08-04-2021
  •  | 
  •  

Question

At the Magento Imagine Conference, Magento announced the next noteworthy release on the Magento platform – Magento 2.3. It has enormous features, back-end enhancements, and optimizations.

So I just wonder that What is the actual use of Declarative DB Schema and how it's overcome on Traditional way to install/upgrade table and update its fields in Magento2.3.

Was it helpful?

Solution 2

Magento includes this feature in its Magento2.3 version. It simplifies the Magento’s installation and upgrade processes.

Previously we had to write the database script for each version of the module. Various scripts were required for different operations on the database.

Declarative schema helps Magento to simplify module upgradation procedures. Natively each upgrade scripts iteratively adds changes to database blindly. Declarative Schema setup is based on database structure declarations.

Declarative Schema files declare what the database structure should be, and Magento determines the differences between the current table structure and what it should be.

OTHER TIPS

Declarative schema makes it easy to install and update Magento versions. Prior to now, each time developers needed to compose database scripts in PHP for the new version of Magento. For example, in the current version of Magento, you can change the pattern of a Magento database by composing code with UpgradeSchema and InstallSchema. However, with the new Magento 2.3, you can impact changes by utilizing a declarative database schema. This way, you can undoubtedly delete data when you uninstall a module.

you can use this link as a reference for more details on which new features in Magento 2.3.

https://www.titechglobal.com/magento-2-3-8-features-that-will-amaze-you/

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top