Describe the install/upgrade workflow. Where are setup scripts located, and how are they executed? Which types of functionality correspond to each type of setup script?
Magento has introduced a new feature called Declarative Schema since 2.3 which aims to simplify the Magento installation and upgrade processes. So this is out of date on the perspective of preparing for the exam
Install/Upgrade scripts are located in the VendorName/Module/Setup directory.
There are 6 types:
You performing a code review on an existing module. You see some interesting files in the Setup/folder.
What files in the Setup/ does Magento understand? (Multiple Choice)
Answer A C D
While integrating a merchant’s product information management system with Magento, you create a module
MyCompany_MerchantPim that adds a catalog product EAV attribute pim_entity_id programmatically.
In which type of setup script do you create the EAV attribute?
UpgradeSchema.php only provides one method: upgrade.
What method do you use to determine what code to execute for what method?
A. Use PHP’s version_compare method to compare the $context->getVersion() with the required version.
B. Use the $setup->compareVersion method.
C. Put the updates into a method named containing the version number that the module is being upgraded to.
D. Check the etc/module.xml XML file for the version number.