balderdashy / waterline-docs

WARNING: The content in this repo is out of date! See https://github.com/balderdashy/sails-docs for the most up-to-date documentation
452 stars 161 forks source link

Association not cleared in postgresql on the "one" side when destroying the "many" element of a one-to-many association #87

Closed tibotiber closed 9 years ago

tibotiber commented 9 years ago

Hi! I have a one-to-many association, let say one owner has many pets. When I destroy an owner, the owner column of its pets is not cleared in the database. I'm using postgresql. It doesn't really matter in the code since waterline still provides consistent data. But I think it would be better to have the database consistent as well. I'm not sure if this comes from waterline or the postgresql adapter though. Any idea or comment? Thanks, Thibaut.

devinivy commented 9 years ago

Currently when a record is deleted junction table records are removed, but other foreign keys are not. This feature might not be a bad candidate for 0.11.0.

dmarcelino commented 9 years ago

I believe balderdashy/waterline#251 is about the same thing but applied to waterline core.

tibotiber commented 9 years ago

@dmarcelino yes it is about the same thing. Sorry my search was not good enough. I guess it's fine closing this then.