#hello, I have a Nodejs `appA` running on
1 messages · Page 1 of 1 (latest)
Hi @hollow umbra, thanks for sharing your case. About the questions you have,
- What is the auto_migrate for?
The auto_migrate dictates whether the database schema should be automatically migrated (updated) to match the expected schema by Permify upon startup. If it's set to true, Permify attempts to ensure that the database schema is compatible with its requirements by applying necessary migrations at the start. However, simply having auto_migrate set to true doesn't populate your database with your defined authorization model (schema defined in schema.perm). It's primarily for preparing the database to store Permify's required data structures.
- Do I need to call the schema endpoint to set up the schema from my app?
Yes, even after setting up a Permify container with auto_migrate enabled, you would still need to explicitly send your schema to Permify by calling the respective schema endpoint. You can use the Write Schema API endpoint (/v1/schemas/write) for this purpose.
So I guess, I my case, I can set auto_migrate , because I am using a fresh db ,
Another question , When I call /v1/schemas/write , even with the same input, the version in schema table changed, is there any option to prevent that.
As of now, we don't provide an option to prevent the version change when calling this endpoint.
For managing schema changes effectively, consider the following recommended practices:
- Set up a central git repository that includes the schema.
- Use a CI pipeline that utilizes the Write Schema API to deploy schema changes.
- Add a schema validator to the pipeline to ensure that any changes are automatically validated.
You can find more details about managing schema changes on the Testing & Validation (https://docs.permify.co/getting-started/testing) docs page.
Also we'd be happy to hear more about your use case and help you out if anything needed. Your feedback as a new user is invaluable to us.