feathersjs-ecosystem / feathers-sequelize

A Feathers service adapter for the Sequelize ORM. Supporting MySQL, MariaDB, Postgres, SQLite, and SQL Server
MIT License
208 stars 75 forks source link

feathers-sequelize remove method rewrite breaking change when deleting multiple items without id in table #409

Closed chrisbag closed 2 months ago

chrisbag commented 1 year ago

Hey, Just experienced a breaking change when updating to latest feathers-sequelize so thought it might be helpful if ever other people encounter this bug :)

Steps to reproduce

remove service method when removing multiple entires (null parameter) fails when table has no ID following recent method rewrite Some tables such has join tables don't necessarily need an ID in the new remove method, items are fetched and then removed by ID causing the request to fail if no ids exist this is the SQL raw query : DELETE FROM "join_table" WHERE "id" IN (NULL) https://github.com/feathersjs-ecosystem/feathers-sequelize/pull/403

Expected behavior

Should be able to delete multiple items in a table without ids or at least get an error message

Actual behavior

Code runs without error message and without deleting the entries

System configuration

feathers-sequelize 6.4.0

DaddyWarbucks commented 2 months ago

Closing this because it is outdated. It is also a convention of all Feathers DB adapters that the table must have an primary key. In order to accomplish all the standard Feathers functionality, a primary key is required. You can always create a custom service to interact with models that do not have a primary key.