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...
  • June 3, 2022
  • 0 Comments
What’s the syntax for dropping a database table column through a Rails migration? 23 s 23 remove_column :table_name, :column_name For instance: remove_column :users, :hobby would remove the hobby Column...
  • April 27, 2022
  • 0 Comments