By default, Oil set datatype of created_at and updated_at fields as int. I want to change created_at datatype to datetime. How to do it via Oil command.
I suggest the same: if you use the timestamp (the int that is saved into DB) you are able to convert it in every kind od datetime you want, so if you have to use different date (like in a blog, where in the link usually is used the year and the month link "mysuperblog.com/post/2012/11/super-title.html") it takes seconds instead of hours to parse the datetime.
Not the way you think, oil just generates migrations, it doesn't change the database.
You can start a the Oil console on the commandline and then just type a DB::query() command, but I think it's easier to do it directly either through the mysql binary or a tool like phpmyadmin.
Indeed they are a mess to work with those datetime objects (but somethimes customers ask for exports and they don't like those timestamps), I have created a migration that scans your db for created_at and updated_at fields when the migration finds them it sets the types to datetime( without loss of data).
after the migration you just run trough your models setting every 'mysql_timestamp' => true,