Updating schema , API updated but UI does not

Hello guys, i’m really new to this i have a small database structure and i used forest to have a small backoffice and host the API on Gcloud.
It worked, but now i need to update the schema:

  • I normally ran the forest schema:update before deleting the files necessary and it worked.
  • then I deployed the new version on gcloud which works fine when i curl the new field.

BUT the dashboard does not update with the new field .

EDIT: after double checked: .forestadmin-schema.json has not been updated, i cant understand why

Hello Jules,
Please, can you give me your project name and your environment ?
Thanks you

Yep :

Project name : rayon
Schema failed to update on all environment: i have development rayon-staging and rayon-prod as usual

Hello,
I am checking your different schema and they are identical.
What fields are not displayed?
Also, in FA when you add a new collection/segment you should edit your layout to turn on the visibility.

1 Like

It’s not a new collection/segment, it’s just a new field.
It’s the field days in the entity membership.
What do you mean by editing the layout ?

I’m trying but i can’t see any new fields to display

Hey @Jules_Truong :wave:

Indeed, I can’t see the days field in your membership collection, and as @Alban_Bertolini stated, all your schema are identical across all your environments.

Could you please check:

  • On your Development environment, is the day field present in your .forestadmin-schema.json and in your models/membership.js file?

If it is, restarting your development server should work as expected
If it isn’t, delete your models/membership.js and re-run forest schema:update to re-create it.

As a side note, here is the “classic” workflow:

  • Each time your development server starts (Using NODE_ENV !== production), your .forestadmin-schema.json` is re-generated and sent to our servers.
  • Each time your remote or production server starts (Using NODE_ENV === production), your .forestadmin-schema.json isn’t regenerated, but it’ll still be sent to our servers.

Let me know if that helps

I might sound silly, but how do I restart my development server

Also, in my forestadmin-schema.json there is no days field, but it’s present in models/membership.js

By stopping and re-running npm start/yarn start

It should re-generate your .forestadmin-schema.json

Ok perfect, it’s been generated.

How do i push now ?

Nice. I can see that indeed, your .forestadmin-schema.json was updated on your local environment.

How do i push now ?

This really depends on your servers, production/staging environment etc. You’ll most likely have to commit/push your .forestadmin-schema.json along with all your others models changes, and deploy these changes on your servers.

As long as your .forestadmin-schema.json & your code modification are deployed, everything should sync normally.

Yeah but how do i do that , i’m really sorry , this must be basic knowledge for you, but the documentation is not that clear :frowning:

should i run forest schema:apply ?? because i did , and this changed nothing

Yeah but how do i do that , i’m really sorry , this must be basic knowledge for you, but the documentation is not that clear

Not really :sweat_smile: it’s just that I don’t know how you handle your code changes and how your code is deployed to your servers.

If you deploy all your code changes & your .forestadmin-schema.json to your own servers, everything should be automatic (Since the schema is sent once your server restart)

ok i’m just deploying the API on Google App Engine and that should be good.

What does forest schema:apply tho ?

EDIT: ok new API is deployed (for staging only) but nothing changes on the dashboard
EDIT2: seems like it took some time , but it’s finally there
EDIT3: thx !

1 Like

Everything is working as expected on your end then ?

I’ll mark the thread as solved. Feel free to open a new thread if you encounter any other issue :+1:

but still this issue exists