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.
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.
Integrated into 'main-golden', will be available in build *200906190201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Jiri Skrivanek <firstname.lastname@example.org>
Log: #112137 - Drop support for add column to index.