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

Add CASCADE option for drop_table #3

Open
dharvey-consbio opened this issue Aug 20, 2020 · 0 comments
Open

Add CASCADE option for drop_table #3

dharvey-consbio opened this issue Aug 20, 2020 · 0 comments

Comments

@dharvey-consbio
Copy link
Contributor

Not as simple as it may seem. Requires something like:

from sqlalchemy.ext.compiler import compiles
from sqlalchemy.schema import DropTable

@compiles(DropTable, "postgresql")
def _compile_drop_table(element, compiler, **kwargs):
    return compiler.visit_drop_table(element) + " CASCADE"

https://stackoverflow.com/questions/38678336/sqlalchemy-how-to-implement-drop-table-cascade

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

No branches or pull requests

1 participant