[Refactor] Unify Automation Results inbox persistence - #2563
Draft
roomote-roomote[bot] wants to merge 1 commit into
Draft
[Refactor] Unify Automation Results inbox persistence#2563roomote-roomote[bot] wants to merge 1 commit into
roomote-roomote[bot] wants to merge 1 commit into
Conversation
Contributor
| ALTER TABLE "automation_results" ADD COLUMN "source_work_item_id" uuid;--> statement-breakpoint | ||
| ALTER TABLE "automation_results" ADD COLUMN "kind" text DEFAULT 'report' NOT NULL;--> statement-breakpoint | ||
| ALTER TABLE "automation_results" ADD COLUMN "title" text;--> statement-breakpoint | ||
| ALTER TABLE "automation_results" ADD CONSTRAINT "automation_results_source_work_item_id_work_items_id_fk" FOREIGN KEY ("source_work_item_id") REFERENCES "public"."work_items"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint |
Contributor
There was a problem hiding this comment.
work_items.source_task_id cascades on task deletion, so existing suggestion inbox entries disappeared with their backing work item. This new FK instead nulls the canonical row's reference, leaving it unread and visible in Results after the source task/work item is deleted. Use ON DELETE CASCADE for the suggestion-result link (or explicitly delete the canonical row) to preserve the previous lifecycle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
automation_resultsthe canonical persistence and lifecycle model for both reports and suggestions.work_itemscompatibility columns in both directions for N-1 rollback safety.Why this change was made
The Results inbox exposed one item contract but implemented every lifecycle operation across two tables. Consolidating the model prevents report and suggestion behavior from drifting while preserving safe rollback to the previous release.
Impact
There is no intended user-facing behavior change. Results retain the same visibility, priority ordering, deduplication, accept/ignore, clear-all, and task-launch behavior, with one canonical persistence path and an explicit temporary rollback bridge.