From f881e95e183ecb45b795c030362aa7919aa6eae8 Mon Sep 17 00:00:00 2001 From: Benjamin Gaussorgues Date: Thu, 28 May 2026 15:56:38 +0200 Subject: [PATCH] fix(db): ensure no autoincrement for Oracle Signed-off-by: Benjamin Gaussorgues --- core/Migrations/Version34000Date20260518163022.php | 2 ++ core/Migrations/Version34000Date20260521110333.php | 2 ++ lib/private/DB/SchemaWrapper.php | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/Migrations/Version34000Date20260518163022.php b/core/Migrations/Version34000Date20260518163022.php index c1b29cd9a30..1607cb1409a 100644 --- a/core/Migrations/Version34000Date20260518163022.php +++ b/core/Migrations/Version34000Date20260518163022.php @@ -38,6 +38,8 @@ class Version34000Date20260518163022 extends SimpleMigrationStep { $table->addColumn('class_name', Types::STRING, ['notnull' => true, 'length' => 255]); $table->setPrimaryKey(['class_id']); $table->addUniqueConstraint(['class_name'], 'class_index'); + // Makes sure there is no auto-increment in Oracle + $schema->dropAutoincrementColumn('job_classes_registry', 'class_id'); return $schema; } diff --git a/core/Migrations/Version34000Date20260521110333.php b/core/Migrations/Version34000Date20260521110333.php index 08f59813911..7b93690a834 100644 --- a/core/Migrations/Version34000Date20260521110333.php +++ b/core/Migrations/Version34000Date20260521110333.php @@ -45,6 +45,8 @@ class Version34000Date20260521110333 extends SimpleMigrationStep { $table->addColumn('ram_peak_usage', Types::INTEGER, ['notnull' => true, 'default' => 0]); // Should be MEDIUMINT $table->setPrimaryKey(['run_id']); $table->addIndex(['status'], 'status'); + // Makes sure there is no auto-increment in Oracle + $schema->dropAutoincrementColumn('job_runs', 'run_id'); return $schema; } diff --git a/lib/private/DB/SchemaWrapper.php b/lib/private/DB/SchemaWrapper.php index 342a246ccb2..17c457ac53e 100644 --- a/lib/private/DB/SchemaWrapper.php +++ b/lib/private/DB/SchemaWrapper.php @@ -144,7 +144,7 @@ class SchemaWrapper implements ISchemaWrapper { #[\Override] public function dropAutoincrementColumn(string $table, string $column): void { $tableObj = $this->schema->getTable($this->connection->getPrefix() . $table); - $tableObj->modifyColumn('id', ['autoincrement' => false]); + $tableObj->modifyColumn($column, ['autoincrement' => false]); $platform = $this->getDatabasePlatform(); if ($platform instanceof OraclePlatform) { try {