I inserted a custom column in quote table like this:
if (version_compare($context->getVersion(), '1.0.1', '<')) {
$setup->getConnection()->addColumn(
$setup->getTable('quote'),
'custom_column',
[
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
'nullable' => true,
'comment' => 'Custom Column',
]
);
}
The custom column was successfully created, and added to every single row in quote table with null value, but the problem is, i don't know how to update the custom column data in the quote table by using only quote id
Best Answer
The easiest way to solve this is to fill in this field in the quote model and save it using the Repository: