Closed GoogleCodeExporter closed 8 years ago
Yes, drop constraint does not drop its index, if the index is still needed for
another constraint.
> There is no simple way to alter Liquibase-Files
I don't think you need to alter the files, but instead couldn't you drop the
constraint and re-create it, before dropping the name column? As follow:
ALTER TABLE child DROP CONSTRAINT fk_child;
ALTER TABLE child ADD CONSTRAINT fk_child FOREIGN KEY (fk) REFERENCES parent
(id);
ALTER TABLE child DROP COLUMN name;
By the way, the rows in the table information_schema.indexes are index columns,
not necessarily indexes.
-- there are 4 indices: one for the PK, one for the FK and two for the unique
constraint
Actually, there are only 3 indexes:
PRIMARY_KEY_3 on (id)
FK_CHILD_INDEX_3 on (fk)
KEY_CHILD_INDEX_3 on (fk, name)
-- there are 3 (!) indices: one for the PK, NONE for the FK and two for the
unique constraint
Actually, there are only 2 indexes:
PRIMARY_KEY_3 on (id)
KEY_CHILD_INDEX_3 on (fk, name)
After dropping the key_child, there are still those 2 indexes, as an index is
needed on "fk".
-- I cannot drop the name column
Yes, as there is still an index.
Original comment by thomas.t...@gmail.com
on 29 Jul 2013 at 7:28
I don't plan to change the current behavior right now. If you have a solution,
patches are welcome, but as for myself I don't see an urgent need to change
anything.
Original comment by thomas.t...@gmail.com
on 19 Oct 2013 at 8:37
Original issue reported on code.google.com by
manfred....@gmail.com
on 14 May 2012 at 12:46