refactor: Co-locate server artifacts under apps/server/
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
This commit is contained in:
87
apps/server/drizzle/0000_bizarre_naoko.sql
Normal file
87
apps/server/drizzle/0000_bizarre_naoko.sql
Normal file
@@ -0,0 +1,87 @@
|
||||
CREATE TABLE `agents` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`task_id` text,
|
||||
`session_id` text,
|
||||
`worktree_id` text NOT NULL,
|
||||
`status` text DEFAULT 'idle' NOT NULL,
|
||||
`mode` text DEFAULT 'execute' NOT NULL,
|
||||
`created_at` integer NOT NULL,
|
||||
`updated_at` integer NOT NULL,
|
||||
FOREIGN KEY (`task_id`) REFERENCES `tasks`(`id`) ON UPDATE no action ON DELETE set null
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `agents_name_unique` ON `agents` (`name`);--> statement-breakpoint
|
||||
CREATE TABLE `initiatives` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`description` text,
|
||||
`status` text DEFAULT 'active' NOT NULL,
|
||||
`created_at` integer NOT NULL,
|
||||
`updated_at` integer NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `messages` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`sender_type` text NOT NULL,
|
||||
`sender_id` text,
|
||||
`recipient_type` text NOT NULL,
|
||||
`recipient_id` text,
|
||||
`type` text DEFAULT 'info' NOT NULL,
|
||||
`content` text NOT NULL,
|
||||
`requires_response` integer DEFAULT false NOT NULL,
|
||||
`status` text DEFAULT 'pending' NOT NULL,
|
||||
`parent_message_id` text,
|
||||
`created_at` integer NOT NULL,
|
||||
`updated_at` integer NOT NULL,
|
||||
FOREIGN KEY (`sender_id`) REFERENCES `agents`(`id`) ON UPDATE no action ON DELETE set null,
|
||||
FOREIGN KEY (`recipient_id`) REFERENCES `agents`(`id`) ON UPDATE no action ON DELETE set null,
|
||||
FOREIGN KEY (`parent_message_id`) REFERENCES `messages`(`id`) ON UPDATE no action ON DELETE set null
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `phases` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`initiative_id` text NOT NULL,
|
||||
`number` integer NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`description` text,
|
||||
`status` text DEFAULT 'pending' NOT NULL,
|
||||
`created_at` integer NOT NULL,
|
||||
`updated_at` integer NOT NULL,
|
||||
FOREIGN KEY (`initiative_id`) REFERENCES `initiatives`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `plans` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`phase_id` text NOT NULL,
|
||||
`number` integer NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`description` text,
|
||||
`status` text DEFAULT 'pending' NOT NULL,
|
||||
`created_at` integer NOT NULL,
|
||||
`updated_at` integer NOT NULL,
|
||||
FOREIGN KEY (`phase_id`) REFERENCES `phases`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `task_dependencies` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`task_id` text NOT NULL,
|
||||
`depends_on_task_id` text NOT NULL,
|
||||
`created_at` integer NOT NULL,
|
||||
FOREIGN KEY (`task_id`) REFERENCES `tasks`(`id`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (`depends_on_task_id`) REFERENCES `tasks`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `tasks` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`plan_id` text NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`description` text,
|
||||
`type` text DEFAULT 'auto' NOT NULL,
|
||||
`priority` text DEFAULT 'medium' NOT NULL,
|
||||
`status` text DEFAULT 'pending' NOT NULL,
|
||||
`order` integer DEFAULT 0 NOT NULL,
|
||||
`created_at` integer NOT NULL,
|
||||
`updated_at` integer NOT NULL,
|
||||
FOREIGN KEY (`plan_id`) REFERENCES `plans`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
8
apps/server/drizzle/0001_overrated_gladiator.sql
Normal file
8
apps/server/drizzle/0001_overrated_gladiator.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
CREATE TABLE `phase_dependencies` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`phase_id` text NOT NULL,
|
||||
`depends_on_phase_id` text NOT NULL,
|
||||
`created_at` integer NOT NULL,
|
||||
FOREIGN KEY (`phase_id`) REFERENCES `phases`(`id`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (`depends_on_phase_id`) REFERENCES `phases`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
12
apps/server/drizzle/0002_bumpy_killraven.sql
Normal file
12
apps/server/drizzle/0002_bumpy_killraven.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
CREATE TABLE `pages` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`initiative_id` text NOT NULL,
|
||||
`parent_page_id` text,
|
||||
`title` text NOT NULL,
|
||||
`content` text,
|
||||
`sort_order` integer DEFAULT 0 NOT NULL,
|
||||
`created_at` integer NOT NULL,
|
||||
`updated_at` integer NOT NULL,
|
||||
FOREIGN KEY (`initiative_id`) REFERENCES `initiatives`(`id`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (`parent_page_id`) REFERENCES `pages`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
20
apps/server/drizzle/0003_curly_ser_duncan.sql
Normal file
20
apps/server/drizzle/0003_curly_ser_duncan.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
CREATE TABLE `projects` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`url` text NOT NULL,
|
||||
`created_at` integer NOT NULL,
|
||||
`updated_at` integer NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `projects_name_unique` ON `projects` (`name`);--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `projects_url_unique` ON `projects` (`url`);--> statement-breakpoint
|
||||
CREATE TABLE `initiative_projects` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`initiative_id` text NOT NULL,
|
||||
`project_id` text NOT NULL,
|
||||
`created_at` integer NOT NULL,
|
||||
FOREIGN KEY (`initiative_id`) REFERENCES `initiatives`(`id`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `initiative_project_unique` ON `initiative_projects` (`initiative_id`,`project_id`);
|
||||
15
apps/server/drizzle/0004_white_captain_britain.sql
Normal file
15
apps/server/drizzle/0004_white_captain_britain.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
CREATE TABLE `accounts` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`email` text NOT NULL,
|
||||
`provider` text DEFAULT 'claude' NOT NULL,
|
||||
`config_dir` text NOT NULL,
|
||||
`is_exhausted` integer DEFAULT false NOT NULL,
|
||||
`exhausted_until` integer,
|
||||
`last_used_at` integer,
|
||||
`sort_order` integer DEFAULT 0 NOT NULL,
|
||||
`created_at` integer NOT NULL,
|
||||
`updated_at` integer NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE `agents` ADD `provider` text DEFAULT 'claude' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE `agents` ADD `account_id` text REFERENCES accounts(id);
|
||||
4
apps/server/drizzle/0005_blushing_wendell_vaughn.sql
Normal file
4
apps/server/drizzle/0005_blushing_wendell_vaughn.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
ALTER TABLE `agents` ADD `pid` integer;--> statement-breakpoint
|
||||
ALTER TABLE `agents` ADD `output_file_path` text;--> statement-breakpoint
|
||||
ALTER TABLE `agents` ADD `result` text;--> statement-breakpoint
|
||||
ALTER TABLE `agents` ADD `pending_questions` text;
|
||||
1
apps/server/drizzle/0006_curvy_sandman.sql
Normal file
1
apps/server/drizzle/0006_curvy_sandman.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `agents` ADD `initiative_id` text REFERENCES initiatives(id);
|
||||
27
apps/server/drizzle/0007_robust_the_watchers.sql
Normal file
27
apps/server/drizzle/0007_robust_the_watchers.sql
Normal file
@@ -0,0 +1,27 @@
|
||||
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
||||
CREATE TABLE `__new_tasks` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`plan_id` text,
|
||||
`phase_id` text,
|
||||
`initiative_id` text,
|
||||
`name` text NOT NULL,
|
||||
`description` text,
|
||||
`type` text DEFAULT 'auto' NOT NULL,
|
||||
`category` text DEFAULT 'execute' NOT NULL,
|
||||
`priority` text DEFAULT 'medium' NOT NULL,
|
||||
`status` text DEFAULT 'pending' NOT NULL,
|
||||
`requires_approval` integer,
|
||||
`order` integer DEFAULT 0 NOT NULL,
|
||||
`created_at` integer NOT NULL,
|
||||
`updated_at` integer NOT NULL,
|
||||
FOREIGN KEY (`plan_id`) REFERENCES `plans`(`id`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (`phase_id`) REFERENCES `phases`(`id`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (`initiative_id`) REFERENCES `initiatives`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
INSERT INTO `__new_tasks`("id", "plan_id", "phase_id", "initiative_id", "name", "description", "type", "category", "priority", "status", "requires_approval", "order", "created_at", "updated_at") SELECT "id", "plan_id", NULL, NULL, "name", "description", "type", 'execute', "priority", "status", NULL, "order", "created_at", "updated_at" FROM `tasks`;--> statement-breakpoint
|
||||
DROP TABLE `tasks`;--> statement-breakpoint
|
||||
ALTER TABLE `__new_tasks` RENAME TO `tasks`;--> statement-breakpoint
|
||||
PRAGMA foreign_keys=ON;--> statement-breakpoint
|
||||
ALTER TABLE `initiatives` ADD `merge_requires_approval` integer DEFAULT true NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE `initiatives` ADD `merge_target` text;
|
||||
61
apps/server/drizzle/0008_eliminate_plans_table.sql
Normal file
61
apps/server/drizzle/0008_eliminate_plans_table.sql
Normal file
@@ -0,0 +1,61 @@
|
||||
-- Migration: Eliminate plans table
|
||||
-- Plans are now decompose tasks with parentTaskId for child relationships
|
||||
|
||||
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
||||
|
||||
-- Step 1: Create new tasks table with parent_task_id instead of plan_id
|
||||
CREATE TABLE `__new_tasks` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`phase_id` text,
|
||||
`initiative_id` text,
|
||||
`parent_task_id` text,
|
||||
`name` text NOT NULL,
|
||||
`description` text,
|
||||
`type` text DEFAULT 'auto' NOT NULL,
|
||||
`category` text DEFAULT 'execute' NOT NULL,
|
||||
`priority` text DEFAULT 'medium' NOT NULL,
|
||||
`status` text DEFAULT 'pending' NOT NULL,
|
||||
`requires_approval` integer,
|
||||
`order` integer DEFAULT 0 NOT NULL,
|
||||
`created_at` integer NOT NULL,
|
||||
`updated_at` integer NOT NULL,
|
||||
FOREIGN KEY (`phase_id`) REFERENCES `phases`(`id`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (`initiative_id`) REFERENCES `initiatives`(`id`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (`parent_task_id`) REFERENCES `__new_tasks`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);--> statement-breakpoint
|
||||
|
||||
-- Step 2: Insert plans as decompose tasks FIRST (so plan IDs exist as task IDs for foreign key)
|
||||
INSERT INTO `__new_tasks`("id", "phase_id", "initiative_id", "parent_task_id", "name", "description", "type", "category", "priority", "status", "requires_approval", "order", "created_at", "updated_at")
|
||||
SELECT
|
||||
"id",
|
||||
"phase_id",
|
||||
NULL,
|
||||
NULL,
|
||||
"name",
|
||||
"description",
|
||||
'auto',
|
||||
'decompose',
|
||||
'medium',
|
||||
CASE
|
||||
WHEN "status" = 'completed' THEN 'completed'
|
||||
WHEN "status" = 'in_progress' THEN 'in_progress'
|
||||
ELSE 'pending'
|
||||
END,
|
||||
NULL,
|
||||
"number",
|
||||
"created_at",
|
||||
"updated_at"
|
||||
FROM `plans`;--> statement-breakpoint
|
||||
|
||||
-- Step 3: Copy existing tasks, converting plan_id to parent_task_id
|
||||
INSERT INTO `__new_tasks`("id", "phase_id", "initiative_id", "parent_task_id", "name", "description", "type", "category", "priority", "status", "requires_approval", "order", "created_at", "updated_at")
|
||||
SELECT "id", "phase_id", "initiative_id", "plan_id", "name", "description", "type", "category", "priority", "status", "requires_approval", "order", "created_at", "updated_at" FROM `tasks`;--> statement-breakpoint
|
||||
|
||||
-- Step 4: Drop old tasks table and rename new one
|
||||
DROP TABLE `tasks`;--> statement-breakpoint
|
||||
ALTER TABLE `__new_tasks` RENAME TO `tasks`;--> statement-breakpoint
|
||||
|
||||
-- Step 5: Drop plans table
|
||||
DROP TABLE `plans`;--> statement-breakpoint
|
||||
|
||||
PRAGMA foreign_keys=ON;
|
||||
4
apps/server/drizzle/0009_drop_account_config_dir.sql
Normal file
4
apps/server/drizzle/0009_drop_account_config_dir.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
-- Migration: Remove config_dir column from accounts table
|
||||
-- Path is now convention-based: <workspaceRoot>/.cw/accounts/<accountId>/
|
||||
|
||||
ALTER TABLE `accounts` DROP COLUMN `config_dir`;
|
||||
5
apps/server/drizzle/0010_add_account_credentials.sql
Normal file
5
apps/server/drizzle/0010_add_account_credentials.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
-- Migration: Add config_json and credentials columns to accounts table
|
||||
-- Credentials are now stored in DB and written to disk before spawning agents.
|
||||
|
||||
ALTER TABLE `accounts` ADD COLUMN `config_json` text;--> statement-breakpoint
|
||||
ALTER TABLE `accounts` ADD COLUMN `credentials` text;
|
||||
4
apps/server/drizzle/0011_drop_initiative_description.sql
Normal file
4
apps/server/drizzle/0011_drop_initiative_description.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
-- Migration: Remove unused description column from initiatives table
|
||||
-- Content is stored in pages (markdown via Tiptap editor), not in the initiative itself.
|
||||
|
||||
ALTER TABLE `initiatives` DROP COLUMN `description`;
|
||||
1
apps/server/drizzle/0012_add_agent_user_dismissed_at.sql
Normal file
1
apps/server/drizzle/0012_add_agent_user_dismissed_at.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `agents` ADD `user_dismissed_at` integer;
|
||||
15
apps/server/drizzle/0013_add_proposals_table.sql
Normal file
15
apps/server/drizzle/0013_add_proposals_table.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
CREATE TABLE `proposals` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`agent_id` text NOT NULL REFERENCES `agents`(`id`) ON DELETE cascade,
|
||||
`initiative_id` text NOT NULL REFERENCES `initiatives`(`id`) ON DELETE cascade,
|
||||
`target_type` text NOT NULL,
|
||||
`target_id` text,
|
||||
`title` text NOT NULL,
|
||||
`summary` text,
|
||||
`content` text,
|
||||
`metadata` text,
|
||||
`status` text NOT NULL DEFAULT 'pending',
|
||||
`sort_order` integer NOT NULL DEFAULT 0,
|
||||
`created_at` integer NOT NULL,
|
||||
`updated_at` integer NOT NULL
|
||||
);
|
||||
1
apps/server/drizzle/0014_add_exit_code_to_agents.sql
Normal file
1
apps/server/drizzle/0014_add_exit_code_to_agents.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `agents` ADD `exit_code` integer;
|
||||
12
apps/server/drizzle/0015_add_agent_log_chunks.sql
Normal file
12
apps/server/drizzle/0015_add_agent_log_chunks.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- Migration: Add agent_log_chunks table for DB-first agent output persistence
|
||||
-- Chunks survive agent deletion (no FK to agents table)
|
||||
|
||||
CREATE TABLE `agent_log_chunks` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`agent_id` text NOT NULL,
|
||||
`agent_name` text NOT NULL,
|
||||
`session_number` integer DEFAULT 1 NOT NULL,
|
||||
`content` text NOT NULL,
|
||||
`created_at` integer NOT NULL
|
||||
);--> statement-breakpoint
|
||||
CREATE INDEX `agent_log_chunks_agent_id_idx` ON `agent_log_chunks` (`agent_id`);
|
||||
1
apps/server/drizzle/0016_add_phase_content.sql
Normal file
1
apps/server/drizzle/0016_add_phase_content.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `phases` ADD COLUMN `content` text;
|
||||
1
apps/server/drizzle/0017_drop_phase_description.sql
Normal file
1
apps/server/drizzle/0017_drop_phase_description.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `phases` DROP COLUMN `description`;
|
||||
1
apps/server/drizzle/0018_drop_phase_number.sql
Normal file
1
apps/server/drizzle/0018_drop_phase_number.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `phases` DROP COLUMN `number`;
|
||||
1
apps/server/drizzle/0019_add_execution_mode.sql
Normal file
1
apps/server/drizzle/0019_add_execution_mode.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE initiatives ADD COLUMN execution_mode TEXT NOT NULL DEFAULT 'review_per_phase';
|
||||
25
apps/server/drizzle/0020_add_change_sets.sql
Normal file
25
apps/server/drizzle/0020_add_change_sets.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
-- Add change_sets and change_set_entries tables
|
||||
CREATE TABLE `change_sets` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`agent_id` text REFERENCES `agents`(`id`) ON DELETE SET NULL,
|
||||
`agent_name` text NOT NULL,
|
||||
`initiative_id` text NOT NULL REFERENCES `initiatives`(`id`) ON DELETE CASCADE,
|
||||
`mode` text NOT NULL,
|
||||
`summary` text,
|
||||
`status` text NOT NULL DEFAULT 'applied',
|
||||
`reverted_at` integer,
|
||||
`created_at` integer NOT NULL
|
||||
);--> statement-breakpoint
|
||||
CREATE TABLE `change_set_entries` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`change_set_id` text NOT NULL REFERENCES `change_sets`(`id`) ON DELETE CASCADE,
|
||||
`entity_type` text NOT NULL,
|
||||
`entity_id` text NOT NULL,
|
||||
`action` text NOT NULL,
|
||||
`previous_state` text,
|
||||
`new_state` text,
|
||||
`sort_order` integer NOT NULL DEFAULT 0,
|
||||
`created_at` integer NOT NULL
|
||||
);--> statement-breakpoint
|
||||
CREATE INDEX `change_sets_initiative_id_idx` ON `change_sets`(`initiative_id`);--> statement-breakpoint
|
||||
CREATE INDEX `change_set_entries_change_set_id_idx` ON `change_set_entries`(`change_set_id`);
|
||||
2
apps/server/drizzle/0021_drop_proposals.sql
Normal file
2
apps/server/drizzle/0021_drop_proposals.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
-- Drop proposals table (replaced by change_sets + change_set_entries)
|
||||
DROP TABLE IF EXISTS `proposals`;
|
||||
4
apps/server/drizzle/0022_branch_refactor.sql
Normal file
4
apps/server/drizzle/0022_branch_refactor.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
-- Rename merge_target → branch on initiatives, add default_branch to projects
|
||||
ALTER TABLE `initiatives` RENAME COLUMN `merge_target` TO `branch`;
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE `projects` ADD COLUMN `default_branch` TEXT NOT NULL DEFAULT 'main';
|
||||
12
apps/server/drizzle/0023_rename_breakdown_decompose.sql
Normal file
12
apps/server/drizzle/0023_rename_breakdown_decompose.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- Rename agent modes: breakdown → plan, decompose → detail
|
||||
UPDATE tasks SET category = 'plan' WHERE category = 'breakdown';
|
||||
--> statement-breakpoint
|
||||
UPDATE tasks SET category = 'detail' WHERE category = 'decompose';
|
||||
--> statement-breakpoint
|
||||
UPDATE agents SET mode = 'plan' WHERE mode = 'breakdown';
|
||||
--> statement-breakpoint
|
||||
UPDATE agents SET mode = 'detail' WHERE mode = 'decompose';
|
||||
--> statement-breakpoint
|
||||
UPDATE change_sets SET mode = 'plan' WHERE mode = 'breakdown';
|
||||
--> statement-breakpoint
|
||||
UPDATE change_sets SET mode = 'detail' WHERE mode = 'decompose';
|
||||
18
apps/server/drizzle/0024_add_conversations.sql
Normal file
18
apps/server/drizzle/0024_add_conversations.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
-- 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`);
|
||||
32
apps/server/drizzle/0025_fix_agents_fk_constraints.sql
Normal file
32
apps/server/drizzle/0025_fix_agents_fk_constraints.sql
Normal file
@@ -0,0 +1,32 @@
|
||||
-- Fix agents table FK constraints: initiative_id and account_id need ON DELETE SET NULL
|
||||
-- SQLite cannot ALTER column constraints, so we must recreate the table
|
||||
|
||||
CREATE TABLE `agents_new` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`task_id` text REFERENCES `tasks`(`id`) ON DELETE SET NULL,
|
||||
`initiative_id` text REFERENCES `initiatives`(`id`) ON DELETE SET NULL,
|
||||
`session_id` text,
|
||||
`worktree_id` text NOT NULL,
|
||||
`provider` text DEFAULT 'claude' NOT NULL,
|
||||
`account_id` text REFERENCES `accounts`(`id`) ON DELETE SET NULL,
|
||||
`status` text DEFAULT 'idle' NOT NULL,
|
||||
`mode` text DEFAULT 'execute' NOT NULL,
|
||||
`pid` integer,
|
||||
`exit_code` integer,
|
||||
`output_file_path` text,
|
||||
`result` text,
|
||||
`pending_questions` text,
|
||||
`created_at` integer NOT NULL,
|
||||
`updated_at` integer NOT NULL,
|
||||
`user_dismissed_at` integer
|
||||
);--> statement-breakpoint
|
||||
INSERT INTO `agents_new` SELECT
|
||||
`id`, `name`, `task_id`, `initiative_id`, `session_id`, `worktree_id`,
|
||||
`provider`, `account_id`, `status`, `mode`, `pid`, `exit_code`,
|
||||
`output_file_path`, `result`, `pending_questions`,
|
||||
`created_at`, `updated_at`, `user_dismissed_at`
|
||||
FROM `agents`;--> statement-breakpoint
|
||||
DROP TABLE `agents`;--> statement-breakpoint
|
||||
ALTER TABLE `agents_new` RENAME TO `agents`;--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `agents_name_unique` ON `agents` (`name`);
|
||||
630
apps/server/drizzle/meta/0000_snapshot.json
Normal file
630
apps/server/drizzle/meta/0000_snapshot.json
Normal file
@@ -0,0 +1,630 @@
|
||||
{
|
||||
"version": "6",
|
||||
"dialect": "sqlite",
|
||||
"id": "d2fc5ac9-8232-401a-a55f-a97a4d9b6f21",
|
||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||
"tables": {
|
||||
"agents": {
|
||||
"name": "agents",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"task_id": {
|
||||
"name": "task_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"session_id": {
|
||||
"name": "session_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"worktree_id": {
|
||||
"name": "worktree_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'idle'"
|
||||
},
|
||||
"mode": {
|
||||
"name": "mode",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'execute'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"agents_name_unique": {
|
||||
"name": "agents_name_unique",
|
||||
"columns": [
|
||||
"name"
|
||||
],
|
||||
"isUnique": true
|
||||
}
|
||||
},
|
||||
"foreignKeys": {
|
||||
"agents_task_id_tasks_id_fk": {
|
||||
"name": "agents_task_id_tasks_id_fk",
|
||||
"tableFrom": "agents",
|
||||
"tableTo": "tasks",
|
||||
"columnsFrom": [
|
||||
"task_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"initiatives": {
|
||||
"name": "initiatives",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'active'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"messages": {
|
||||
"name": "messages",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"sender_type": {
|
||||
"name": "sender_type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"sender_id": {
|
||||
"name": "sender_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"recipient_type": {
|
||||
"name": "recipient_type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"recipient_id": {
|
||||
"name": "recipient_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"type": {
|
||||
"name": "type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'info'"
|
||||
},
|
||||
"content": {
|
||||
"name": "content",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"requires_response": {
|
||||
"name": "requires_response",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"parent_message_id": {
|
||||
"name": "parent_message_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"messages_sender_id_agents_id_fk": {
|
||||
"name": "messages_sender_id_agents_id_fk",
|
||||
"tableFrom": "messages",
|
||||
"tableTo": "agents",
|
||||
"columnsFrom": [
|
||||
"sender_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"messages_recipient_id_agents_id_fk": {
|
||||
"name": "messages_recipient_id_agents_id_fk",
|
||||
"tableFrom": "messages",
|
||||
"tableTo": "agents",
|
||||
"columnsFrom": [
|
||||
"recipient_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"messages_parent_message_id_messages_id_fk": {
|
||||
"name": "messages_parent_message_id_messages_id_fk",
|
||||
"tableFrom": "messages",
|
||||
"tableTo": "messages",
|
||||
"columnsFrom": [
|
||||
"parent_message_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"phases": {
|
||||
"name": "phases",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"initiative_id": {
|
||||
"name": "initiative_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"number": {
|
||||
"name": "number",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"phases_initiative_id_initiatives_id_fk": {
|
||||
"name": "phases_initiative_id_initiatives_id_fk",
|
||||
"tableFrom": "phases",
|
||||
"tableTo": "initiatives",
|
||||
"columnsFrom": [
|
||||
"initiative_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"plans": {
|
||||
"name": "plans",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"phase_id": {
|
||||
"name": "phase_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"number": {
|
||||
"name": "number",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"plans_phase_id_phases_id_fk": {
|
||||
"name": "plans_phase_id_phases_id_fk",
|
||||
"tableFrom": "plans",
|
||||
"tableTo": "phases",
|
||||
"columnsFrom": [
|
||||
"phase_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"task_dependencies": {
|
||||
"name": "task_dependencies",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"task_id": {
|
||||
"name": "task_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"depends_on_task_id": {
|
||||
"name": "depends_on_task_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"task_dependencies_task_id_tasks_id_fk": {
|
||||
"name": "task_dependencies_task_id_tasks_id_fk",
|
||||
"tableFrom": "task_dependencies",
|
||||
"tableTo": "tasks",
|
||||
"columnsFrom": [
|
||||
"task_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"task_dependencies_depends_on_task_id_tasks_id_fk": {
|
||||
"name": "task_dependencies_depends_on_task_id_tasks_id_fk",
|
||||
"tableFrom": "task_dependencies",
|
||||
"tableTo": "tasks",
|
||||
"columnsFrom": [
|
||||
"depends_on_task_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"tasks": {
|
||||
"name": "tasks",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"plan_id": {
|
||||
"name": "plan_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"type": {
|
||||
"name": "type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'auto'"
|
||||
},
|
||||
"priority": {
|
||||
"name": "priority",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'medium'"
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"order": {
|
||||
"name": "order",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": 0
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"tasks_plan_id_plans_id_fk": {
|
||||
"name": "tasks_plan_id_plans_id_fk",
|
||||
"tableFrom": "tasks",
|
||||
"tableTo": "plans",
|
||||
"columnsFrom": [
|
||||
"plan_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
}
|
||||
},
|
||||
"views": {},
|
||||
"enums": {},
|
||||
"_meta": {
|
||||
"schemas": {},
|
||||
"tables": {},
|
||||
"columns": {}
|
||||
},
|
||||
"internal": {
|
||||
"indexes": {}
|
||||
}
|
||||
}
|
||||
695
apps/server/drizzle/meta/0001_snapshot.json
Normal file
695
apps/server/drizzle/meta/0001_snapshot.json
Normal file
@@ -0,0 +1,695 @@
|
||||
{
|
||||
"version": "6",
|
||||
"dialect": "sqlite",
|
||||
"id": "43bf93b7-da71-4b69-b289-2991b6e54a69",
|
||||
"prevId": "d2fc5ac9-8232-401a-a55f-a97a4d9b6f21",
|
||||
"tables": {
|
||||
"agents": {
|
||||
"name": "agents",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"task_id": {
|
||||
"name": "task_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"session_id": {
|
||||
"name": "session_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"worktree_id": {
|
||||
"name": "worktree_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'idle'"
|
||||
},
|
||||
"mode": {
|
||||
"name": "mode",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'execute'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"agents_name_unique": {
|
||||
"name": "agents_name_unique",
|
||||
"columns": [
|
||||
"name"
|
||||
],
|
||||
"isUnique": true
|
||||
}
|
||||
},
|
||||
"foreignKeys": {
|
||||
"agents_task_id_tasks_id_fk": {
|
||||
"name": "agents_task_id_tasks_id_fk",
|
||||
"tableFrom": "agents",
|
||||
"tableTo": "tasks",
|
||||
"columnsFrom": [
|
||||
"task_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"initiatives": {
|
||||
"name": "initiatives",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'active'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"messages": {
|
||||
"name": "messages",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"sender_type": {
|
||||
"name": "sender_type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"sender_id": {
|
||||
"name": "sender_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"recipient_type": {
|
||||
"name": "recipient_type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"recipient_id": {
|
||||
"name": "recipient_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"type": {
|
||||
"name": "type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'info'"
|
||||
},
|
||||
"content": {
|
||||
"name": "content",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"requires_response": {
|
||||
"name": "requires_response",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"parent_message_id": {
|
||||
"name": "parent_message_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"messages_sender_id_agents_id_fk": {
|
||||
"name": "messages_sender_id_agents_id_fk",
|
||||
"tableFrom": "messages",
|
||||
"tableTo": "agents",
|
||||
"columnsFrom": [
|
||||
"sender_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"messages_recipient_id_agents_id_fk": {
|
||||
"name": "messages_recipient_id_agents_id_fk",
|
||||
"tableFrom": "messages",
|
||||
"tableTo": "agents",
|
||||
"columnsFrom": [
|
||||
"recipient_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"messages_parent_message_id_messages_id_fk": {
|
||||
"name": "messages_parent_message_id_messages_id_fk",
|
||||
"tableFrom": "messages",
|
||||
"tableTo": "messages",
|
||||
"columnsFrom": [
|
||||
"parent_message_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"phase_dependencies": {
|
||||
"name": "phase_dependencies",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"phase_id": {
|
||||
"name": "phase_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"depends_on_phase_id": {
|
||||
"name": "depends_on_phase_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"phase_dependencies_phase_id_phases_id_fk": {
|
||||
"name": "phase_dependencies_phase_id_phases_id_fk",
|
||||
"tableFrom": "phase_dependencies",
|
||||
"tableTo": "phases",
|
||||
"columnsFrom": [
|
||||
"phase_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"phase_dependencies_depends_on_phase_id_phases_id_fk": {
|
||||
"name": "phase_dependencies_depends_on_phase_id_phases_id_fk",
|
||||
"tableFrom": "phase_dependencies",
|
||||
"tableTo": "phases",
|
||||
"columnsFrom": [
|
||||
"depends_on_phase_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"phases": {
|
||||
"name": "phases",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"initiative_id": {
|
||||
"name": "initiative_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"number": {
|
||||
"name": "number",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"phases_initiative_id_initiatives_id_fk": {
|
||||
"name": "phases_initiative_id_initiatives_id_fk",
|
||||
"tableFrom": "phases",
|
||||
"tableTo": "initiatives",
|
||||
"columnsFrom": [
|
||||
"initiative_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"plans": {
|
||||
"name": "plans",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"phase_id": {
|
||||
"name": "phase_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"number": {
|
||||
"name": "number",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"plans_phase_id_phases_id_fk": {
|
||||
"name": "plans_phase_id_phases_id_fk",
|
||||
"tableFrom": "plans",
|
||||
"tableTo": "phases",
|
||||
"columnsFrom": [
|
||||
"phase_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"task_dependencies": {
|
||||
"name": "task_dependencies",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"task_id": {
|
||||
"name": "task_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"depends_on_task_id": {
|
||||
"name": "depends_on_task_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"task_dependencies_task_id_tasks_id_fk": {
|
||||
"name": "task_dependencies_task_id_tasks_id_fk",
|
||||
"tableFrom": "task_dependencies",
|
||||
"tableTo": "tasks",
|
||||
"columnsFrom": [
|
||||
"task_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"task_dependencies_depends_on_task_id_tasks_id_fk": {
|
||||
"name": "task_dependencies_depends_on_task_id_tasks_id_fk",
|
||||
"tableFrom": "task_dependencies",
|
||||
"tableTo": "tasks",
|
||||
"columnsFrom": [
|
||||
"depends_on_task_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"tasks": {
|
||||
"name": "tasks",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"plan_id": {
|
||||
"name": "plan_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"type": {
|
||||
"name": "type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'auto'"
|
||||
},
|
||||
"priority": {
|
||||
"name": "priority",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'medium'"
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"order": {
|
||||
"name": "order",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": 0
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"tasks_plan_id_plans_id_fk": {
|
||||
"name": "tasks_plan_id_plans_id_fk",
|
||||
"tableFrom": "tasks",
|
||||
"tableTo": "plans",
|
||||
"columnsFrom": [
|
||||
"plan_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
}
|
||||
},
|
||||
"views": {},
|
||||
"enums": {},
|
||||
"_meta": {
|
||||
"schemas": {},
|
||||
"tables": {},
|
||||
"columns": {}
|
||||
},
|
||||
"internal": {
|
||||
"indexes": {}
|
||||
}
|
||||
}
|
||||
789
apps/server/drizzle/meta/0002_snapshot.json
Normal file
789
apps/server/drizzle/meta/0002_snapshot.json
Normal file
@@ -0,0 +1,789 @@
|
||||
{
|
||||
"version": "6",
|
||||
"dialect": "sqlite",
|
||||
"id": "cd4eb2e6-af83-473e-a189-8480d217b3c8",
|
||||
"prevId": "43bf93b7-da71-4b69-b289-2991b6e54a69",
|
||||
"tables": {
|
||||
"agents": {
|
||||
"name": "agents",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"task_id": {
|
||||
"name": "task_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"session_id": {
|
||||
"name": "session_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"worktree_id": {
|
||||
"name": "worktree_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'idle'"
|
||||
},
|
||||
"mode": {
|
||||
"name": "mode",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'execute'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"agents_name_unique": {
|
||||
"name": "agents_name_unique",
|
||||
"columns": [
|
||||
"name"
|
||||
],
|
||||
"isUnique": true
|
||||
}
|
||||
},
|
||||
"foreignKeys": {
|
||||
"agents_task_id_tasks_id_fk": {
|
||||
"name": "agents_task_id_tasks_id_fk",
|
||||
"tableFrom": "agents",
|
||||
"tableTo": "tasks",
|
||||
"columnsFrom": [
|
||||
"task_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"initiatives": {
|
||||
"name": "initiatives",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'active'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"messages": {
|
||||
"name": "messages",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"sender_type": {
|
||||
"name": "sender_type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"sender_id": {
|
||||
"name": "sender_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"recipient_type": {
|
||||
"name": "recipient_type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"recipient_id": {
|
||||
"name": "recipient_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"type": {
|
||||
"name": "type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'info'"
|
||||
},
|
||||
"content": {
|
||||
"name": "content",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"requires_response": {
|
||||
"name": "requires_response",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"parent_message_id": {
|
||||
"name": "parent_message_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"messages_sender_id_agents_id_fk": {
|
||||
"name": "messages_sender_id_agents_id_fk",
|
||||
"tableFrom": "messages",
|
||||
"tableTo": "agents",
|
||||
"columnsFrom": [
|
||||
"sender_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"messages_recipient_id_agents_id_fk": {
|
||||
"name": "messages_recipient_id_agents_id_fk",
|
||||
"tableFrom": "messages",
|
||||
"tableTo": "agents",
|
||||
"columnsFrom": [
|
||||
"recipient_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"messages_parent_message_id_messages_id_fk": {
|
||||
"name": "messages_parent_message_id_messages_id_fk",
|
||||
"tableFrom": "messages",
|
||||
"tableTo": "messages",
|
||||
"columnsFrom": [
|
||||
"parent_message_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"pages": {
|
||||
"name": "pages",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"initiative_id": {
|
||||
"name": "initiative_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"parent_page_id": {
|
||||
"name": "parent_page_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"title": {
|
||||
"name": "title",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"content": {
|
||||
"name": "content",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"sort_order": {
|
||||
"name": "sort_order",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": 0
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"pages_initiative_id_initiatives_id_fk": {
|
||||
"name": "pages_initiative_id_initiatives_id_fk",
|
||||
"tableFrom": "pages",
|
||||
"tableTo": "initiatives",
|
||||
"columnsFrom": [
|
||||
"initiative_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"pages_parent_page_id_pages_id_fk": {
|
||||
"name": "pages_parent_page_id_pages_id_fk",
|
||||
"tableFrom": "pages",
|
||||
"tableTo": "pages",
|
||||
"columnsFrom": [
|
||||
"parent_page_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"phase_dependencies": {
|
||||
"name": "phase_dependencies",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"phase_id": {
|
||||
"name": "phase_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"depends_on_phase_id": {
|
||||
"name": "depends_on_phase_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"phase_dependencies_phase_id_phases_id_fk": {
|
||||
"name": "phase_dependencies_phase_id_phases_id_fk",
|
||||
"tableFrom": "phase_dependencies",
|
||||
"tableTo": "phases",
|
||||
"columnsFrom": [
|
||||
"phase_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"phase_dependencies_depends_on_phase_id_phases_id_fk": {
|
||||
"name": "phase_dependencies_depends_on_phase_id_phases_id_fk",
|
||||
"tableFrom": "phase_dependencies",
|
||||
"tableTo": "phases",
|
||||
"columnsFrom": [
|
||||
"depends_on_phase_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"phases": {
|
||||
"name": "phases",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"initiative_id": {
|
||||
"name": "initiative_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"number": {
|
||||
"name": "number",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"phases_initiative_id_initiatives_id_fk": {
|
||||
"name": "phases_initiative_id_initiatives_id_fk",
|
||||
"tableFrom": "phases",
|
||||
"tableTo": "initiatives",
|
||||
"columnsFrom": [
|
||||
"initiative_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"plans": {
|
||||
"name": "plans",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"phase_id": {
|
||||
"name": "phase_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"number": {
|
||||
"name": "number",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"plans_phase_id_phases_id_fk": {
|
||||
"name": "plans_phase_id_phases_id_fk",
|
||||
"tableFrom": "plans",
|
||||
"tableTo": "phases",
|
||||
"columnsFrom": [
|
||||
"phase_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"task_dependencies": {
|
||||
"name": "task_dependencies",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"task_id": {
|
||||
"name": "task_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"depends_on_task_id": {
|
||||
"name": "depends_on_task_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"task_dependencies_task_id_tasks_id_fk": {
|
||||
"name": "task_dependencies_task_id_tasks_id_fk",
|
||||
"tableFrom": "task_dependencies",
|
||||
"tableTo": "tasks",
|
||||
"columnsFrom": [
|
||||
"task_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"task_dependencies_depends_on_task_id_tasks_id_fk": {
|
||||
"name": "task_dependencies_depends_on_task_id_tasks_id_fk",
|
||||
"tableFrom": "task_dependencies",
|
||||
"tableTo": "tasks",
|
||||
"columnsFrom": [
|
||||
"depends_on_task_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"tasks": {
|
||||
"name": "tasks",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"plan_id": {
|
||||
"name": "plan_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"type": {
|
||||
"name": "type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'auto'"
|
||||
},
|
||||
"priority": {
|
||||
"name": "priority",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'medium'"
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"order": {
|
||||
"name": "order",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": 0
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"tasks_plan_id_plans_id_fk": {
|
||||
"name": "tasks_plan_id_plans_id_fk",
|
||||
"tableFrom": "tasks",
|
||||
"tableTo": "plans",
|
||||
"columnsFrom": [
|
||||
"plan_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
}
|
||||
},
|
||||
"views": {},
|
||||
"enums": {},
|
||||
"_meta": {
|
||||
"schemas": {},
|
||||
"tables": {},
|
||||
"columns": {}
|
||||
},
|
||||
"internal": {
|
||||
"indexes": {}
|
||||
}
|
||||
}
|
||||
923
apps/server/drizzle/meta/0003_snapshot.json
Normal file
923
apps/server/drizzle/meta/0003_snapshot.json
Normal file
@@ -0,0 +1,923 @@
|
||||
{
|
||||
"version": "6",
|
||||
"dialect": "sqlite",
|
||||
"id": "0750ece4-b483-4fb3-8c64-3fbbc13b041d",
|
||||
"prevId": "cd4eb2e6-af83-473e-a189-8480d217b3c8",
|
||||
"tables": {
|
||||
"agents": {
|
||||
"name": "agents",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"task_id": {
|
||||
"name": "task_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"session_id": {
|
||||
"name": "session_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"worktree_id": {
|
||||
"name": "worktree_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'idle'"
|
||||
},
|
||||
"mode": {
|
||||
"name": "mode",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'execute'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"agents_name_unique": {
|
||||
"name": "agents_name_unique",
|
||||
"columns": [
|
||||
"name"
|
||||
],
|
||||
"isUnique": true
|
||||
}
|
||||
},
|
||||
"foreignKeys": {
|
||||
"agents_task_id_tasks_id_fk": {
|
||||
"name": "agents_task_id_tasks_id_fk",
|
||||
"tableFrom": "agents",
|
||||
"tableTo": "tasks",
|
||||
"columnsFrom": [
|
||||
"task_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"initiative_projects": {
|
||||
"name": "initiative_projects",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"initiative_id": {
|
||||
"name": "initiative_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"project_id": {
|
||||
"name": "project_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"initiative_project_unique": {
|
||||
"name": "initiative_project_unique",
|
||||
"columns": [
|
||||
"initiative_id",
|
||||
"project_id"
|
||||
],
|
||||
"isUnique": true
|
||||
}
|
||||
},
|
||||
"foreignKeys": {
|
||||
"initiative_projects_initiative_id_initiatives_id_fk": {
|
||||
"name": "initiative_projects_initiative_id_initiatives_id_fk",
|
||||
"tableFrom": "initiative_projects",
|
||||
"tableTo": "initiatives",
|
||||
"columnsFrom": [
|
||||
"initiative_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"initiative_projects_project_id_projects_id_fk": {
|
||||
"name": "initiative_projects_project_id_projects_id_fk",
|
||||
"tableFrom": "initiative_projects",
|
||||
"tableTo": "projects",
|
||||
"columnsFrom": [
|
||||
"project_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"initiatives": {
|
||||
"name": "initiatives",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'active'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"messages": {
|
||||
"name": "messages",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"sender_type": {
|
||||
"name": "sender_type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"sender_id": {
|
||||
"name": "sender_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"recipient_type": {
|
||||
"name": "recipient_type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"recipient_id": {
|
||||
"name": "recipient_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"type": {
|
||||
"name": "type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'info'"
|
||||
},
|
||||
"content": {
|
||||
"name": "content",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"requires_response": {
|
||||
"name": "requires_response",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"parent_message_id": {
|
||||
"name": "parent_message_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"messages_sender_id_agents_id_fk": {
|
||||
"name": "messages_sender_id_agents_id_fk",
|
||||
"tableFrom": "messages",
|
||||
"tableTo": "agents",
|
||||
"columnsFrom": [
|
||||
"sender_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"messages_recipient_id_agents_id_fk": {
|
||||
"name": "messages_recipient_id_agents_id_fk",
|
||||
"tableFrom": "messages",
|
||||
"tableTo": "agents",
|
||||
"columnsFrom": [
|
||||
"recipient_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"messages_parent_message_id_messages_id_fk": {
|
||||
"name": "messages_parent_message_id_messages_id_fk",
|
||||
"tableFrom": "messages",
|
||||
"tableTo": "messages",
|
||||
"columnsFrom": [
|
||||
"parent_message_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"pages": {
|
||||
"name": "pages",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"initiative_id": {
|
||||
"name": "initiative_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"parent_page_id": {
|
||||
"name": "parent_page_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"title": {
|
||||
"name": "title",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"content": {
|
||||
"name": "content",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"sort_order": {
|
||||
"name": "sort_order",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": 0
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"pages_initiative_id_initiatives_id_fk": {
|
||||
"name": "pages_initiative_id_initiatives_id_fk",
|
||||
"tableFrom": "pages",
|
||||
"tableTo": "initiatives",
|
||||
"columnsFrom": [
|
||||
"initiative_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"pages_parent_page_id_pages_id_fk": {
|
||||
"name": "pages_parent_page_id_pages_id_fk",
|
||||
"tableFrom": "pages",
|
||||
"tableTo": "pages",
|
||||
"columnsFrom": [
|
||||
"parent_page_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"phase_dependencies": {
|
||||
"name": "phase_dependencies",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"phase_id": {
|
||||
"name": "phase_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"depends_on_phase_id": {
|
||||
"name": "depends_on_phase_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"phase_dependencies_phase_id_phases_id_fk": {
|
||||
"name": "phase_dependencies_phase_id_phases_id_fk",
|
||||
"tableFrom": "phase_dependencies",
|
||||
"tableTo": "phases",
|
||||
"columnsFrom": [
|
||||
"phase_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"phase_dependencies_depends_on_phase_id_phases_id_fk": {
|
||||
"name": "phase_dependencies_depends_on_phase_id_phases_id_fk",
|
||||
"tableFrom": "phase_dependencies",
|
||||
"tableTo": "phases",
|
||||
"columnsFrom": [
|
||||
"depends_on_phase_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"phases": {
|
||||
"name": "phases",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"initiative_id": {
|
||||
"name": "initiative_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"number": {
|
||||
"name": "number",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"phases_initiative_id_initiatives_id_fk": {
|
||||
"name": "phases_initiative_id_initiatives_id_fk",
|
||||
"tableFrom": "phases",
|
||||
"tableTo": "initiatives",
|
||||
"columnsFrom": [
|
||||
"initiative_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"plans": {
|
||||
"name": "plans",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"phase_id": {
|
||||
"name": "phase_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"number": {
|
||||
"name": "number",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"plans_phase_id_phases_id_fk": {
|
||||
"name": "plans_phase_id_phases_id_fk",
|
||||
"tableFrom": "plans",
|
||||
"tableTo": "phases",
|
||||
"columnsFrom": [
|
||||
"phase_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"projects": {
|
||||
"name": "projects",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"url": {
|
||||
"name": "url",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"projects_name_unique": {
|
||||
"name": "projects_name_unique",
|
||||
"columns": [
|
||||
"name"
|
||||
],
|
||||
"isUnique": true
|
||||
},
|
||||
"projects_url_unique": {
|
||||
"name": "projects_url_unique",
|
||||
"columns": [
|
||||
"url"
|
||||
],
|
||||
"isUnique": true
|
||||
}
|
||||
},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"task_dependencies": {
|
||||
"name": "task_dependencies",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"task_id": {
|
||||
"name": "task_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"depends_on_task_id": {
|
||||
"name": "depends_on_task_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"task_dependencies_task_id_tasks_id_fk": {
|
||||
"name": "task_dependencies_task_id_tasks_id_fk",
|
||||
"tableFrom": "task_dependencies",
|
||||
"tableTo": "tasks",
|
||||
"columnsFrom": [
|
||||
"task_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"task_dependencies_depends_on_task_id_tasks_id_fk": {
|
||||
"name": "task_dependencies_depends_on_task_id_tasks_id_fk",
|
||||
"tableFrom": "task_dependencies",
|
||||
"tableTo": "tasks",
|
||||
"columnsFrom": [
|
||||
"depends_on_task_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
},
|
||||
"tasks": {
|
||||
"name": "tasks",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"plan_id": {
|
||||
"name": "plan_id",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"type": {
|
||||
"name": "type",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'auto'"
|
||||
},
|
||||
"priority": {
|
||||
"name": "priority",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'medium'"
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": "'pending'"
|
||||
},
|
||||
"order": {
|
||||
"name": "order",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false,
|
||||
"default": 0
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"tasks_plan_id_plans_id_fk": {
|
||||
"name": "tasks_plan_id_plans_id_fk",
|
||||
"tableFrom": "tasks",
|
||||
"tableTo": "plans",
|
||||
"columnsFrom": [
|
||||
"plan_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "cascade",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"checkConstraints": {}
|
||||
}
|
||||
},
|
||||
"views": {},
|
||||
"enums": {},
|
||||
"_meta": {
|
||||
"schemas": {},
|
||||
"tables": {},
|
||||
"columns": {}
|
||||
},
|
||||
"internal": {
|
||||
"indexes": {}
|
||||
}
|
||||
}
|
||||
1034
apps/server/drizzle/meta/0004_snapshot.json
Normal file
1034
apps/server/drizzle/meta/0004_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
1062
apps/server/drizzle/meta/0005_snapshot.json
Normal file
1062
apps/server/drizzle/meta/0005_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
1082
apps/server/drizzle/meta/0006_snapshot.json
Normal file
1082
apps/server/drizzle/meta/0006_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
1152
apps/server/drizzle/meta/0007_snapshot.json
Normal file
1152
apps/server/drizzle/meta/0007_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
188
apps/server/drizzle/meta/_journal.json
Normal file
188
apps/server/drizzle/meta/_journal.json
Normal file
@@ -0,0 +1,188 @@
|
||||
{
|
||||
"version": "7",
|
||||
"dialect": "sqlite",
|
||||
"entries": [
|
||||
{
|
||||
"idx": 0,
|
||||
"version": "6",
|
||||
"when": 1769882826521,
|
||||
"tag": "0000_bizarre_naoko",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 1,
|
||||
"version": "6",
|
||||
"when": 1770236400939,
|
||||
"tag": "0001_overrated_gladiator",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 2,
|
||||
"version": "6",
|
||||
"when": 1770283755529,
|
||||
"tag": "0002_bumpy_killraven",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 3,
|
||||
"version": "6",
|
||||
"when": 1770310029604,
|
||||
"tag": "0003_curly_ser_duncan",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 4,
|
||||
"version": "6",
|
||||
"when": 1770311913089,
|
||||
"tag": "0004_white_captain_britain",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 5,
|
||||
"version": "6",
|
||||
"when": 1770314201607,
|
||||
"tag": "0005_blushing_wendell_vaughn",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 6,
|
||||
"version": "6",
|
||||
"when": 1770317104950,
|
||||
"tag": "0006_curvy_sandman",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 7,
|
||||
"version": "6",
|
||||
"when": 1770373854589,
|
||||
"tag": "0007_robust_the_watchers",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 8,
|
||||
"version": "6",
|
||||
"when": 1770460800000,
|
||||
"tag": "0008_eliminate_plans_table",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 9,
|
||||
"version": "6",
|
||||
"when": 1770508800000,
|
||||
"tag": "0009_drop_account_config_dir",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 10,
|
||||
"version": "6",
|
||||
"when": 1770512400000,
|
||||
"tag": "0010_add_account_credentials",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 11,
|
||||
"version": "6",
|
||||
"when": 1770595200000,
|
||||
"tag": "0011_drop_initiative_description",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 12,
|
||||
"version": "6",
|
||||
"when": 1770420629437,
|
||||
"tag": "0012_add_agent_user_dismissed_at",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 13,
|
||||
"version": "6",
|
||||
"when": 1770681600000,
|
||||
"tag": "0013_add_proposals_table",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 14,
|
||||
"version": "6",
|
||||
"when": 1770768000000,
|
||||
"tag": "0014_add_exit_code_to_agents",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 15,
|
||||
"version": "6",
|
||||
"when": 1770854400000,
|
||||
"tag": "0015_add_agent_log_chunks",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 16,
|
||||
"version": "6",
|
||||
"when": 1770940800000,
|
||||
"tag": "0016_add_phase_content",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 17,
|
||||
"version": "6",
|
||||
"when": 1771027200000,
|
||||
"tag": "0017_drop_phase_description",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 18,
|
||||
"version": "6",
|
||||
"when": 1771113600000,
|
||||
"tag": "0018_drop_phase_number",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 19,
|
||||
"version": "6",
|
||||
"when": 1771200000000,
|
||||
"tag": "0019_add_execution_mode",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 20,
|
||||
"version": "6",
|
||||
"when": 1771286400000,
|
||||
"tag": "0020_add_change_sets",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 21,
|
||||
"version": "6",
|
||||
"when": 1771372800000,
|
||||
"tag": "0021_drop_proposals",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 22,
|
||||
"version": "6",
|
||||
"when": 1771459200000,
|
||||
"tag": "0022_branch_refactor",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 23,
|
||||
"version": "6",
|
||||
"when": 1771545600000,
|
||||
"tag": "0023_rename_breakdown_decompose",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 24,
|
||||
"version": "6",
|
||||
"when": 1771632000000,
|
||||
"tag": "0024_add_conversations",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 25,
|
||||
"version": "6",
|
||||
"when": 1771718400000,
|
||||
"tag": "0025_fix_agents_fk_constraints",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
102
apps/server/drizzle/relations.ts
Normal file
102
apps/server/drizzle/relations.ts
Normal file
@@ -0,0 +1,102 @@
|
||||
import { relations } from "drizzle-orm/relations";
|
||||
import { tasks, agents, messages, initiatives, phases, plans, taskDependencies, phaseDependencies } from "./schema";
|
||||
|
||||
export const agentsRelations = relations(agents, ({one, many}) => ({
|
||||
task: one(tasks, {
|
||||
fields: [agents.taskId],
|
||||
references: [tasks.id]
|
||||
}),
|
||||
messages_recipientId: many(messages, {
|
||||
relationName: "messages_recipientId_agents_id"
|
||||
}),
|
||||
messages_senderId: many(messages, {
|
||||
relationName: "messages_senderId_agents_id"
|
||||
}),
|
||||
}));
|
||||
|
||||
export const tasksRelations = relations(tasks, ({one, many}) => ({
|
||||
agents: many(agents),
|
||||
taskDependencies_dependsOnTaskId: many(taskDependencies, {
|
||||
relationName: "taskDependencies_dependsOnTaskId_tasks_id"
|
||||
}),
|
||||
taskDependencies_taskId: many(taskDependencies, {
|
||||
relationName: "taskDependencies_taskId_tasks_id"
|
||||
}),
|
||||
plan: one(plans, {
|
||||
fields: [tasks.planId],
|
||||
references: [plans.id]
|
||||
}),
|
||||
}));
|
||||
|
||||
export const messagesRelations = relations(messages, ({one, many}) => ({
|
||||
message: one(messages, {
|
||||
fields: [messages.parentMessageId],
|
||||
references: [messages.id],
|
||||
relationName: "messages_parentMessageId_messages_id"
|
||||
}),
|
||||
messages: many(messages, {
|
||||
relationName: "messages_parentMessageId_messages_id"
|
||||
}),
|
||||
agent_recipientId: one(agents, {
|
||||
fields: [messages.recipientId],
|
||||
references: [agents.id],
|
||||
relationName: "messages_recipientId_agents_id"
|
||||
}),
|
||||
agent_senderId: one(agents, {
|
||||
fields: [messages.senderId],
|
||||
references: [agents.id],
|
||||
relationName: "messages_senderId_agents_id"
|
||||
}),
|
||||
}));
|
||||
|
||||
export const phasesRelations = relations(phases, ({one, many}) => ({
|
||||
initiative: one(initiatives, {
|
||||
fields: [phases.initiativeId],
|
||||
references: [initiatives.id]
|
||||
}),
|
||||
plans: many(plans),
|
||||
phaseDependencies_dependsOnPhaseId: many(phaseDependencies, {
|
||||
relationName: "phaseDependencies_dependsOnPhaseId_phases_id"
|
||||
}),
|
||||
phaseDependencies_phaseId: many(phaseDependencies, {
|
||||
relationName: "phaseDependencies_phaseId_phases_id"
|
||||
}),
|
||||
}));
|
||||
|
||||
export const initiativesRelations = relations(initiatives, ({many}) => ({
|
||||
phases: many(phases),
|
||||
}));
|
||||
|
||||
export const plansRelations = relations(plans, ({one, many}) => ({
|
||||
phase: one(phases, {
|
||||
fields: [plans.phaseId],
|
||||
references: [phases.id]
|
||||
}),
|
||||
tasks: many(tasks),
|
||||
}));
|
||||
|
||||
export const taskDependenciesRelations = relations(taskDependencies, ({one}) => ({
|
||||
task_dependsOnTaskId: one(tasks, {
|
||||
fields: [taskDependencies.dependsOnTaskId],
|
||||
references: [tasks.id],
|
||||
relationName: "taskDependencies_dependsOnTaskId_tasks_id"
|
||||
}),
|
||||
task_taskId: one(tasks, {
|
||||
fields: [taskDependencies.taskId],
|
||||
references: [tasks.id],
|
||||
relationName: "taskDependencies_taskId_tasks_id"
|
||||
}),
|
||||
}));
|
||||
|
||||
export const phaseDependenciesRelations = relations(phaseDependencies, ({one}) => ({
|
||||
phase_dependsOnPhaseId: one(phases, {
|
||||
fields: [phaseDependencies.dependsOnPhaseId],
|
||||
references: [phases.id],
|
||||
relationName: "phaseDependencies_dependsOnPhaseId_phases_id"
|
||||
}),
|
||||
phase_phaseId: one(phases, {
|
||||
fields: [phaseDependencies.phaseId],
|
||||
references: [phases.id],
|
||||
relationName: "phaseDependencies_phaseId_phases_id"
|
||||
}),
|
||||
}));
|
||||
98
apps/server/drizzle/schema.ts
Normal file
98
apps/server/drizzle/schema.ts
Normal file
@@ -0,0 +1,98 @@
|
||||
import { sqliteTable, AnySQLiteColumn, uniqueIndex, foreignKey, text, integer } from "drizzle-orm/sqlite-core"
|
||||
import { sql } from "drizzle-orm"
|
||||
|
||||
export const agents = sqliteTable("agents", {
|
||||
id: text().primaryKey().notNull(),
|
||||
name: text().notNull(),
|
||||
taskId: text("task_id").references(() => tasks.id, { onDelete: "set null" } ),
|
||||
sessionId: text("session_id"),
|
||||
worktreeId: text("worktree_id").notNull(),
|
||||
status: text().default("idle").notNull(),
|
||||
mode: text().default("execute").notNull(),
|
||||
createdAt: integer("created_at").notNull(),
|
||||
updatedAt: integer("updated_at").notNull(),
|
||||
},
|
||||
(table) => [
|
||||
uniqueIndex("agents_name_unique").on(table.name),
|
||||
]);
|
||||
|
||||
export const initiatives = sqliteTable("initiatives", {
|
||||
id: text().primaryKey().notNull(),
|
||||
name: text().notNull(),
|
||||
description: text(),
|
||||
status: text().default("active").notNull(),
|
||||
createdAt: integer("created_at").notNull(),
|
||||
updatedAt: integer("updated_at").notNull(),
|
||||
});
|
||||
|
||||
export const messages = sqliteTable("messages", {
|
||||
id: text().primaryKey().notNull(),
|
||||
senderType: text("sender_type").notNull(),
|
||||
senderId: text("sender_id").references(() => agents.id, { onDelete: "set null" } ),
|
||||
recipientType: text("recipient_type").notNull(),
|
||||
recipientId: text("recipient_id").references(() => agents.id, { onDelete: "set null" } ),
|
||||
type: text().default("info").notNull(),
|
||||
content: text().notNull(),
|
||||
requiresResponse: integer("requires_response").default(false).notNull(),
|
||||
status: text().default("pending").notNull(),
|
||||
parentMessageId: text("parent_message_id"),
|
||||
createdAt: integer("created_at").notNull(),
|
||||
updatedAt: integer("updated_at").notNull(),
|
||||
},
|
||||
(table) => [
|
||||
foreignKey(() => ({
|
||||
columns: [table.parentMessageId],
|
||||
foreignColumns: [table.id],
|
||||
name: "messages_parent_message_id_messages_id_fk"
|
||||
})).onDelete("set null"),
|
||||
]);
|
||||
|
||||
export const phases = sqliteTable("phases", {
|
||||
id: text().primaryKey().notNull(),
|
||||
initiativeId: text("initiative_id").notNull().references(() => initiatives.id, { onDelete: "cascade" } ),
|
||||
number: integer().notNull(),
|
||||
name: text().notNull(),
|
||||
description: text(),
|
||||
status: text().default("pending").notNull(),
|
||||
createdAt: integer("created_at").notNull(),
|
||||
updatedAt: integer("updated_at").notNull(),
|
||||
});
|
||||
|
||||
export const plans = sqliteTable("plans", {
|
||||
id: text().primaryKey().notNull(),
|
||||
phaseId: text("phase_id").notNull().references(() => phases.id, { onDelete: "cascade" } ),
|
||||
number: integer().notNull(),
|
||||
name: text().notNull(),
|
||||
description: text(),
|
||||
status: text().default("pending").notNull(),
|
||||
createdAt: integer("created_at").notNull(),
|
||||
updatedAt: integer("updated_at").notNull(),
|
||||
});
|
||||
|
||||
export const taskDependencies = sqliteTable("task_dependencies", {
|
||||
id: text().primaryKey().notNull(),
|
||||
taskId: text("task_id").notNull().references(() => tasks.id, { onDelete: "cascade" } ),
|
||||
dependsOnTaskId: text("depends_on_task_id").notNull().references(() => tasks.id, { onDelete: "cascade" } ),
|
||||
createdAt: integer("created_at").notNull(),
|
||||
});
|
||||
|
||||
export const tasks = sqliteTable("tasks", {
|
||||
id: text().primaryKey().notNull(),
|
||||
planId: text("plan_id").notNull().references(() => plans.id, { onDelete: "cascade" } ),
|
||||
name: text().notNull(),
|
||||
description: text(),
|
||||
type: text().default("auto").notNull(),
|
||||
priority: text().default("medium").notNull(),
|
||||
status: text().default("pending").notNull(),
|
||||
order: integer().default(0).notNull(),
|
||||
createdAt: integer("created_at").notNull(),
|
||||
updatedAt: integer("updated_at").notNull(),
|
||||
});
|
||||
|
||||
export const phaseDependencies = sqliteTable("phase_dependencies", {
|
||||
id: text().primaryKey().notNull(),
|
||||
phaseId: text("phase_id").notNull().references(() => phases.id, { onDelete: "cascade" } ),
|
||||
dependsOnPhaseId: text("depends_on_phase_id").notNull().references(() => phases.id, { onDelete: "cascade" } ),
|
||||
createdAt: integer("created_at").notNull(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user