Imagine one table, T, with two fields, A and B, with one index on them (I).
Right now, if we try to drop the T->A field, this happens:
- MySQL: The index is "magically" transformed to index B only (crazy, imagine if the index is an unique one!)
- PG: The index is dropped automatically (acceptable)
- Oracle: The index is dropped automatically (acceptable)
- MSSQL: The operation is forbidden. Index must be dropped first (consistent)
Obviously, that isn't cross-db at all. And I guess this behaviour will affect also other functions like those changing field specs.
The question is, in order to get one homogeneous behaviour in our DB API... which approach should we follow:
1) Prevent any modification in one field if there are indexes on it. Throw exception if such "dependencies" are found.
2) Automatically drop (dependent) indexes.
My personal vote goes to 1 (prevent and throw exception). But wanted to hear from you... ciao