diff options
author | Morris Jobke <hey@morrisjobke.de> | 2021-01-06 19:39:41 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-01-08 11:45:19 +0100 |
commit | dc00c8ac31793f8facb6dbb764820dbe06786679 (patch) | |
tree | 78f6eceaaebd5873879d3a6b2844fc3c855cec21 /lib | |
parent | 8b64e92b9262d2a2eec6345685ce421050f95c66 (diff) | |
download | nextcloud-server-dc00c8ac31793f8facb6dbb764820dbe06786679.tar.gz nextcloud-server-dc00c8ac31793f8facb6dbb764820dbe06786679.zip |
Remove "primary" option from schema builder argument $options as it is not used anymore and triggers an exception
See https://github.com/doctrine/dbal/commit/138eb85234a1faeaa2e6a32cd7bcc66bb51c64e8#diff-300f55366adb50a32a40882ebdc95c163b141f64cba5f45f20bda04a907b3eb3L82
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/DB/MDB2SchemaReader.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/DB/MDB2SchemaReader.php b/lib/private/DB/MDB2SchemaReader.php index abf58ffa053..687438495b1 100644 --- a/lib/private/DB/MDB2SchemaReader.php +++ b/lib/private/DB/MDB2SchemaReader.php @@ -260,8 +260,16 @@ class MDB2SchemaReader { $options['primary'] = true; } - $table->addColumn($name, $type, $options); + # not used anymore in the options argument + # see https://github.com/doctrine/dbal/commit/138eb85234a1faeaa2e6a32cd7bcc66bb51c64e8#diff-300f55366adb50a32a40882ebdc95c163b141f64cba5f45f20bda04a907b3eb3L82 + # therefore it's read before and then unset right before the addColumn call + $setPrimaryKey = false; if (!empty($options['primary']) && $options['primary']) { + $setPrimaryKey = true; + } + unset($options['primary']); + $table->addColumn($name, $type, $options); + if ($setPrimaryKey) { $table->setPrimaryKey([$name]); } } |