maybe I should add migrations...
This commit is contained in:
6
db/migrate/20150423221202_add_timestamps_to_info.rb
Normal file
6
db/migrate/20150423221202_add_timestamps_to_info.rb
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
class AddTimestampsToInfo < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :info, :created_at, :datetime
|
||||||
|
add_column :info, :updated_at, :datetime
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
class AddTimestampsToExistingInfo < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
Info.all.each do |i|
|
||||||
|
i.update_attributes(created_at: Time.now)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user