Answers for "how do I add timestamps to a table"

0

how do I add timestamps to a table

class AddTimestampsToUser < ActiveRecord::Migration
  def change_table
    add_column :users, :created_at, :datetime, null: false
    add_column :users, :updated_at, :datetime, null: false
  end
end
Posted by: Guest on March-04-2020

Code answers related to "how do I add timestamps to a table"

Browse Popular Code Answers by Language