Closed richardboehme closed 3 years ago
Hi, the error message you provided looks a bit weird but I see the problem. It is a bug in Jennifer (at least taking into account current "architecture" used for table manipulations). Will address it tomorrow (likely)
Hi, the error message you provided looks a bit weird but I see the problem. It is a bug in Jennifer (at least taking into account current "architecture" used for table manipulations). Will address it tomorrow (likely)
Yeah I was confused from the error message at first. But after looking at the way #change_column in Jennifer and #drop_column in the SQLite3 adapter work it made sense to me. Thanks for looking into this!
Jennifer received a fix for this issue
Dropping an indexed column fails with the message:
Example:
The
drop_column
method in the SQLite3 adapter was just recently added and tries to create all indexes on the new table. However, if the dropped column has an index, this fails. I see two solutions to this:Jennifer::SQLite3::SchemaProcessor#drop_column
to create each index except the ones that contain the dropped column. However this would automatically drop all indexes related to a dropped column when calling #drop_column. I'm not sure how other ORMs handle this situation but I think this may be too implicit.Possible workaround: Use #drop_index in a separate call in the migration like this:
Environment:
Crystal: 1.1.1 jennifer: 0.11.1 jennifer_sqlite3_adapter: 0.3.2