Well, the title pretty much says it all, but here it is again: will drop_table also remove any indexes for that table? Or do we need to specify each index in the down migration? I tried looking through the drop_table documentation, but didn''t see it mentioned. I also checked some of the more popular open source projects, and they just drop_table, but don''t remove any indexes. Maybe rails takes care of this as part of its "magic" ? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en.
The database itself probably deletes indices for tables that no longer exist. You should check your database''s documentation to be sure. ~David On Tue, Apr 13, 2010 at 2:49 PM, GoodGets <goodgets-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Well, the title pretty much says it all, but here it is again: will > drop_table also remove any indexes for that table? Or do we need to > specify each index in the down migration? > > I tried looking through the drop_table documentation, but didn''t see > it mentioned. I also checked some of the more popular open source > projects, and they just drop_table, but don''t remove any indexes. > Maybe rails takes care of this as part of its "magic" ? > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en.
That is a database function. Dropping a table will also drop the indexes (at least for MySQL and SQL Server). Foreign key constraints are another issue. If you have added them (i.e. via foreign_key_migrations), you would have to explicitly remove them in your down migration before dropping the parent table. On Apr 13, 2:49 pm, GoodGets <goodg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Well, the title pretty much says it all, but here it is again: will > drop_table also remove any indexes for that table? Or do we need to > specify each index in the down migration? > > I tried looking through the drop_table documentation, but didn''t see > it mentioned. I also checked some of the more popular open source > projects, and they just drop_table, but don''t remove any indexes. > Maybe rails takes care of this as part of its "magic" ?-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en.