mozilla-sensorweb / sensorthings

Node implementation of the OGC SensorThings API
Mozilla Public License 2.0
14 stars 9 forks source link

Investigate delete on cascade when defining associations #246

Open russnicoletti opened 7 years ago

russnicoletti commented 7 years ago

While working on https://github.com/mozilla-sensorweb/sensorthings/issues/228, it was discovered the delete hooks (beforeDelete, afterDelete) are not run during /DELETE requests. From the Sequelize documentation: "The only way to call beforeDestroy/afterDestroy hooks are on associations with onDelete: 'cascade' and the option hooks: true"

We should investigate whether using 'delete on cascade' when defining associations results in delete hooks being run during /DELETE requests.