Feathers database adapter for Objection.js, an ORM based on KnexJS SQL query builder for Postgres, Redshift, MSSQL, MySQL, MariaDB, SQLite3, and Oracle. Forked from feathers-knex.
It seems to be, that with latest feathers-objection 7.6.0
there is no way to set unrelate or noDelete options
within the upsertGraphOptions param .
At least it has no effect. The implicit query wnat's to delete the foreign item, which leads to an ForeignKeyError due to having 'RESTRICT' in onDelete (instead of CASCDE which I don't want to have).
Overwriting the patch method of the class (better said, not to call the super.patch)
and calling directly
await this.options.model.query().upsertGraph({id, ...data}, {noDelete: ['roles'], unrelate: true})
does work instead in my case.
It seems to be, that with latest
feathers-objection
7.6.0 there is no way to setunrelate
ornoDelete
options within theupsertGraphOptions
param .At least it has no effect. The implicit query wnat's to delete the foreign item, which leads to an ForeignKeyError due to having 'RESTRICT' in onDelete (instead of CASCDE which I don't want to have).
Overwriting the patch method of the class (better said, not to call the super.patch) and calling directly
await this.options.model.query().upsertGraph({id, ...data}, {noDelete: ['roles'], unrelate: true})
does work instead in my case.Can anyone confirm? TIA