Skip to content

Commit

Permalink
Workaround for MariaDB >= 10.2.7 compatibility
Browse files Browse the repository at this point in the history
Attribute default models are broken otherwise, see: doctrine/orm#6565
  • Loading branch information
Samuel Vogel committed Nov 22, 2017
1 parent b9ee675 commit 944dbcc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion engine/Shopware/Components/Model/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,11 @@ protected function getConstructor($table)
// Create the property initializations
$initializations = [];
foreach ($table->getColumns() as $column) {
if ($column->getDefault() === null || $this->isPrimaryColumn($table, $column)) {
if ($column->getDefault() === null || $this->isPrimaryColumn($table, $column)
// With MariaDB >= 10.2.7 and doctrine/dbal < 2.7.0 "NULL"
// will be returned as string if there is no default, see:
// https://github.com/doctrine/doctrine2/issues/6565
|| $column->getDefault() === "NULL") {

This comment has been minimized.

Copy link
@fixpunkt

fixpunkt Nov 22, 2017

Member

Please use single quotes for strings 😉

continue;
}

Expand Down

0 comments on commit 944dbcc

Please sign in to comment.