From a971a28a3450b28151bbad3632ce2364c87df3fc Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Wed, 20 Sep 2023 13:08:07 -0300 Subject: [PATCH] fix: DashboardRoles cascade operation (#25349) --- superset/models/dashboard.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/superset/models/dashboard.py b/superset/models/dashboard.py index c4e6f45c52533..77c10b333f433 100644 --- a/superset/models/dashboard.py +++ b/superset/models/dashboard.py @@ -130,16 +130,14 @@ def copy_dashboard(_mapper: Mapper, connection: Connection, target: Dashboard) - Column( "dashboard_id", Integer, - ForeignKey("dashboards.id"), + ForeignKey("dashboards.id", on_delete="CASCADE"), nullable=False, - on_delete="CASCADE", ), Column( "role_id", Integer, - ForeignKey("ab_role.id"), + ForeignKey("ab_role.id", on_delete="CASCADE"), nullable=False, - on_delete="CASCADE", ), )