I think that only happens when you use def change so that when you reverse the migration it knows how to add the column back.
I think if you do the old migration style of def up / def down you don't need to specify the column type in your remove_column > On Nov 14, 2016, at 1:47 PM, Gabriel Matos <[email protected]> > wrote: > > Hello guys, > > I've been using Ruby for a long time now and a simple doubt always make me > wonder.... > Why do i need do specify the column type when removing a column? > > I always do the following when removing a column: > > remove_column :table, :column, :type > > But the thing is...isn't the column name unique? Or can i have multiple > columns with same name but different types? > > Sorry if it's a stupid question tho :P > > Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at https://groups.google.com/group/rubyonrails-core > <https://groups.google.com/group/rubyonrails-core>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. ---- Jason Fleetwood-Boldt [email protected] http://www.jasonfleetwoodboldt.com/writing If you'd like to reply by encrypted email you can find my public key on jasonfleetwoodboldt.com <http://jasonfleetwoodboldt.com/> (more about setting GPG: https://gpgtools.org) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.
