Is there an easy way to manipulate existing data in migration scripts ?
I have a parameters column where parameters are separated by ";". I want to add a new parameter, so I want to update existing values (add ;0 at the end of the string).
Can I update using existing values in the column ?
Ah, yes. I just wrote a quick and dirty way that I usually do for me in the migrations. I don’t want to spend much time writing them and don’t care much about the performance.
Probably this may satisfy you.
update your-table set your-field = concat(your-field, ":0");