I am trying to migrate some datetime columns in MySQL to timestamp type. In ActiveRecord migration I have:
change_column(:oe_tags, :created_on, :timestamp)
however the sql it generates is
ALTER TABLE `oe_tags` CHANGE `created_on` `created_on` datetime DEFAULT NULL
which is obviously NOT a timestamp type, but rather datetime (which it already is). How do I get an alteration to timestamp
? According to the documentation :timestamp is a valid symbol.
Edit: Perhaps I did not make myself clear (apologies). I would like to know the proper change_column specification in ActiveRecord migration in Rails. I already KNOW the proper SQL I expect. How to achieve it via an ActiveRecord Migration is the question.