Change a model or retire it
Change the fields or settings of a model, or retire a model you no longer use. Saving a change keeps your entries, and retiring hides the model without deleting its entries.
Before you start
- You need a WordPress account with administrator rights.
- The model exists. See Create a model.
Save a model change
Each save creates a new version of the model.
- Go to Morphic > Models.
- Open the model.
- Change the fields or settings.
- Select Save changes.
Result: the app shows Saved as version followed by the new version number. The Save changes button turns into Saved until you change something again.
Rename a field
Renaming a field changes the name that API clients see. Morphic upgrades the existing entries to the new name.
- Open the model.
- On the Fields tab, select the field you want to rename.
- In API name, enter the new name.
- Select Save changes.
- In the Rename 1 field? dialog, check the list of renamed fields. For more than one field, the title reads Rename N fields?.
- Select Save and rename.
Result: the entries keep their values under the new field name, and the model version goes up by one.
Edit the model in the JSON tab
Use the JSON tab to edit the full definition of the model.
- Open the model and go to JSON.
- Edit the definition.
- Select Apply JSON.
- Select Save changes.
If the text is not valid JSON, the app shows Not valid JSON with the parser message, and the definition does not change. Renames made in the JSON tab are not tracked, so they do not upgrade existing entries. Rename fields in the Fields tab instead.
Note: A model's kind cannot change. Morphic refuses the save with the message "the kind of a type never changes".
Retire a model
Retiring hides the model from the editor and from the API. Its entries stay in the database.
Warning: Other models that link to this model block the retire. Change those models first.
- Open the model.
- Select Advanced.
- In the Retire this model callout, select Retire.
- In the Retire dialog for the model, select Retire.
Result: the app returns to the Models list, and the model no longer appears there. API requests for the model return "type ... not found".