fix: Add explicit ON DELETE CASCADE for dashboard_roles (#25320)

This commit is contained in:
John Bodley
2023-09-18 05:49:51 -07:00
committed by GitHub
parent 4ddd56f788
commit d54e827bb9
4 changed files with 71 additions and 4 deletions

View File

@@ -127,8 +127,20 @@ DashboardRoles = Table(
"dashboard_roles",
metadata,
Column("id", Integer, primary_key=True),
Column("dashboard_id", Integer, ForeignKey("dashboards.id"), nullable=False),
Column("role_id", Integer, ForeignKey("ab_role.id"), nullable=False),
Column(
"dashboard_id",
Integer,
ForeignKey("dashboards.id"),
nullable=False,
on_delete="CASCADE",
),
Column(
"role_id",
Integer,
ForeignKey("ab_role.id"),
nullable=False,
on_delete="CASCADE",
),
)