diff --git a/core/Migrations/Version34000Date20260518163022.php b/core/Migrations/Version34000Date20260518163022.php index c1b29cd9a30f9..1607cb1409a28 100644 --- a/core/Migrations/Version34000Date20260518163022.php +++ b/core/Migrations/Version34000Date20260518163022.php @@ -38,6 +38,8 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $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 08f59813911ef..7b93690a83413 100644 --- a/core/Migrations/Version34000Date20260521110333.php +++ b/core/Migrations/Version34000Date20260521110333.php @@ -45,6 +45,8 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $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/BackgroundJob/JobRuns.php b/lib/private/BackgroundJob/JobRuns.php index a3a517319bd58..6d3c857d62c6e 100644 --- a/lib/private/BackgroundJob/JobRuns.php +++ b/lib/private/BackgroundJob/JobRuns.php @@ -72,9 +72,9 @@ public function runningJobs(int $limit = 200): \Generator { $row['run_id'], $this->classesRegistry->getName($row['class_id']), $snowflakeInfo->getServerId(), - $row['pid'], + (int)$row['pid'], $snowflakeInfo->getCreatedAt(), - JobStatus::from($row['status']), + JobStatus::from((int)$row['status']), ); } } diff --git a/lib/private/DB/SchemaWrapper.php b/lib/private/DB/SchemaWrapper.php index 342a246ccb2fc..17c457ac53e6d 100644 --- a/lib/private/DB/SchemaWrapper.php +++ b/lib/private/DB/SchemaWrapper.php @@ -144,7 +144,7 @@ public function getDatabasePlatform() { #[\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 { diff --git a/lib/public/BackgroundJob/JobRun.php b/lib/public/BackgroundJob/JobRun.php index 126448f5e293a..8432f6b94f7f0 100644 --- a/lib/public/BackgroundJob/JobRun.php +++ b/lib/public/BackgroundJob/JobRun.php @@ -25,7 +25,7 @@ */ public function __construct( /** Run ID (Snowflake ID) */ - public int $runId, + public int|string $runId, /** Class name */ public string $className, /** Server ID */