We have two custom apps (well actually three, but only two matter here). The first is our open-source under development eBay semi-integration app (doesn’t do a great deal at the moment except generate sales invoices, and that in a fairly hacky way which needs a lot of tidy up). The second app is our private custom app for our own customizations (lots of in-house detail with something between almost no and zero applicability to anyone else).
I have just got to the point where both apps want to add custom fields to the Item doctype. I have followed my usual process of making the changes in ‘Customize Form’ and exporting them to JSON in the appropriate app (with a trivial bit of editing occasionally). The relevant item.json files only include the custom fields for each app; there is no duplication or overlap (other than both being in the Item doctype).
Unfortunately, bench migrate seems to make a massive hash of it, and behaviour becomes very erratic. At first migrate, it seemed to just ignore the customizations in the first app in favour of the second app (I have checked the migrate’s customization bit happens in the right order). On the second migrate (having changed nothing else, just run migrate again) the Customize Form only shows the customizations from the first app, not the second. But Custom Fields only shows the customizations from the second app, not the first. Looking at the actual Item shows the fields for the second app only but initially they were broken (they were all empty fields). After a restart the data has reappeared, but the customizations from app 1 are still missing.
I believe this is because the migrate process wipes all custom fields each time it runs a sync for a single doctype, whereas it ought to only do this once per migrate (if required). I haven’t considered how this fits in with app/fixtures/ files instead of app/custom/doctype.json files.