Robert Mackovik
Member
Hello,
this bug (release notes: DDL for Table primary/unique keys was not correct when based on other indexes) is still not fixed.
Correct DDL generated by Oracle SQL Developer:
ALTER TABLE "J_PNP_TAB"."POD_LEKAR" ADD CONSTRAINT "PK_POD_LEKAR" PRIMARY KEY ("CISLO_PODANI", "LEKAR_ID")
USING INDEX "J_PNP_TAB"."PK_POD_LEKAR" ENABLE;
DDL preview generated by PL/SQL Developer Beta:
alter table POD_LEKAR
add constraint PK_POD_LEKAR primary key (CISLO_PODANI, LEKAR_ID)
using index;
Compare user objects generated DDL script:
alter table POD_LEKAR
add constraint PK_POD_LEKAR primary key (CISLO_PODANI, LEKAR_ID);
The name of the index has to be present in DDL if it was used to create the constraint. Otherwise, the result on target DB after applying DDL script can be wrong.
You can find it @data dictionary:
select INDEX_OWNER, INDEX_NAME
from user_constraints
where constraint_name = '&PK_NAME';
I hope it will be fixed in next version
Regards,
Robert
this bug (release notes: DDL for Table primary/unique keys was not correct when based on other indexes) is still not fixed.
Correct DDL generated by Oracle SQL Developer:
ALTER TABLE "J_PNP_TAB"."POD_LEKAR" ADD CONSTRAINT "PK_POD_LEKAR" PRIMARY KEY ("CISLO_PODANI", "LEKAR_ID")
USING INDEX "J_PNP_TAB"."PK_POD_LEKAR" ENABLE;
DDL preview generated by PL/SQL Developer Beta:
alter table POD_LEKAR
add constraint PK_POD_LEKAR primary key (CISLO_PODANI, LEKAR_ID)
using index;
Compare user objects generated DDL script:
alter table POD_LEKAR
add constraint PK_POD_LEKAR primary key (CISLO_PODANI, LEKAR_ID);
The name of the index has to be present in DDL if it was used to create the constraint. Otherwise, the result on target DB after applying DDL script can be wrong.
You can find it @data dictionary:
select INDEX_OWNER, INDEX_NAME
from user_constraints
where constraint_name = '&PK_NAME';
I hope it will be fixed in next version

Regards,
Robert