Merge pull request #12836 from adityahase/fix-touched-tables-drop

fix: Include dropped and renamed tables in touched tables list
This commit is contained in:
mergify[bot] 2021-04-13 05:01:23 +00:00 committed by GitHub
commit 6f87ff7cb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -985,7 +985,7 @@ class Database(object):
def log_touched_tables(self, query, values=None):
if values:
query = frappe.safe_decode(self._cursor.mogrify(query, values))
if query.strip().lower().split()[0] in ('insert', 'delete', 'update', 'alter'):
if query.strip().lower().split()[0] in ('insert', 'delete', 'update', 'alter', 'drop', 'rename'):
# single_word_regex is designed to match following patterns
# `tabXxx`, tabXxx and "tabXxx"