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

Disable postgres USER triggers #299

Merged
merged 1 commit into from
Aug 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions silk/management/commands/silk_clear_request_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ def delete_model(model):
cursor.execute("TRUNCATE TABLE {0}".format(table))
cursor.execute("SET FOREIGN_KEY_CHECKS=1;")
elif 'postgres' in engine:
cursor.execute("ALTER TABLE {0} DISABLE TRIGGER ALL;".format(table))
cursor.execute("ALTER TABLE {0} DISABLE TRIGGER USER;".format(table))
cursor.execute("TRUNCATE TABLE {0} CASCADE".format(table))
cursor.execute("ALTER TABLE {0} ENABLE TRIGGER ALL;".format(table))
cursor.execute("ALTER TABLE {0} ENABLE TRIGGER USER;".format(table))
return

# Manually delete rows because sqlite does not support TRUNCATE and
Expand Down