Migrations drop user indices
Reported by Bryan Larsen | November 28th, 2009 @ 11:07 PM | in Hobo 1.0 - Final
If you have any extra indices in your database, the migration generator drops them without asking in the manner that it does if you remove a column
Comments and changes to this ticket
-
Matt Jones November 30th, 2009 @ 05:14 AM
- Assigned user set to Matt Jones
- Milestone set to Hobo 1.0 - Final
-
Tom Locke December 1st, 2009 @ 09:24 AM
- State changed from new to investigating
I don't see this as so bad. You're not risking losing data, as you are when columns are removed.
-
Bryan Larsen December 1st, 2009 @ 12:55 PM
It does break the migration, so if somebody presses "m" they get a nasty error. You have to press "g", remove or fixup the offending line and run the migration manually.
Not the worst thing in the world, but it'd be nice to clean up.
-
Tom Locke December 1st, 2009 @ 01:01 PM
Matt - by "exrta indexes" do you mean indexes that aren't declared or implied by the models? i.e. similar to the problem where the migration generator want to drop tables that it doesn't know about? If so I guess we need an
ignore_indexes
Bryan - what error is this?
-
Bryan Larsen December 1st, 2009 @ 01:26 PM
Sorry, Tom, I mixed this bug up with #557. So ignore the comment.
Answering your question for Matt, yes, that's exactly it.
-
Tom Locke December 1st, 2009 @ 08:23 PM
- State changed from investigating to resolved
(from [8b16d7396441dba0ecfd44a93e7aeccc37f5cf51]) [#555 state:resolved] add ignore_index declaration to avoid dropping user indices http://github.com/tablatom/hobo/commit/8b16d7396441dba0ecfd44a93e7a...
-
Matt Jones December 1st, 2009 @ 08:59 PM
The fix committed above is only partial - the ignore_index line is handy to tell the migration generator to leave things alone.
Still not entirely ideal, but the problem is that there's quite a few instances where an index should be dropped without asking the user; for instance, we currently do it when renaming a table. It seems likely to be tricky to catch those cases automatically, and the alternative is to pester the heck out of the user.
See also #564.
-
Tom Locke December 1st, 2009 @ 10:09 PM
Any idea how to fix this problem that changes coming from github look like they're by me?
-
Bryan Larsen December 1st, 2009 @ 11:50 PM
Tom: Matt should go into his Lighthouse profile and set his "committer name" for Hobo to "al2o3cr"
-
Betelgeuse December 2nd, 2009 @ 01:02 AM
Matt Jones actually as his commits are labeled: Author: Matt Jones al2o3cr@gmail.com
-
Matt Jones December 2nd, 2009 @ 01:24 AM
Done, although it's not going to fix the old ones. Talk about a misfeature; I'd have assumed that "default the committer name to the display name" was a pretty straightforward default...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
People watching this ticket
Referenced by
- 555 Migrations drop user indices (from [8b16d7396441dba0ecfd44a93e7aeccc37f5cf51]) [#555 s...
- 563 Ask user before dropping indexes (continuation of #555)
- 563 Ask user before dropping indexes The ignore_index option added in #555 may not be ideal fo...
- 564 Ask user before dropping indexes (continuation of #555)
- 564 Ask user before dropping indexes The ignore_index option added in #555 may not be ideal fo...