Easiest way to update schema in standalone agent

We are currently running a forestadmin agent as a standalone in production. We don’t do any sort of development whatsoever, all we need is the default UI for our sql database. This works fine.

Now we need to update the database schema. How can we easily regenerate the database schema for our production agent?

The documentation mentions deploying the changes from a development environment. Does that mean we need to run a second agent with NODE_ENV=development and make our changes there? Is there a step-by-step-instruction for this process?

Hello @matthias-noetzli and welcome to the community!

We have a note that details the working of the schema, you could also infer our best practices from this documentation. Which is indeed to use a development environment to generate the schema file and then commit it.

If this is not an appropriate solution and you are not too fearful of losing frontend UI customization you can bypass this and directly generate the schema on every startup of your production agent by setting isProduction to false in your agent configuration.

require('dotenv').config();

// Import the requirements
const { createAgent } = require('@forestadmin/agent');

// Create your Forest Admin agent
createAgent({
  // These process.env variables should be provided in the onboarding
  authSecret: process.env.FOREST_AUTH_SECRET,
  envSecret: process.env.FOREST_ENV_SECRET,
  isProduction: false,
})
  .mountOnStandaloneServer(3000)
  .start();