[Fixed]-Django unapply migration

1👍

Let’s call the snippet accident and the additional one fix.

When writing custom SQL migrations you should usually provide the reverse part otherwise you can not roll it back to prior state without loosing the integrity of your schema and/or data.

accident should provide sql to revert itself. The fix that rolls accident back should therefor consist of both operations interchanged.

You might want to read about squashing migrations afterwards.

EDIT: the term operations might by confusing as it is part of the migration system 🙂 – will say: interchange sql and reverse_sql in fix migration

Leave a comment