> ## Documentation Index
> Fetch the complete documentation index at: https://docs.forest.app/llms.txt
> Use this file to discover all available pages before exploring further.

# forest schema:update

> Generate the model files missing from a legacy Forest back-end

# forest schema:update

Refresh the schema of a legacy back-end (`forest-express-sequelize` or `forest-express-mongoose`) by generating the files that do not exist yet, such as the models of new tables. Existing files are not modified. Run it from the root of the back-end.

## Usage

```bash theme={null}
forest schema:update [options]
```

## Options

| Option | Description |
| - | - |
| `-c, --config` | Database configuration file to use. Default `config/databases.js` |
| `-o, --outputDirectory` | Directory where to generate the new files |

The command reads `DATABASE_SCHEMA` from the environment when it is set.

> [!NOTE]
>
> Back-ends built on `@forestadmin/agent` introspect the database when they start and do not need this command.

## Examples

```bash theme={null}
# Generate the missing files
forest schema:update

# Use another database configuration and output directory
forest schema:update --config config/databases.js --outputDirectory generated
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.