UpdateCommand don't see Primary Keys in current Oracle database when CONSTRAINT_NAME differs from INDEX_NAME #5368

Closed
opened 2026-01-22 15:05:37 +01:00 by admin · 1 comment
Owner

Originally created by @stoccc on GitHub (Jan 2, 2017).

Originally assigned to: @Ocramius on GitHub.

the UpdateCommand in Doctrine\ORM\Tools\Console\Command\SchemaTool
doesn't see currently defined Primary Keys in tables in Oracle (OCI8) if the name of the Constraint differs from the name of the Index (this always happens if you create on the DB a primary key constraint on a field that has already a unique index or when you perform a full Database Copy throught Oracle SQL developer and then try to execute the UpdateCommand - this was my case).

This bug causes the following SQL statements to be executed for every table in such a condition when executing the UpdateCommand

DROP INDEX sys_c009749277;
ALTER TABLE TABLE1 ADD PRIMARY KEY (id);

this is related to https://github.com/doctrine/dbal/pull/889 https://github.com/doctrine/dbal/issues/1234

Originally created by @stoccc on GitHub (Jan 2, 2017). Originally assigned to: @Ocramius on GitHub. the UpdateCommand in Doctrine\ORM\Tools\Console\Command\SchemaTool doesn't see currently defined Primary Keys in tables in Oracle (OCI8) if the name of the Constraint differs from the name of the Index (this always happens if you create on the DB a primary key constraint on a field that has already a unique index or when you perform a full Database Copy throught Oracle SQL developer and then try to execute the UpdateCommand - this was my case). This bug causes the following SQL statements to be executed for every table in such a condition when executing the UpdateCommand ``` DROP INDEX sys_c009749277; ALTER TABLE TABLE1 ADD PRIMARY KEY (id); ``` this is related to https://github.com/doctrine/dbal/pull/889 https://github.com/doctrine/dbal/issues/1234
admin added the BugDuplicate labels 2026-01-22 15:05:37 +01:00
admin closed this issue 2026-01-22 15:05:39 +01:00
Author
Owner

@Ocramius commented on GitHub (May 20, 2017):

Handled in doctrine/dbal#2686

@Ocramius commented on GitHub (May 20, 2017): Handled in doctrine/dbal#2686
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5368