Skip to content

Commit 144adbb

Browse files
fix: Converting from MySql -> postgresql, sequences are not created.
1 parent e98864b commit 144adbb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/private/DB/PgSqlTools.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ public function resynchronizeDatabaseSequences(Connection $conn) {
4444
});
4545

4646
foreach ($conn->createSchemaManager()->listSequences() as $sequence) {
47-
$sequenceName = $sequence->getName();
47+
$longSequenceName = $sequence->getName();
48+
// We need to strip away the preceding database prefix.
49+
// Example: oc_circles_circle_id_seq, not nextcloud.oc_circles_circle_id_seq
50+
$sequenceName = preg_replace('/^.*\./', '', $longSequenceName);
51+
4852
$sqlInfo = 'SELECT table_schema, table_name, column_name
4953
FROM information_schema.columns
5054
WHERE column_default = ? AND table_catalog = ?';

0 commit comments

Comments
 (0)