How to upgrade database table in magento 2?

When You need to add a new field in the existing table, you need to create UpgradeSchema.php file in Setup folder of your module.

We add new address field in our existing table by below way, We have just create a database table in the previous post, Create Database table in Magento 2

Run php bin/magento setup:upgrade

Now you can check your new address field is display in your create_form table.

2 Replies to “How to upgrade database table in magento 2?”

Leave a Reply

Your email address will not be published. Required fields are marked *