mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 10:40:40 -04:00
fix(db): ensure no autoincrement for Oracle
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
This commit is contained in:
parent
28d54ed26b
commit
f881e95e18
3 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue