chore: Add explicit ON DELETE CASCADE for embedded_dashboards (#24939)

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
This commit is contained in:
John Bodley
2023-08-10 07:41:14 -07:00
committed by GitHub
parent 94c595093b
commit 55014bf58b
4 changed files with 54 additions and 6 deletions

View File

@@ -40,7 +40,11 @@ class EmbeddedDashboard(Model, AuditMixinNullable):
uuid = Column(UUIDType(binary=True), default=uuid.uuid4, primary_key=True)
allow_domain_list = Column(Text) # reference the `allowed_domains` property instead
dashboard_id = Column(Integer, ForeignKey("dashboards.id"), nullable=False)
dashboard_id = Column(
Integer,
ForeignKey("dashboards.id", ondelete="CASCADE"),
nullable=False,
)
dashboard = relationship(
"Dashboard",
back_populates="embedded",