Skip to content

Instantly share code, notes, and snippets.

@alagram
Created March 31, 2014 10:23
Show Gist options
  • Select an option

  • Save alagram/9889458 to your computer and use it in GitHub Desktop.

Select an option

Save alagram/9889458 to your computer and use it in GitHub Desktop.
Add timestamps
# Run this on console
rails generate migration add_timestamsps
# Then change migration file as seen here
class AddTimestamps < ActiveRecord::Migration
def change
add_column :table_name, :created_at, :datetime
add_column :table_name, :updated_at, :datetime
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment