Hello
After some testing on my local branch everything works.
Example of my beneficiaries
table in local branch:
However, when I put my FOREST_AUTH_SECRET and FOREST_ENV_SECRET from the Staging environment, in my .env file, and ran the forest schema:apply command to apply my modifications to my Staging environment, I got of errors.
Example of my error log :
Invalid projection: field not found 'beneficiaries.fk_user'}
ValidationError: Invalid projection: field not found 'beneficiaries.fk_user'}
Feature(s) impacted
relationship field names
Observed behavior
From what I can see of the error, it’s that the relationship between my beneficiaries and users tables isn’t working properly. because in our database server we have the field fk_userId, whereas on the .forestadmin-schema.json side I have fk_user
-
database server:
-
.forestadmin-schema.json:
{
"defaultValue": null,
"enums": null,
"field": "fk_user",
"integration": null,
"inverseOf": "beneficiaries",
"isFilterable": true,
"isPrimaryKey": false,
"isReadOnly": false,
"isRequired": false,
"isSortable": true,
"isVirtual": false,
"reference": "users.id",
"relationship": "BelongsTo",
"type": "Uuid",
"validations": []
},
Is it because of this difference that I get the error? (PS: Locally, I don’t have this problem)
Expected behavior
that the fk_user field correctly takes into account the fk_userId field we have in our database server. Because locally it works fine.
Context
- Project name: Nostrum Care v3
- Team name: Op
- Environment name: Staging
- Agent (forest package) name & version:
“@forestadmin/agent”: “^1.0.0”,
“@forestadmin/datasource-sequelize”: “^1.5.21”,
“@forestadmin/datasource-sql”: “^1.0.0”,
“dotenv”: “^16.0.1”,
“pg”: “^8.8.0”,
“sequelize”: “^6.33.0”,
“stripe”: “^14.17.0” - Database type: Postgresql
Thanks in advance