Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat/dao] implement cascade deletion for Cassandra #504

Merged
merged 1 commit into from
Aug 26, 2015

Conversation

thibaultcha
Copy link
Member

This implements a "delete hook" system to trigger cascade deletion of foreign rows in Cassandra. To do so, all foreign columns (representing foreign keys) must now be queryable (which means be indexed by Cassandra).

A "delete hook" is added to a parent DAO if any other DAO has foreign rows to that DAO. Ex: APIs are parents to plugins_credentials, hence the apis DAO will have a delete hook on the deletion of a row, to also delete any related plugins_configurations.

  • Move cascade delete tests to another file, with all use cases of current cascade deletion.
  • Add a migration for oauth2 plugin to index the consumer_id field.
  • Remove obsolete overridden delete methods of apis and consumers DAOs.

This should be a solution to #438 and is an improved implementation of #107.

PS: I don't really like taking care of this at the application level but what choice do we have.

This implements a "delete hook" system to trigger cascade deletion of
foreign rows in Cassandra. To do so, all foreign columns (representing foreign keys) must now be queryable (which means be indexed by Cassandra).

A "delete hook" is added to a parent DAO if any other DAO has foreign
rows to that DAO. Ex: APIs are parents to plugins_credentials, hence the
`apis` DAO will have a delete hook on the deletion of a row, to also
delete any related `plugins_configurations`.

- Move cascade delete tests to another file, with all use cases of
  current cascade deletion.
- Add a migration for oauth2 plugin to index the `consumer_id` field.
- Remove obsolete overridden delete methods of apis and consumers DAOs.

This should be a solution to #438 and is an improved implementation of #107
@thibaultcha thibaultcha added NEEDS REVIEW pr/ready (but hold merge) No more concerns, but do not merge yet (probably a conflict of interest with another PR or release) and removed NEEDS REVIEW labels Aug 25, 2015
thibaultcha added a commit that referenced this pull request Aug 26, 2015
[feat/dao] implement cascade deletion for Cassandra
@thibaultcha thibaultcha merged commit b00ac43 into master Aug 26, 2015
@thibaultcha thibaultcha deleted the feat/cascade-delete branch August 26, 2015 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/ready (but hold merge) No more concerns, but do not merge yet (probably a conflict of interest with another PR or release)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant