mardi 5 février 2019

is it possible to remove a script from a existing migration file rails

So the thing is i pulled new changes from git, in this new changes there is a migration file

def change
  add_column :users, :activated_at, :datetime
  User.all.each do |user|
  user.update(activated_at: user.updated_at)
end

now normally if i want to undo a migration ie remove a column say activated_at i have to run another migration to do so which is fine

but if i just want to remove the script ie user.update(activated_at: user.updated_at), do i have to create another migration or do i just remove the script from the migration

note: i dont want to remove the activated_at column, i just want to remove the script

Aucun commentaire:

Enregistrer un commentaire