Skip to content

Commit b1e988a

Browse files
committed
Remove "primary" option from schema builder argument $options as it is not used anymore and triggers an exception
See doctrine/dbal@138eb85#diff-300f55366adb50a32a40882ebdc95c163b141f64cba5f45f20bda04a907b3eb3L82 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
1 parent 7ca0f56 commit b1e988a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/private/DB/MDB2SchemaReader.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,16 @@ private function loadField($table, $xml) {
260260
$options['primary'] = true;
261261
}
262262

263-
$table->addColumn($name, $type, $options);
263+
# not used anymore in the options argument
264+
# see https://github.com/doctrine/dbal/commit/138eb85234a1faeaa2e6a32cd7bcc66bb51c64e8#diff-300f55366adb50a32a40882ebdc95c163b141f64cba5f45f20bda04a907b3eb3L82
265+
# therefore it's read before and then unset right before the addColumn call
266+
$setPrimaryKey = false;
264267
if (!empty($options['primary']) && $options['primary']) {
268+
$setPrimaryKey = true;
269+
}
270+
unset($options['primary']);
271+
$table->addColumn($name, $type, $options);
272+
if ($setPrimaryKey) {
265273
$table->setPrimaryKey([$name]);
266274
}
267275
}

0 commit comments

Comments
 (0)