Schema:update - New fields not updated

Hello,
I’m using Forest for a small project that I never touched since the first deploy.
I just updated my project and added some fields in the database (Postgres, using Prisma).

The new fields don’t show up in my admin panel. What should I do ?
I tried forest schema:update but the output is as below:

√ Connecting to your database(s)
√ Analyzing the database(s)
√ Disconnecting from your database(s)
  skip forest/alert-rules-to-monitor.js - already exists.
  skip forest/alert-rules.js - already exists.
  skip forest/job.js - already exists.
  skip forest/monitor.js - already exists.
  skip forest/run.js - already exists.
  skip forest/session.js - already exists.
  skip forest/user.js - already exists.
  skip models/alert-rules-to-monitor.js - already exists.
  skip models/alert-rules.js - already exists.
  skip models/job.js - already exists.
  skip models/monitor.js - already exists.
  skip models/run.js - already exists.
  skip models/session.js - already exists.
  skip models/user.js - already exists.
  skip routes/alert-rules-to-monitor.js - already exists.
  skip routes/alert-rules.js - already exists.
  skip routes/job.js - already exists.
  skip routes/monitor.js - already exists.
  skip routes/run.js - already exists.
  skip routes/session.js - already exists.
  skip routes/user.js - already exists.
√ Generating your files

It seems to skip the entire tables because those already exist. What should I do to update the schemas ?

Thanks,

Hi @Gp2mv3 and welcome to the community :wave:

It would help us to investigate if you could indicate us those information below :

  • Project name: …
  • Team name: …
  • Environment name: …
  • Agent type & version: …

And for the fields added, did you add some columns without data or does they already have data in it ?

Best regards,

Shohan

Hello,
Thanks for your message.
Here are the info:

  • Project name: Qualitycs
  • Team name: Operations
  • Environment: all
  • Agent type: node ? I followed the tutorial.
  • Forest-cli version: forest-cli/2.7.0 linux-x64 node-v16.15.1

Here are the dependencies package.json:

  "dependencies": {
    "body-parser": "1.19.0",
    "chalk": "~1.1.3",
    "cookie-parser": "1.4.4",
    "cors": "2.8.5",
    "debug": "~4.0.1",
    "dotenv": "~6.1.0",
    "express": "~4.17.1",
    "express-jwt": "6.1.2",
    "forest-express-sequelize": "^8.0.0",
    "morgan": "1.9.1",
    "require-all": "^3.0.0",
    "sequelize": "~5.15.1",
    "pg": "~8.2.2"
  }

Hope it helps !

To force-update your schema you can do : forest schema:update -o tmp to re-export all your models in a dedicated folder.
It should update the file with your new fields.

Nice, that works !

I just noticed that I had the exact same problem with another project. I forced an update and it solved the issue. I think the command line should skip files less easily.

For people that have the same issue, my solution is as follow:

forest schema:update -o tmp
cp -R ./tmp/* ./
rm -R tmp
1 Like