Skip to content

Commit f7f4e20

Browse files
committed
fix(db): migrations adding context type and id
* Return the schema - even if the migrations do nothing. * Use the plain column name of the column to set. Fixes the migration on postgres DB. Signed-off-by: Max <max@nextcloud.com>
1 parent 1c10fa1 commit f7f4e20

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

lib/Migration/Version090000Date20260817110024.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
4545
$table->modifyColumn('id', [
4646
'autoincrement' => true,
4747
]);
48-
return $schema;
4948
}
50-
return null;
49+
return $schema;
5150
}
5251
}

lib/Migration/Version090000Date20260819110024.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ public function __construct(
3636
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
3737
$qb = $this->connection->getQueryBuilder();
3838
$qb->update('text_documents', 'd')
39-
->set('d.context_type', $qb->createNamedParameter('file'))
39+
->set('context_type', $qb->createNamedParameter('file'))
4040
->where($qb->expr()->isNull('context_type'))
4141
->executeStatement();
4242
$qb->update('text_documents', 'd')
43-
->set('d.context_id', 'd.id')
43+
->set('context_id', 'd.id')
4444
->where($qb->expr()->isNull('context_id'))
4545
->executeStatement();
4646
}
@@ -63,8 +63,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
6363
$table->modifyColumn('context_id', [
6464
'notnull' => true,
6565
]);
66-
return $schema;
6766
}
68-
return null;
67+
return $schema;
6968
}
7069
}

0 commit comments

Comments
 (0)