How to deploy to environment after updating local schema?

:warning:This is a template you must use to report issues. :warning:
You can also drag images, videos and include Preformatted text.

Feature(s) impacted

Deployment and schema update

Observed behavior

After updating the schema and running the following commands, it returns the following error:

npx forest-cli@latest schema:update
npx forest-cli@latest deploy Development -p xxxxx

× Source and destination environments must have the same schema. Please check your environments code is synchronized.

Expected behavior

I expect forest deploy can push update after changing the schema

Failure Logs

In this optional section, please:

  • include any relevant log snippets if necessary,
  • or remove this section if left empty.


Please provide in this mandatory section, the relevant information about your configuration:

  • Project name: AdminConsole
  • Team name: LevaClinic
  • Environment name: Development
  • Agent type & version: N/A
  • Recent changes made on your end if any: …

Hi @winston0410 !
Just to clarify a few things:

  • The schema:update command allows you to update your forest files (the models, routes etc.) based on the changes that you made in your database. The `forestadmin-schema.json is computed when you start your server.
  • The deploy command allows you to push changes made to your layout (UI Customization) changes to another environment on ForestAdmin.

To update the forestadmin-schema.json on a production environment you need to copy the right version as there is no computation of the schema in prod.

If this doesn’t help you, could you tell me more about what youa re trying to achieve ?

I just want to update the change I have from local to the remote, as I have added some smart actions, I have run the following commands already but no luck at all:

npx forest-cli@latest schema:update  # This is fine. 
npx forest-cli@latest schema:apply # I am running this because I hit error 'Source and destination environments must have the same schema. Please check your environments code is synchronized.' when I run `forest deploy`
npx forest-cli@latest deploy Development # And then I hit the error here

I checked your schemas on dev and prod, and they are not the same, therefore you can’t deploy your layout changes to production. Can you push your changes to your production server and try again ?