Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Messenger] Fix Oracle errors 'ORA-00955: Name is already used by an … #60211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 7.2
Choose a base branch
Loading
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Messenger] Fix Oracle errors 'ORA-00955: Name is already used by an …
…existing object' with Doctrine transport
  • Loading branch information
atgitwk committed Apr 14, 2025
commit a39850b009de0683d5806b0b38d51c5aca27516f
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@ public function setup(): void
throw new \TypeError(\sprintf('The table name must be an instance of "%s" or a string ("%s" given).', AbstractAsset::class, get_debug_type($tableName)));
}

return $tableName === $this->configuration['table_name'];
// SchemaAssetsFilter needs to match the messenger table name and also the messenger sequence name to make $schemaDiff work correctly in updateSchema()
// This may also work for other databases if their sequence name is suffixed with '_seq', '_id_seq' or similar.
return str_starts_with($tableName, $this->configuration['table_name']); // MESSENGER_MESSAGES*
});
$this->updateSchema();
$configuration->setSchemaAssetsFilter($assetFilter);
Expand Down Expand Up @@ -533,9 +535,14 @@ private function addTableToSchema(Schema $schema): void

// We need to create a sequence for Oracle and set the id column to get the correct nextval
if ($this->driverConnection->getDatabasePlatform() instanceof OraclePlatform) {
$idColumn->setDefault($this->configuration['table_name'].self::ORACLE_SEQUENCES_SUFFIX.'.nextval');
$serverVersion = $this->driverConnection->executeQuery("SELECT version FROM product_component_version WHERE product LIKE 'Oracle Database%'")->fetchOne();
if (version_compare($serverVersion, '12.1.0', '>=')) {
$idColumn->setAutoincrement(false); // disable the creation of SEQUENCE and TRIGGER
// The line below is taken into account only if Oracle version is >= 12.1.0
$idColumn->setDefault($this->configuration['table_name'].self::ORACLE_SEQUENCES_SUFFIX.'.nextval');

$schema->createSequence($this->configuration['table_name'].self::ORACLE_SEQUENCES_SUFFIX);
$schema->createSequence($this->configuration['table_name'].self::ORACLE_SEQUENCES_SUFFIX);
}
}
}

Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.