Add a column

Ensure that the migration is run before the new code is deployed. Otherwise, nothing to do.

Remove a column

  1. In your ActiveRecord model: self.ignored_columns += %w[column_i_want_removed]
  2. Deploy code change
  3. Add migration to remove column
  4. Deploy migration
  5. Remove self.ignored_columns

Rename a column

  1. Add new column
  2. Deploy migration
  3. Change code to write to both old and new column
  4. Deploy
  5. Run a backfill script which sets the new column to values of the old
  6. Change code to use the new column, set the old column to self.ignored_columns
  7. Deploy
  8. Add migration to remove the old column
  9. Deploy migration
  10. Remove self.ignored_columns