Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/d1-0b-report-runs-id-report.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The simulation service's model of `report_runs` declares the unique constraint `uq_report_runs_id_report` on `(id, report_id)`, which API v1 adds as the target of a saved report's key to its current run. The service reads and writes report runs as before.
2 changes: 1 addition & 1 deletion libs/policyengine-simulation-persistence/public-api-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e0c9d2f7aa54cfc4a15740c18eb0e29eb469d6fa
41fc0151aac124aaf8829ba7f98bb0ad9a8898ad
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,8 @@ class BudgetWindowRun(ServiceBase):
ondelete="CASCADE",
),
# The target of report_runs' key, which keeps a year run to its window
# run's report.
# run's report, and of API v1's key from a saved report
# (user_report_associations) to its current budget window run.
UniqueConstraint("id", "report_id", name="uq_budget_window_runs_id_report"),
_completion_required("budget_window_runs"),
Index(
Expand Down Expand Up @@ -551,6 +552,10 @@ class ReportRun(ServiceBase):
name="fk_report_runs_budget_window_run_id_budget_window_runs",
ondelete="CASCADE",
),
# The target of API v1's key from a saved report
# (user_report_associations) to its current run, which keeps that run
# to the saved report's own report.
UniqueConstraint("id", "report_id", name="uq_report_runs_id_report"),
UniqueConstraint(
"report_id",
"idempotency_key",
Expand Down