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

Forbide the use of CASCADE instructions in SQL using linter #94

Open
mrsarm opened this issue May 21, 2021 · 0 comments
Open

Forbide the use of CASCADE instructions in SQL using linter #94

mrsarm opened this issue May 21, 2021 · 0 comments

Comments

@mrsarm
Copy link
Contributor

mrsarm commented May 21, 2021

This is a spin-off of this comment:

DROP SQL instructions with CASCADE modifier are danger, can cause the deletion of objects that were not planned to delete. Currently there are other views in the DBs were we use medic-couch2pg to manage the "main" schema, but other schema changes are manage outside this tool, and we suffered the consequences of the DROP instructions loosing views that the scripts didn't intend to delete, but if we instead of use CASCADE we drop in the script one by one the views and objects that we know we want to delete, the error can be prevented.

Although add a note in the README may be enough, to better prevent to happen again, we should add a linter or a unit test that verifies that CASCADE is not used in future scripts addition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant