How to create table and install sample data in Magento 2

Posted at: September 21, 2018 1:57 PM

Create Table

Rsgitech\News\Setup\InstallSchema.php

You can create tables using InstallSchema.php file

Install Sample Data

Rsgitech\News\Setup\InstallData.php

You can install sample data by creating InstallData.php

Delete tables during extension uninstall

Rsgitech\News\Setup\Uninstall.php

You can delete tables during uninstall extension by command

Then run below commands


Complete!!

Speed Up Your Magento Store by 300%

Download source code: Download

You can watch video on How to create table and install sample data in Magento 2


Create Tables InstallSchema InstallData Uninsall

Please leave comments

1 Comments

truecodex launched free android app. You can download and install truecodex app on your mobile and get notification of the latest post.

Video Tutorials on YouTube