4 ms·
How do you do it without throwing an error? My philosophy has been to ignore the error if it's a re-application of the migration because the migration _is_ ide
by jackthetab 8y ago
How do you do it without throwing an error?
My philosophy has been to ignore the error if it's a re-application of the migration because the migration _is_ idempotent. So ALTER TABLE foo ADD COLUMN bar INT either succeeds (because there is no bar column) or it fails (because there is a bar column) with no harm done.
- joombaga 8y agoThis would work if you're just ignoring that specific error, but it's better to guard for idempotence. Only apply that ALTER if COLUMN bar doesn't already exist.