From 403201fd65d53c4a05615ad154eabe44700d953f Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 17 Aug 2026 10:07:16 +0200 Subject: [PATCH 1/2] fix: Mark tableName and columnName as non-empty-string Signed-off-by: Carl Schwan --- lib/Migration/Version030201Date20201116110353.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Migration/Version030201Date20201116110353.php b/lib/Migration/Version030201Date20201116110353.php index c08f8e2a913..97dd565e9ec 100644 --- a/lib/Migration/Version030201Date20201116110353.php +++ b/lib/Migration/Version030201Date20201116110353.php @@ -50,6 +50,10 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt return $schema; } + /** + * @param non-empty-string $tableName + * @param non-empty-string $columnName + */ protected function ensureColumnIsNullable(ISchemaWrapper $schema, string $tableName, string $columnName): bool { $table = $schema->getTable($tableName); $column = $table->getColumn($columnName); From b92edffc4b0c07dcf1f4192f53002a1215dca53f Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 17 Aug 2026 10:10:33 +0200 Subject: [PATCH 2/2] refactor: Use getDatabaseProvider to detect if DB is oracle Signed-off-by: Carl Schwan --- lib/Migration/Version030201Date20201116110353.php | 10 ++++------ lib/Migration/Version030201Date20201116123153.php | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/Migration/Version030201Date20201116110353.php b/lib/Migration/Version030201Date20201116110353.php index 97dd565e9ec..a0d723f8a38 100644 --- a/lib/Migration/Version030201Date20201116110353.php +++ b/lib/Migration/Version030201Date20201116110353.php @@ -11,17 +11,15 @@ use Closure; use OCP\DB\ISchemaWrapper; -use OCP\IConfig; +use OCP\IDBConnection; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; class Version030201Date20201116110353 extends SimpleMigrationStep { + private readonly bool $isOracle; - /** @var bool */ - private $isOracle; - - public function __construct(IConfig $config) { - $this->isOracle = $config->getSystemValue('dbtype', 'sqlite') === 'oci'; + public function __construct(IDBConnection $connection) { + $this->isOracle = $connection->getDatabaseProvider() === IDBConnection::PLATFORM_ORACLE; } public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { diff --git a/lib/Migration/Version030201Date20201116123153.php b/lib/Migration/Version030201Date20201116123153.php index 89a8789f8a8..3695de8dc64 100644 --- a/lib/Migration/Version030201Date20201116123153.php +++ b/lib/Migration/Version030201Date20201116123153.php @@ -12,17 +12,15 @@ use Closure; use OCP\DB\ISchemaWrapper; use OCP\DB\Types; -use OCP\IConfig; +use OCP\IDBConnection; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; class Version030201Date20201116123153 extends SimpleMigrationStep { + private readonly bool $isOracle; - /** @var bool */ - private $isOracle; - - public function __construct(IConfig $config) { - $this->isOracle = $config->getSystemValue('dbtype', 'sqlite') === 'oci'; + public function __construct(IDBConnection $connection) { + $this->isOracle = $connection->getDatabaseProvider() === IDBConnection::PLATFORM_ORACLE; } public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {