cirandas.net

ref: master

db/migrate/20150722042714_change_article_date_to_datetime.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class ChangeArticleDateToDatetime < ActiveRecord::Migration

  def up
    change_table :articles do |t|
      t.change :start_date, :datetime
      t.change :end_date, :datetime
    end

    change_table :article_versions do |t|
      t.change :start_date, :datetime
      t.change :end_date, :datetime
    end
  end

  def down
    change_table :articles do |t|
      t.change :start_date, :date
      t.change :end_date, :date
    end

    change_table :article_versions do |t|
      t.change :start_date, :date
      t.change :end_date, :date
    end
  end

end