This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
------- Comment #6 From bht 2010-11-25 02:21:31 (-) [reply] ------- There are multiple nested duplicates. If the chain of duplicates is correct, then the description may have to be changed to something like: "In Database Explorer, two tables cannot be dropped at all if both have foreign key contraints referencing each other" This is a very irritating showstopper because Database explorer does not provide a means to copy the names of foreign key constraints to the clipboard. It might not be a big issue to drop constraints before dropping tables, and therefore, I change the priority to hopefully get this done in the next release. ------- Comment #7 From bht 2010-11-25 02:29:03 (-) [reply] ------- Testcase: This is relevant for one-to-one relationships. Testcase: CREATE TABLE TABLE_1 (ID INTEGER NOT NULL, TABLE_2_ID INTEGER NOT NULL, PRIMARY KEY (ID)); CREATE TABLE TABLE_2 (ID INTEGER NOT NULL, TABLE_1_ID INTEGER NOT NULL, PRIMARY KEY (ID)); ALTER TABLE TABLE_1 ADD CONSTRAINT FK_TABLE_1_TABLE_2_ID FOREIGN KEY (TABLE_2_ID) REFERENCES TABLE_2 (ID); ALTER TABLE TABLE_2 ADD CONSTRAINT FK_TABLE_2_TABLE_1_ID FOREIGN KEY (TABLE_1_ID) REFERENCES TABLE_1 (ID); When trying to drop the tables in Database Explorer by right click|delete, the error is: Unable to execute command: drop table "APP"."TABLE_2" Operation 'DROP CONSTRAINT' cannot be performed on object 'SQL100704071938090' because CONSTRAINT 'FK_TABLE_1_TABLE_2_ID' is dependent on that object. This looks like a bug because Database Explorer seems to try to drop constraints two times. This worked as expected: ALTER TABLE TABLE_1 DROP CONSTRAINT FK_TABLE_1_TABLE_2_ID; ALTER TABLE TABLE_2 DROP CONSTRAINT FK_TABLE_2_TABLE_1_ID; DROP TABLE TABLE_1; DROP TABLE TABLE_2;