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.
In DB Explorer, open Tables, and right-click on a Table, choose Add Column... Enter in any name, and then select the primary key index (the one with the very long name if you're using Java DB), and click the Index box. Click OK This fails, saying it is unable to drop the primary key index. It should either not let you select the primary key index, or get this to work (which I don't think is possible).
Looks quite tricky. Not sure it is possible to detect that an index cannot be dropped beforehand. (For Derby, it seems indexes for primary and foreign keys cannot be dropped without dropping that constraint first.) Any ideas? I think I'd rather suggest dropping the whole "add column to index" stuff from the Add Column. First, it doesn't work in some cases. Second, I don't think it's that common to add new columns to an index. Third, when the user really wants that, (s)he should manage indexes explicitly (I know I would). Fourth, when it succeeds adding the column, it doesn't seem to maintain the column order (ascending or descending).
+1 to this. The logic behind this code was somewhat disturbing. It first drops the index, and then re-creates it. If something goes wrong during the create, then the index is just *gone*. Not what you want at all. I agree the user should just manage this manually by dropping and re-creating the index.
Let's drop support for add column to index.
*** Issue 128754 has been marked as a duplicate of this issue. ***
Reassigned to new owner.
Support for add column to index dropped. core-main #b81adbf87149
Integrated into 'main-golden', will be available in build *200906190201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b81adbf87149 User: Jiri Skrivanek <jskrivanek@netbeans.org> Log: #112137 - Drop support for add column to index.