Creates the errands table (with conflictFiles column), errand-repository port interface, DrizzleErrandRepository adapter, and wires the repository into TRPCContext, the DI container, _helpers.ts requireErrandRepository guard, and the test harness. Also fixes pre-existing TS error in controller.test.ts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17 lines
698 B
SQL
17 lines
698 B
SQL
CREATE TABLE `errands` (
|
|
`id` text PRIMARY KEY NOT NULL,
|
|
`description` text NOT NULL,
|
|
`branch` text NOT NULL,
|
|
`base_branch` text DEFAULT 'main' NOT NULL,
|
|
`agent_id` text,
|
|
`project_id` text NOT NULL,
|
|
`status` text DEFAULT 'active' NOT NULL,
|
|
`created_at` integer NOT NULL,
|
|
`updated_at` integer NOT NULL,
|
|
`conflict_files` text,
|
|
FOREIGN KEY (`agent_id`) REFERENCES `agents`(`id`) ON UPDATE no action ON DELETE set null,
|
|
FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON UPDATE no action ON DELETE cascade
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE INDEX `errands_project_id_idx` ON `errands` (`project_id`);--> statement-breakpoint
|
|
CREATE INDEX `errands_status_idx` ON `errands` (`status`); |