feat: migrate task jobs to workflow notifications + timeline

This commit is contained in:
2026-03-02 14:29:31 -05:00
parent 36c4ed2ee2
commit d81a681905
33 changed files with 2437 additions and 292 deletions

View File

@@ -0,0 +1,11 @@
ALTER TABLE `task_run` ADD `stage` text NOT NULL DEFAULT 'queued';
--> statement-breakpoint
ALTER TABLE `task_run` ADD `stage_detail` text;
--> statement-breakpoint
ALTER TABLE `task_run` ADD `resource_key` text;
--> statement-breakpoint
ALTER TABLE `task_run` ADD `notification_read_at` text;
--> statement-breakpoint
ALTER TABLE `task_run` ADD `notification_silenced_at` text;
--> statement-breakpoint
CREATE INDEX `task_user_resource_status_idx` ON `task_run` (`user_id`,`task_type`,`resource_key`,`status`,`created_at`);

View File

@@ -0,0 +1,15 @@
CREATE TABLE `task_stage_event` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`task_id` text NOT NULL,
`user_id` text NOT NULL,
`stage` text NOT NULL,
`stage_detail` text,
`status` text NOT NULL,
`created_at` text NOT NULL,
FOREIGN KEY (`task_id`) REFERENCES `task_run`(`id`) ON UPDATE no action ON DELETE cascade,
FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE INDEX `task_stage_event_task_created_idx` ON `task_stage_event` (`task_id`,`created_at`);
--> statement-breakpoint
CREATE INDEX `task_stage_event_user_created_idx` ON `task_stage_event` (`user_id`,`created_at`);

View File

@@ -15,6 +15,20 @@
"when": 1772417400000,
"tag": "0001_glossy_statement_snapshots",
"breakpoints": true
},
{
"idx": 2,
"version": "6",
"when": 1772450400000,
"tag": "0002_workflow_task_projection_metadata",
"breakpoints": true
},
{
"idx": 3,
"version": "6",
"when": 1772486100000,
"tag": "0003_task_stage_event_timeline",
"breakpoints": true
}
]
}