Consider the table creation script below:
create_table :foo do |t| t.datetime :starts_at, :null => false end
Is it\'s possible to set
I usually do:
def change execute(" ALTER TABLE your_table ALTER COLUMN your_column SET DEFAULT CURRENT_TIMESTAMP ") end
So, your schema.rb is going to have something like:
schema.rb
create_table "your_table", force: :cascade do |t| t.datetime "your_column", default: "now()" end