changeset 9124f759395d in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=9124f759395d
description:
        Concatenate cascade string to drop table before converting to SQL

        issue10278
        review332571002
diffstat:

 trytond/backend/postgresql/table.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (13 lines):

diff -r a30e5d9566a6 -r 9124f759395d trytond/backend/postgresql/table.py
--- a/trytond/backend/postgresql/table.py       Tue Apr 13 14:22:48 2021 +0200
+++ b/trytond/backend/postgresql/table.py       Tue Apr 13 18:17:22 2021 +0200
@@ -518,7 +518,7 @@
         cursor = Transaction().connection.cursor()
         cursor.execute('DELETE FROM ir_model_data WHERE model = %s', (model,))
 
-        query = SQL('DROP TABLE {}').format(Identifier(table))
+        query = 'DROP TABLE {}'
         if cascade:
             query = query + ' CASCADE'
-        cursor.execute(query)
+        cursor.execute(SQL(query).format(Identifier(table)))

Reply via email to