mysql - Change a column type from Date to DateTime during ROR migration -


i need change column type date datetime app making. don't care data still being developed.

how can this?

first in terminal:

rails g migration change_date_format_in_my_table 

then in migration file:

for rails >= 3.2:

class changedateformatinmytable < activerecord::migration   def     change_column :my_table, :my_column, :datetime   end    def down     change_column :my_table, :my_column, :date   end end 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -