Magento 2: Create/Alter Database Table & Insert Data while Installing/Upgrading Module
This article shows how you can create a new database table and install data into the table while installing a custom module or upgrading the module in Magento 2. The install and upgrade setup script file should be inside the Setup folder of your module. The install script should be named InstallSchema.php & InstallData.php and … Read more