Edited frappe json files not updating in production

Hi, I have edited some frappe json files (customize_form_field.json, docfield.json, custom_field.json) to add some custom data types and made relevant changes in js files. On my local machine, when I run

bench migrate
bench build
bench build --app frappe
bench clear-cache
bench restart

These changes appear on my system but when I do the same for production server, the json files are not updating. js compiles fine but added field types in json are not showing up.

What can I do to remedy this situation?

When you run a 'bench migrate' command, 2 schemas are compared:

  • The schema defined in the JSON files.
  • The schema defined in SQL tables DocType and DocField

To determine which one “wins”, Bench compares their “modified” datetime values.

If you manually edit a JSON schema file, you must increase the value of “modified” to something newer than the value in the SQL tables. Otherwise, your JSON will be ignored.

You only need to edit this value if you manually edit the JSON files.
When making changes through the browser, the value is incremented for you automatically.

3 Likes

You sir are a saint. Thank you very much.

Is this still necessary? I can’t find it now, but I thought I read “somewhere” it’s no longer needed to change the modified datetime value in the json file.

I recently added a new field to a doctype in the payments app, forgot to update the modified datetime value, and the doctype was modified after bench migrate successfully.

EDIT: I should clarify that the change was made in a forked payments github repository, a docker image built from it, then an existing database was migrated with bench migrate. The json file wasn’t directly edited on a production server.

I just tested the same scenario in Version 15, and I agree:

Seems no longer necessary.