A) The code above and https://rails.lighthouseapp.com/projects/8994/tickets/6356
are the same except for the line wrapping.
B) HOBO is generating those migrations. So do you imply that Hobo is
generating wrong migrations?
C) Yes, the development.log contains entries for migrations. THERE ARE
NO LOG ENTRIES in the log for any remove index operations.

So remove_index statements are just no operations.

We are running into this whenever we rename a model class. Then
related indexes are dropped and readded with the new name. As we
rename the classes the number of indexes we have are forever growing.




On Feb 1, 8:23 pm, Matt Jones <[email protected]> wrote:
> On Feb 1, 2011, at 1:25 PM, umuro wrote:
>
>
>
>
>
>
>
>
>
> > Rails 2.3.8
> > sqlite3 1.3.3
>
> > If we run any migration (rake db:migrate) that includes a
> > "remove_index" statement then the index still stays in the sqlite3
> > datebase.
>
> > No errors or exceptions are recieved during the execution.
>
> > Examples:
>
> > remove_index :enrollments, :name
> > => :index_team_participations_on_event_id
> > remove_index :enrollments, :name
> > => :index_team_participations_on_country_id
> > remove_index :enrollments, :name
> > => :index_team_participations_on_boat_id
> > remove_index :enrollments, :name
> > => :index_team_participations_on_boat_id_and_event_id
> > Table names and index names were correct in our experiment.
>
> This is not quite what's in the ticket:
>
> https://rails.lighthouseapp.com/projects/8994/tickets/6356
>
> The above statements would *definitely* not work, as they'll be looking for 
> indexes named index_enrollments_on_name etc, while the ticket #6356 version 
> has explicit names.
>
> Do you get any messages in the log? The 2.3.8 remove_index stuff was tweaked 
> to complain when an index was missing instead of blowing up (as it was very 
> bad for MySQL, etc to have a half-complete migration).
>
> In the meantime, you might want to try manually dropping the indexes in your 
> favorite SQLite3 commandline or GUI. Before that, though, for debugging it 
> would be helpful to have the output of this command:
>
> ActiveRecord::Base.connection.indexes(:enrollments)
>
> to see if Rails and/or Hobo are getting confused.
>
> --Matt Jones

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to