September 2018
Beginner to intermediate
218 pages
4h 27m
English
The InstallSchema script is used when we wish to add new columns to existing tables or create new tables. This script is run only when a module is enabled. Once enabled, the module gets a corresponding entry under the setup_module.schema_version table column. This entry prevents the InstallSchema script running on any subsequent setup:upgrade command where the module's setup_version remains the same.
Let's go ahead and create the <MAGELICIOUS_DIR>/Core/Setup/InstallSchema.php file with the following content:
use \Magento\Framework\Setup\InstallSchemaInterface;use Magento\Framework\Setup\ModuleContextInterface;use Magento\Framework\Setup\SchemaSetupInterface;class InstallSchema implements InstallSchemaInterface {Read now
Unlock full access