Add timestamps to an existing table

I need to add timestamps (created_at & updated_at) to an existing table. I tried the following code but it didn’t work.

class AddTimestampsToUser < ActiveRecord::Migration
    def change_table
        add_timestamps(:users)
    end
end

21 Answers
21

Leave a Comment