Database Restore Changes Doctype but does not reflect in Doctype's .json file

Just stumbled through a weird bug. We made our own Custom Doctype which is saved in our custom app. Whenever I restore a db (which is new), the Doctype gets reverted to a previous version. Eg. If I added a field before the restore, after the restore the field disappears.

Here’s the catch: The .json file of the doctype shows the missing field but the doctype doesn’t.

I’m pushing/pulling changes to/from our git repository. Not sure if it’s because of my current version of frappe (haven’t run update in the last few days) or because of a db bug.


@littlehera, try changing the modified date in .json file and migrate.



I just manually added the fields to our custom doctype. :sweat_smile: We only had 1 field disappearing on us so wasn’t a big deal. Still, thanks for this! I’ll keep it in mind in case if I’ll need it again!


1 Like

Thank you, changing the modified date in the .json file and then doing bench migrate updated the respective DocType in the DB.

The modified datetime in the .json file should be after the modified datetime of the respective DocType entry in the database.