feat(dashboards): add dashboard tile widget_id column (2/11)#60490
Conversation
Migration SQL ChangesHey 👋, we've detected some migrations on this PR. Here's the SQL output for each migration, make sure they make sense:
|
4206a12 to
416a5ab
Compare
4106013 to
2e1437e
Compare
🔍 Migration Risk AnalysisWe've analyzed your migrations for potential risks. Summary: 1 Safe | 0 Needs Review | 0 Blocked ✅ SafeBrief or no lock, backwards compatible 📚 How to Deploy These Changes SafelyRunSQL: Follow up with VALIDATE CONSTRAINT in a later migration to check existing rows. Last updated: 2026-05-29 15:28 UTC (ab7d937) |
|
⏭️ Skipped snapshot commit because branch advanced to The new commit will trigger its own snapshot update workflow. If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:
|
Query snapshots: Backend query snapshots updatedChanges: 1 snapshots (1 modified, 0 added, 0 deleted) What this means:
Next steps:
|
|
b7d107b to
841eda7
Compare
Query snapshots: Backend query snapshots updatedChanges: 1 snapshots (1 modified, 0 added, 0 deleted) What this means:
Next steps:
|
10c1b05 to
841eda7
Compare
Query snapshots: Backend query snapshots updatedChanges: 4 snapshots (4 modified, 0 added, 0 deleted) What this means:
Next steps:
|
8b93bc3 to
1ac691f
Compare
Query snapshots: Backend query snapshots updatedChanges: 4 snapshots (4 modified, 0 added, 0 deleted) What this means:
Next steps:
|
Index is created concurrently in 0011; AddField state must match the model's db_index=False or makemigrations --check fails. Co-authored-by: Cursor <cursoragent@cursor.com>
DashboardTileSerializer now includes the widget FK field once widget_id exists on the model. Co-authored-by: Cursor <cursoragent@cursor.com>
Defer widget from DashboardTile.clean() so model validation matches the 3-way DB check constraint until PR #60491 adds the 4-way constraint. Co-authored-by: Cursor <cursoragent@cursor.com>
6422e40 to
4839e6e
Compare
Query snapshots: Backend query snapshots updatedChanges: 4 snapshots (4 modified, 0 added, 0 deleted) What this means:
Next steps:
|
|
Size Change: 0 B Total Size: 80.8 MB ℹ️ View Unchanged
|

Problem
Dashboard tiles must optionally reference a
DashboardWidget. We add the nullable FK column in its own PR so deploy can be verified before constraint/check migrations.This PR is 2/10 in the dashboard widgets Graphite stack.
Depends on: PR 1 (DashboardWidget table)
Changes
0008_dashboardtile_widget_id— adds nullablewidget_idtoposthog_dashboardtilewithNOT VALIDFKDashboardTile.widgetFK field in Django state (3-way exclusivity check unchanged)How did you test this code?
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Publish to changelog?
no
Docs update
skip-inkeep-docs
🤖 Agent context
NOT VALIDto avoid immediate validation scan on deploy