diff options
author | Joas Schilling <coding@schilljs.com> | 2018-07-27 14:31:19 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2018-07-27 14:45:22 +0200 |
commit | ef5074adaaac675a2fe5e250549d8092f628299c (patch) | |
tree | 286211e434f2c9463534e881143915f3109f4ffc | |
parent | 008c8dde1aac6b0351f8145e20a4c8a93bf77372 (diff) | |
download | nextcloud-server-ef5074adaaac675a2fe5e250549d8092f628299c.tar.gz nextcloud-server-ef5074adaaac675a2fe5e250549d8092f628299c.zip |
Fix primary key handling on postgres
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | lib/private/DB/MigrationService.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index 94b2b55e16f..412bb61a086 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -503,12 +503,13 @@ class MigrationService { $isUsingDefaultName = $indexName === 'primary'; if ($this->connection->getDatabasePlatform() instanceof PostgreSqlPlatform) { - $defaultName = $table->getName() . '_' . implode('_', $primaryKey->getColumns()) . '_seq'; + $defaultName = $table->getName() . '_pkey'; $isUsingDefaultName = strtolower($defaultName) === $indexName; if ($isUsingDefaultName) { - $sequences = array_filter($sequences, function(Sequence $sequence) use ($indexName) { - return $sequence->getName() !== $indexName; + $sequenceName = $table->getName() . '_' . implode('_', $primaryKey->getColumns()) . '_seq'; + $sequences = array_filter($sequences, function(Sequence $sequence) use ($sequenceName) { + return $sequence->getName() !== $sequenceName; }); } } else if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) { |