Models

Your models are located in /models. They control a big part of your Forest UI.

Reflecting your database changes in your UI

When you install for the first time or later use lumber update, Lumber introspects your database and generates your models accordingly.

Here's how your database changes can be rendered in your Forest UI:

The command lumber update will update your models’ definition according to your database schema. It will automatically add your new tables and fields.

lumber update is not available for MongoDB. You'll have to update your models manually.

lumber update works for adding tables and fields but not for deleting. In this case, it will have to be done manually.

If your admin backend is running in a Docker container, you'll have to run the following command instead: docker exec -it <your_container_name> lumber update

The .forestadmin-schema.json file

On server start, a .forestadmin-schema.json file will be auto-generated in local environments only: it reflects the state of your models (in /models).

This file must be versioned and deployed for any remote environment (staging, production, etc.), as it will be used to generate your Forest UI.

Do not edit this file, as it could break your interface if the wrong syntax is used.

Versioning the.forestadmin-schema.json file will also help you visualize your changes:

Enriching your models

Lumber does some of the work for you. However, you remain in control of your models.

On the following page, we'll cover how you can enrich your models.