Running migrations on fixtures creates duplicates of all the data

I’m very new to frappe framework and fairly frustrated with fixtures :sweat_smile:

The current flow we’re following is, for every doctype, which has data that We’d want to have version control over (eg workflows, workspaces and notifications), We’ll add those doctypes to fixtures in our application hooks. The other developers can just use git pull and hit bench migrate, and it should work.

It works but the problem arises when any of us export our changes and hit bench migrate for the second time. It creates multiple copies of the same, both in db and fixtures. It’s getting harder for us to measure where else, and how many copies of the data may be existing in each of our instances.

I did find it somewhere that migrations used to clear all the data in those doctypes and would override them with the changes. (i’m fine with this approach too) but the frappe dev team had issued some fix to it which i’m failing to locate for ref. all it remember is this was changed in either v11 or v12 of frappe

1 Like

One thing which I’ve learned just now is that fixtures shouldn’t be used for exporting just about any doctype that we have.

To export Workspaces Check this :

I’m now unclear as to what exactly should be exported through fixtures.
Also, still trying to find solutions for exporting notifications and workflows, Will update soon as I succeed.