From b09b4496684faf4cd5ea360ab4e529cd7f6620ac Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 17 Aug 2026 09:43:16 +0200 Subject: [PATCH 1/2] fix: Add support for OCP\DB\Schema Signed-off-by: Carl Schwan --- lib/Migration/Version000400Date20230406000000.php | 3 +++ lib/Migration/Version000800Date20240213123743.php | 3 ++- psalm.xml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Migration/Version000400Date20230406000000.php b/lib/Migration/Version000400Date20230406000000.php index c8ca44756b..475ad2afc1 100644 --- a/lib/Migration/Version000400Date20230406000000.php +++ b/lib/Migration/Version000400Date20230406000000.php @@ -37,14 +37,17 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $column = $table->getColumn('selection_options'); $column->setLength(65535); + /** @psalm-suppress InvalidArgument Chane to ColumnType enum when app support nc >= 35 */ $column->setType(Type::getType('text')); $column = $table->getColumn('selection_default'); $column->setLength(65535); + /** @psalm-suppress InvalidArgument Chane to ColumnType enum when app support nc >= 35 */ $column->setType(Type::getType('text')); $column = $table->getColumn('text_default'); $column->setLength(65535); + /** @psalm-suppress InvalidArgument Chane to ColumnType enum when app support nc >= 35 */ $column->setType(Type::getType('text')); } diff --git a/lib/Migration/Version000800Date20240213123743.php b/lib/Migration/Version000800Date20240213123743.php index d265cc873b..b76b7fef04 100644 --- a/lib/Migration/Version000800Date20240213123743.php +++ b/lib/Migration/Version000800Date20240213123743.php @@ -13,6 +13,7 @@ use Doctrine\DBAL\Schema\SchemaException; use Doctrine\DBAL\Schema\Table; use OCP\DB\ISchemaWrapper; +use OCP\DB\Schema\ITable; use OCP\DB\Types; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; @@ -39,7 +40,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt return $schema; } - protected function shouldAddTable(string $tableName, ISchemaWrapper $schema): ?Table { + protected function shouldAddTable(string $tableName, ISchemaWrapper $schema): Table|ITable|null { return !$schema->hasTable($tableName) ? $schema->createTable($tableName) : null; } diff --git a/psalm.xml b/psalm.xml index c5e79501f8..69eb8bb116 100644 --- a/psalm.xml +++ b/psalm.xml @@ -45,6 +45,7 @@ + From 6a6622112e06147581a80901092dfefd313f9b16 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Wed, 19 Aug 2026 08:05:49 +0200 Subject: [PATCH 2/2] fix: typo in comment Co-authored-by: Enjeck <32180937+enjeck@users.noreply.github.com> Signed-off-by: Carl Schwan --- lib/Migration/Version000400Date20230406000000.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Migration/Version000400Date20230406000000.php b/lib/Migration/Version000400Date20230406000000.php index 475ad2afc1..effa746575 100644 --- a/lib/Migration/Version000400Date20230406000000.php +++ b/lib/Migration/Version000400Date20230406000000.php @@ -37,17 +37,17 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $column = $table->getColumn('selection_options'); $column->setLength(65535); - /** @psalm-suppress InvalidArgument Chane to ColumnType enum when app support nc >= 35 */ + /** @psalm-suppress InvalidArgument Change to ColumnType enum when the app supports NC >= 35 */ $column->setType(Type::getType('text')); $column = $table->getColumn('selection_default'); $column->setLength(65535); - /** @psalm-suppress InvalidArgument Chane to ColumnType enum when app support nc >= 35 */ + /** @psalm-suppress InvalidArgument Change to ColumnType enum when the app supports NC >= 35 */ $column->setType(Type::getType('text')); $column = $table->getColumn('text_default'); $column->setLength(65535); - /** @psalm-suppress InvalidArgument Chane to ColumnType enum when app support nc >= 35 */ + /** @psalm-suppress InvalidArgument Change to ColumnType enum when the app supports NC >= 35 */ $column->setType(Type::getType('text')); }