I want to add new column, let's call it test
, to customer_entity
table.
I managed to add the column to the table but values aren't saved for this column when I write something like:
$customer->setData("test", "something");
$customer->save();
The code I used to add the new column in my module's InstallSchema.php
:
$eavTable = $installer->getTable('customer_entity');
$columns = [
'test' => [
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
'length' => '6',
'nullable' => false,
'default' => null,
'comment' => 'test',
]
];
foreach ($columns as $name => $definition) {
$connection->addColumn($eavTable, $name, $definition);
}
$installer->endSetup();