Skip to content

Commit

Permalink
SW-20584 - 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
fixes 1396
  • Loading branch information
Samuel Vogel authored and pascalheidmann-bedarf committed Feb 19, 2018
1 parent a1ea798 commit 1756723
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') {
continue;
}

Expand Down

0 comments on commit 1756723

Please sign in to comment.