Move drizzle/, dist/, and coverage/ into apps/server/ so all server-specific artifacts live alongside the source they belong to. - git mv drizzle/ → apps/server/drizzle/ - drizzle.config.ts: out → ./apps/server/drizzle - tsconfig.json: outDir → ./apps/server/dist, exclude drizzle dir - package.json: main/bin/clean point to apps/server/dist/ - vitest.config.ts: reportsDirectory → ./apps/server/coverage - .gitignore: add coverage/ entry - ensure-schema.ts: update getMigrationsPath() for new layout - docs/database-migrations.md: update drizzle/ references
19 lines
819 B
SQL
19 lines
819 B
SQL
-- Inter-agent conversations
|
|
CREATE TABLE `conversations` (
|
|
`id` text PRIMARY KEY NOT NULL,
|
|
`from_agent_id` text NOT NULL REFERENCES `agents`(`id`) ON DELETE CASCADE,
|
|
`to_agent_id` text NOT NULL REFERENCES `agents`(`id`) ON DELETE CASCADE,
|
|
`initiative_id` text REFERENCES `initiatives`(`id`) ON DELETE SET NULL,
|
|
`phase_id` text REFERENCES `phases`(`id`) ON DELETE SET NULL,
|
|
`task_id` text REFERENCES `tasks`(`id`) ON DELETE SET NULL,
|
|
`question` text NOT NULL,
|
|
`answer` text,
|
|
`status` text DEFAULT 'pending' NOT NULL,
|
|
`created_at` integer NOT NULL,
|
|
`updated_at` integer NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE INDEX `conversations_to_agent_status_idx` ON `conversations` (`to_agent_id`, `status`);
|
|
--> statement-breakpoint
|
|
CREATE INDEX `conversations_from_agent_idx` ON `conversations` (`from_agent_id`);
|