{
return ['type' => $this->_adminType, 'column' => false, 'form' => 'both', 'rules' => '',
'fillable' => true, 'guarded' => false, 'hidden' => false, 'translatable' => $this->_translatable,
- 'column_type' => $this->_columnType, 'default' => '', 'cast' => $this->_cast, 'fake' => false, 'store_in' => false];
+ 'column_type' => $this->_columnType, 'default' => '', 'cast' => $this->_cast,
+ 'allow_null' => true,
+ 'fake' => false, 'store_in' => false];
}
public function __construct($attributes)
public function defineDbColumn($table)
{
$name = $this->getAttribute('name');
- $table->addColumn($name, CubistMagicAbstractModel::toDoctrineType($this->getDatabaseType()), $this->_databaseAttributes);
+ $table->addColumn($name,
+ CubistMagicAbstractModel::toDoctrineType($this->getDatabaseType()),
+ array_merge(
+ ['allow_null' => $this->getAttribute('allow_null', true)],
+ $this->_databaseAttributes)
+ );
if ($this->_databaseUnique) {
$table->addUniqueIndex([$name]);
}