回答:
最初にあなたのターミナルで:
rails g migration change_date_format_in_my_table
次に、移行ファイルで:
Rails> = 3.2の場合:
class ChangeDateFormatInMyTable < ActiveRecord::Migration
  def up
    change_column :my_table, :my_column, :datetime
  end
  def down
    change_column :my_table, :my_column, :date
  end
end
              また、Rails 3以降を使用している場合は、upおよびdownメソッドを使用する必要はありません。あなたはただ使うことができますchange:
class ChangeFormatInMyTable < ActiveRecord::Migration
  def change
    change_column :my_table, :my_column, :my_new_type
  end
end
              This migration uses change_column, which is not automatically reversible. To make the migration reversible you can either: 1. Define #up and #down methods in place of the #change method. 2. Use the #reversible method to define reversible behavior.
                    Rails 3.2とRails 4では、Benjaminの人気のある回答の構文は少し異なります。
最初にあなたのターミナルで:
$ rails g migration change_date_format_in_my_table
次に、移行ファイルで:
class ChangeDateFormatInMyTable < ActiveRecord::Migration
  def up
   change_column :my_table, :my_column, :datetime
  end
  def down
   change_column :my_table, :my_column, :date
  end
end
              change_columnメソッドがあり、新しいタイプとしてdatetimeを使用して移行で実行するだけです。
change_column(:my_table, :my_column, :my_new_type)
              私の知る限り、移行では、スキーマを変更するときに、気になるデータ(つまり本番)を再形成しようとします。それでそれが間違っていない限り、そして彼はデータを気にしないと言ったので、元の移行の列タイプを日付から日付時刻に変更して、移行を再実行してみませんか?(テストがあることを願っています:))。
rake db:migrate:resetは、それが目的です。