Skip to content

Commit b09b449

Browse files
committed
fix: Add support for OCP\DB\Schema
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 parent cffb34b commit b09b449

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

lib/Migration/Version000400Date20230406000000.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,17 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
3737

3838
$column = $table->getColumn('selection_options');
3939
$column->setLength(65535);
40+
/** @psalm-suppress InvalidArgument Chane to ColumnType enum when app support nc >= 35 */
4041
$column->setType(Type::getType('text'));
4142

4243
$column = $table->getColumn('selection_default');
4344
$column->setLength(65535);
45+
/** @psalm-suppress InvalidArgument Chane to ColumnType enum when app support nc >= 35 */
4446
$column->setType(Type::getType('text'));
4547

4648
$column = $table->getColumn('text_default');
4749
$column->setLength(65535);
50+
/** @psalm-suppress InvalidArgument Chane to ColumnType enum when app support nc >= 35 */
4851
$column->setType(Type::getType('text'));
4952
}
5053

lib/Migration/Version000800Date20240213123743.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Doctrine\DBAL\Schema\SchemaException;
1414
use Doctrine\DBAL\Schema\Table;
1515
use OCP\DB\ISchemaWrapper;
16+
use OCP\DB\Schema\ITable;
1617
use OCP\DB\Types;
1718
use OCP\Migration\IOutput;
1819
use OCP\Migration\SimpleMigrationStep;
@@ -39,7 +40,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
3940
return $schema;
4041
}
4142

42-
protected function shouldAddTable(string $tableName, ISchemaWrapper $schema): ?Table {
43+
protected function shouldAddTable(string $tableName, ISchemaWrapper $schema): Table|ITable|null {
4344
return !$schema->hasTable($tableName) ? $schema->createTable($tableName) : null;
4445
}
4546

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<referencedClass name="Doctrine\DBAL\Schema\Table" />
4646
<referencedClass name="Doctrine\DBAL\Types\Types" />
4747
<referencedClass name="OC\Core\Command\Base" />
48+
<referencedClass name="OCP\DB\Schema\ITable" />
4849
</errorLevel>
4950
</UndefinedClass>
5051
<UndefinedDocblockClass>

0 commit comments

Comments
 (0)