diff options
-rw-r--r-- | db/migrate/20150423221202_add_timestamps_to_info.rb | 6 | ||||
-rw-r--r-- | db/migrate/20150423221613_add_timestamps_to_existing_info.rb | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/db/migrate/20150423221202_add_timestamps_to_info.rb b/db/migrate/20150423221202_add_timestamps_to_info.rb new file mode 100644 index 0000000..61a8b58 --- /dev/null +++ b/db/migrate/20150423221202_add_timestamps_to_info.rb @@ -0,0 +1,6 @@ +class AddTimestampsToInfo < ActiveRecord::Migration + def change + add_column :info, :created_at, :datetime + add_column :info, :updated_at, :datetime + end +end
\ No newline at end of file diff --git a/db/migrate/20150423221613_add_timestamps_to_existing_info.rb b/db/migrate/20150423221613_add_timestamps_to_existing_info.rb new file mode 100644 index 0000000..a02a4ae --- /dev/null +++ b/db/migrate/20150423221613_add_timestamps_to_existing_info.rb @@ -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 |