From f93146919fcdb8b777467e5ddee8ee61f2ebd84d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 20 Nov 2024 11:17:15 +0100 Subject: [PATCH] Drop constraints using cascade This is needed when dropping a constraint used to enforce a foreign key for example. --- trytond/trytond/backend/postgresql/table.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trytond/trytond/backend/postgresql/table.py b/trytond/trytond/backend/postgresql/table.py index bb3aec41ac..c334991adf 100644 --- a/trytond/trytond/backend/postgresql/table.py +++ b/trytond/trytond/backend/postgresql/table.py @@ -524,7 +524,7 @@ class TableHandler(TableHandlerInterface): return cursor = Transaction().connection.cursor() cursor.execute( - SQL('ALTER TABLE {} DROP CONSTRAINT {}').format( + SQL('ALTER TABLE {} DROP CONSTRAINT {} CASCADE').format( Identifier(self.table_name), Identifier(ident))) self._update_definitions(constraints=True)