Delete your module from setup_module
table in a database and also require to delete your database table which is useful in InstallData.php
.
If you don't want to delete your database table then you can also use UpgradeSchema.php
file to add more attributes in the database.
Create Vendor/Module/Setup/UpgradeSchema.php
<?php
namespace Vendor\Module\Setup;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\UpgradeSchemaInterface;
class UpgradeSchema implements UpgradeSchemaInterface
{
public function upgrade(
SchemaSetupInterface $setup,
ModuleContextInterface $context
) {
$installer = $setup;
$installer->startSetup();
$installer->getConnection()->addColumn(
$installer->getTable('table_name'),
'table_field_name',
[
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
'length' => '2M',
'nullable' => false,
'default' => null,
'comment' => 'Custom Attribute',
]
);
$installer->endSetup();
}
}
I hope this will help you.