Install table setup in Magento 2

$table = $setup->getConnection()
->newTable($setup->getTable(‘mjweb_customer_rewards’))
->addColumn(‘id’, \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, null, array(
‘identity’ => true,
‘unsigned’ => true,
‘nullable’ => false,
‘primary’ => true,
), ‘Id’)
->addColumn(‘customer_id’, \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, null, array(
‘nullable’ => false,
‘unsigned’ => true,
‘nullable’ => false,
), ‘Customer ID’)
->addColumn(‘rewards_point’, \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, null, array(
‘nullable’ => false,
‘unsigned’ => true,
‘nullable’ => false
), ‘Description’);
$setup->getConnection()->createTable($table);

Leave a Comment