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

python - Why doesn't list have safe "get" method like dictionary? -

razor - Is this a bug in WebMatrix PageData? -

sql server - Stored procedure -