From 15fb07a3c054125d5b39cd478cbfc61784be36a4 Mon Sep 17 00:00:00 2001 From: fullex <0xfullex@gmail.com> Date: Wed, 1 Jul 2026 07:24:34 -0700 Subject: [PATCH] chore(agents-migration): remove dead v1 agents-db drizzle migrations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The resources/database/drizzle SQL files and meta snapshots are v1-era CherryClaw agents-db migrations with no runtime consumer — the active v2 migrations live in migrations/sqlite-drizzle and are loaded from app.database.migrations. Delete the directory and clean up the now-dangling references: three source comments in AgentsDbMappings.ts that cited the deleted SQL files as the v1 column-type source (the epoch-ms notes are kept inline), and a stale doc row in cherryclaw/scheduler.md pointing to a migration file that no longer exists. --- docs/references/cherryclaw/scheduler.md | 1 - .../drizzle/0000_confused_wendigo.sql | 53 - .../drizzle/0001_woozy_captain_flint.sql | 1 - .../database/drizzle/0002_wealthy_naoko.sql | 1 - .../drizzle/0003_slippery_wild_pack.sql | 2 - .../database/drizzle/0004_busy_giant_girl.sql | 57 - .../database/drizzle/0005_normal_doomsday.sql | 19 - .../drizzle/0006_famous_fallen_one.sql | 13 - .../drizzle/0007_strange_galactus.sql | 1 - .../database/drizzle/meta/0000_snapshot.json | 331 ------ .../database/drizzle/meta/0001_snapshot.json | 339 ------ .../database/drizzle/meta/0002_snapshot.json | 346 ------- .../database/drizzle/meta/0003_snapshot.json | 362 ------- .../database/drizzle/meta/0004_snapshot.json | 723 ------------- .../database/drizzle/meta/0005_snapshot.json | 841 --------------- .../database/drizzle/meta/0006_snapshot.json | 972 ----------------- .../database/drizzle/meta/0007_snapshot.json | 979 ------------------ resources/database/drizzle/meta/_journal.json | 62 -- .../v2/migrators/mappings/AgentsDbMappings.ts | 11 +- 19 files changed, 4 insertions(+), 5110 deletions(-) delete mode 100644 resources/database/drizzle/0000_confused_wendigo.sql delete mode 100644 resources/database/drizzle/0001_woozy_captain_flint.sql delete mode 100644 resources/database/drizzle/0002_wealthy_naoko.sql delete mode 100644 resources/database/drizzle/0003_slippery_wild_pack.sql delete mode 100644 resources/database/drizzle/0004_busy_giant_girl.sql delete mode 100644 resources/database/drizzle/0005_normal_doomsday.sql delete mode 100644 resources/database/drizzle/0006_famous_fallen_one.sql delete mode 100644 resources/database/drizzle/0007_strange_galactus.sql delete mode 100644 resources/database/drizzle/meta/0000_snapshot.json delete mode 100644 resources/database/drizzle/meta/0001_snapshot.json delete mode 100644 resources/database/drizzle/meta/0002_snapshot.json delete mode 100644 resources/database/drizzle/meta/0003_snapshot.json delete mode 100644 resources/database/drizzle/meta/0004_snapshot.json delete mode 100644 resources/database/drizzle/meta/0005_snapshot.json delete mode 100644 resources/database/drizzle/meta/0006_snapshot.json delete mode 100644 resources/database/drizzle/meta/0007_snapshot.json delete mode 100644 resources/database/drizzle/meta/_journal.json diff --git a/docs/references/cherryclaw/scheduler.md b/docs/references/cherryclaw/scheduler.md index aef18d25da..c313e58de8 100644 --- a/docs/references/cherryclaw/scheduler.md +++ b/docs/references/cherryclaw/scheduler.md @@ -116,4 +116,3 @@ Besides automatic scheduling, each task can be manually triggered via API or UI: | `src/main/services/agents/services/SchedulerService.ts` | Polling scheduler main logic | | `src/main/services/agents/services/TaskService.ts` | Task CRUD, getDueTasks, computeNextRun | | `src/main/services/agents/database/schema/tasks.schema.ts` | scheduled_tasks + task_run_logs table definitions | -| `resources/database/drizzle/0003_wise_meltdown.sql` | Database migration script | diff --git a/resources/database/drizzle/0000_confused_wendigo.sql b/resources/database/drizzle/0000_confused_wendigo.sql deleted file mode 100644 index b2328e39c2..0000000000 --- a/resources/database/drizzle/0000_confused_wendigo.sql +++ /dev/null @@ -1,53 +0,0 @@ ---> statement-breakpoint -CREATE TABLE `migrations` ( - `version` integer PRIMARY KEY NOT NULL, - `tag` text NOT NULL, - `executed_at` integer NOT NULL -); - -CREATE TABLE `agents` ( - `id` text PRIMARY KEY NOT NULL, - `type` text NOT NULL, - `name` text NOT NULL, - `description` text, - `accessible_paths` text, - `instructions` text, - `model` text NOT NULL, - `plan_model` text, - `small_model` text, - `mcps` text, - `allowed_tools` text, - `configuration` text, - `created_at` text NOT NULL, - `updated_at` text NOT NULL -); - ---> statement-breakpoint -CREATE TABLE `sessions` ( - `id` text PRIMARY KEY NOT NULL, - `agent_type` text NOT NULL, - `agent_id` text NOT NULL, - `name` text NOT NULL, - `description` text, - `accessible_paths` text, - `instructions` text, - `model` text NOT NULL, - `plan_model` text, - `small_model` text, - `mcps` text, - `allowed_tools` text, - `configuration` text, - `created_at` text NOT NULL, - `updated_at` text NOT NULL -); - ---> statement-breakpoint -CREATE TABLE `session_messages` ( - `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, - `session_id` text NOT NULL, - `role` text NOT NULL, - `content` text NOT NULL, - `metadata` text, - `created_at` text NOT NULL, - `updated_at` text NOT NULL -); diff --git a/resources/database/drizzle/0001_woozy_captain_flint.sql b/resources/database/drizzle/0001_woozy_captain_flint.sql deleted file mode 100644 index f80f483c72..0000000000 --- a/resources/database/drizzle/0001_woozy_captain_flint.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `session_messages` ADD `agent_session_id` text DEFAULT ''; \ No newline at end of file diff --git a/resources/database/drizzle/0002_wealthy_naoko.sql b/resources/database/drizzle/0002_wealthy_naoko.sql deleted file mode 100644 index c369ccf61f..0000000000 --- a/resources/database/drizzle/0002_wealthy_naoko.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `sessions` ADD `slash_commands` text; \ No newline at end of file diff --git a/resources/database/drizzle/0003_slippery_wild_pack.sql b/resources/database/drizzle/0003_slippery_wild_pack.sql deleted file mode 100644 index 4b5634f8f7..0000000000 --- a/resources/database/drizzle/0003_slippery_wild_pack.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `agents` ADD `sort_order` integer DEFAULT 0 NOT NULL;--> statement-breakpoint -ALTER TABLE `sessions` ADD `sort_order` integer DEFAULT 0 NOT NULL; \ No newline at end of file diff --git a/resources/database/drizzle/0004_busy_giant_girl.sql b/resources/database/drizzle/0004_busy_giant_girl.sql deleted file mode 100644 index 8243daae9a..0000000000 --- a/resources/database/drizzle/0004_busy_giant_girl.sql +++ /dev/null @@ -1,57 +0,0 @@ -CREATE TABLE `channel_task_subscriptions` ( - `channel_id` text NOT NULL, - `task_id` text NOT NULL, - PRIMARY KEY(`channel_id`, `task_id`), - FOREIGN KEY (`channel_id`) REFERENCES `channels`(`id`) ON UPDATE no action ON DELETE cascade, - FOREIGN KEY (`task_id`) REFERENCES `scheduled_tasks`(`id`) ON UPDATE no action ON DELETE cascade -); ---> statement-breakpoint -CREATE INDEX `cts_channel_id_idx` ON `channel_task_subscriptions` (`channel_id`);--> statement-breakpoint -CREATE INDEX `cts_task_id_idx` ON `channel_task_subscriptions` (`task_id`);--> statement-breakpoint -CREATE TABLE `channels` ( - `id` text PRIMARY KEY NOT NULL, - `type` text NOT NULL, - `name` text NOT NULL, - `agent_id` text, - `session_id` text, - `config` text NOT NULL, - `is_active` integer DEFAULT true NOT NULL, - `active_chat_ids` text DEFAULT '[]', - `permission_mode` text, - `created_at` integer, - `updated_at` integer, - FOREIGN KEY (`agent_id`) REFERENCES `agents`(`id`) ON UPDATE no action ON DELETE set null, - FOREIGN KEY (`session_id`) REFERENCES `sessions`(`id`) ON UPDATE no action ON DELETE set null, - CONSTRAINT "channels_type_check" CHECK("channels"."type" IN ('telegram', 'feishu', 'qq', 'wechat', 'discord', 'slack')), - CONSTRAINT "channels_permission_mode_check" CHECK("channels"."permission_mode" IS NULL OR "channels"."permission_mode" IN ('default', 'acceptEdits', 'bypassPermissions', 'plan')) -); ---> statement-breakpoint -CREATE INDEX `channels_agent_id_idx` ON `channels` (`agent_id`);--> statement-breakpoint -CREATE INDEX `channels_type_idx` ON `channels` (`type`);--> statement-breakpoint -CREATE INDEX `channels_session_id_idx` ON `channels` (`session_id`);--> statement-breakpoint -CREATE TABLE `scheduled_tasks` ( - `id` text PRIMARY KEY NOT NULL, - `agent_id` text NOT NULL, - `name` text NOT NULL, - `prompt` text NOT NULL, - `schedule_type` text NOT NULL, - `schedule_value` text NOT NULL, - `timeout_minutes` integer DEFAULT 2 NOT NULL, - `next_run` text, - `last_run` text, - `last_result` text, - `status` text DEFAULT 'active' NOT NULL, - `created_at` text NOT NULL, - `updated_at` text NOT NULL -); ---> statement-breakpoint -CREATE TABLE `task_run_logs` ( - `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, - `task_id` text NOT NULL, - `session_id` text, - `run_at` text NOT NULL, - `duration_ms` integer NOT NULL, - `status` text NOT NULL, - `result` text, - `error` text -); diff --git a/resources/database/drizzle/0005_normal_doomsday.sql b/resources/database/drizzle/0005_normal_doomsday.sql deleted file mode 100644 index 88204b714d..0000000000 --- a/resources/database/drizzle/0005_normal_doomsday.sql +++ /dev/null @@ -1,19 +0,0 @@ -CREATE TABLE `skills` ( - `id` text PRIMARY KEY NOT NULL, - `name` text NOT NULL, - `description` text, - `folder_name` text NOT NULL, - `source` text NOT NULL, - `source_url` text, - `namespace` text, - `author` text, - `tags` text, - `content_hash` text NOT NULL, - `is_enabled` integer DEFAULT true NOT NULL, - `created_at` integer NOT NULL, - `updated_at` integer NOT NULL -); ---> statement-breakpoint -CREATE UNIQUE INDEX `skills_folder_name_unique` ON `skills` (`folder_name`);--> statement-breakpoint -CREATE INDEX `idx_skills_source` ON `skills` (`source`);--> statement-breakpoint -CREATE INDEX `idx_skills_is_enabled` ON `skills` (`is_enabled`); \ No newline at end of file diff --git a/resources/database/drizzle/0006_famous_fallen_one.sql b/resources/database/drizzle/0006_famous_fallen_one.sql deleted file mode 100644 index f994e8b427..0000000000 --- a/resources/database/drizzle/0006_famous_fallen_one.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE `agent_skills` ( - `agent_id` text NOT NULL, - `skill_id` text NOT NULL, - `is_enabled` integer DEFAULT false NOT NULL, - `created_at` integer NOT NULL, - `updated_at` integer NOT NULL, - PRIMARY KEY(`agent_id`, `skill_id`), - FOREIGN KEY (`agent_id`) REFERENCES `agents`(`id`) ON UPDATE no action ON DELETE cascade, - FOREIGN KEY (`skill_id`) REFERENCES `skills`(`id`) ON UPDATE no action ON DELETE cascade -); ---> statement-breakpoint -CREATE INDEX `idx_agent_skills_agent_id` ON `agent_skills` (`agent_id`);--> statement-breakpoint -CREATE INDEX `idx_agent_skills_skill_id` ON `agent_skills` (`skill_id`); \ No newline at end of file diff --git a/resources/database/drizzle/0007_strange_galactus.sql b/resources/database/drizzle/0007_strange_galactus.sql deleted file mode 100644 index 1f5dd69200..0000000000 --- a/resources/database/drizzle/0007_strange_galactus.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `agents` ADD `deleted_at` text; \ No newline at end of file diff --git a/resources/database/drizzle/meta/0000_snapshot.json b/resources/database/drizzle/meta/0000_snapshot.json deleted file mode 100644 index 140460cf09..0000000000 --- a/resources/database/drizzle/meta/0000_snapshot.json +++ /dev/null @@ -1,331 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "35efb412-0230-4767-9c76-7b7c4d40369f", - "prevId": "00000000-0000-0000-0000-000000000000", - "tables": { - "agents": { - "name": "agents", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "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 - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "session_messages": { - "name": "session_messages", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": true - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "migrations": { - "name": "migrations", - "columns": { - "version": { - "name": "version", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "tag": { - "name": "tag", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "executed_at": { - "name": "executed_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "sessions": { - "name": "sessions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "agent_type": { - "name": "agent_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_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 - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - } -} diff --git a/resources/database/drizzle/meta/0001_snapshot.json b/resources/database/drizzle/meta/0001_snapshot.json deleted file mode 100644 index 3b78976dd0..0000000000 --- a/resources/database/drizzle/meta/0001_snapshot.json +++ /dev/null @@ -1,339 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "dabab6db-a2cd-4e96-b06e-6cb87d445a87", - "prevId": "35efb412-0230-4767-9c76-7b7c4d40369f", - "tables": { - "agents": { - "name": "agents", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "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 - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "session_messages": { - "name": "session_messages", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": true - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_session_id": { - "name": "agent_session_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "''" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "migrations": { - "name": "migrations", - "columns": { - "version": { - "name": "version", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "tag": { - "name": "tag", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "executed_at": { - "name": "executed_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "sessions": { - "name": "sessions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "agent_type": { - "name": "agent_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_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 - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - } -} diff --git a/resources/database/drizzle/meta/0002_snapshot.json b/resources/database/drizzle/meta/0002_snapshot.json deleted file mode 100644 index ef5eefcb65..0000000000 --- a/resources/database/drizzle/meta/0002_snapshot.json +++ /dev/null @@ -1,346 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "0cf3d79e-69bf-4dba-8df4-996b9b67d2e8", - "prevId": "dabab6db-a2cd-4e96-b06e-6cb87d445a87", - "tables": { - "agents": { - "name": "agents", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "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 - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "session_messages": { - "name": "session_messages", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": true - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_session_id": { - "name": "agent_session_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "''" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "migrations": { - "name": "migrations", - "columns": { - "version": { - "name": "version", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "tag": { - "name": "tag", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "executed_at": { - "name": "executed_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "sessions": { - "name": "sessions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "agent_type": { - "name": "agent_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_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 - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "slash_commands": { - "name": "slash_commands", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - } -} diff --git a/resources/database/drizzle/meta/0003_snapshot.json b/resources/database/drizzle/meta/0003_snapshot.json deleted file mode 100644 index 19764bffa3..0000000000 --- a/resources/database/drizzle/meta/0003_snapshot.json +++ /dev/null @@ -1,362 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "2bde7356-6a69-4445-b163-3299b4b4972f", - "prevId": "0cf3d79e-69bf-4dba-8df4-996b9b67d2e8", - "tables": { - "agents": { - "name": "agents", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "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 - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "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": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "session_messages": { - "name": "session_messages", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": true - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_session_id": { - "name": "agent_session_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "''" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "migrations": { - "name": "migrations", - "columns": { - "version": { - "name": "version", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "tag": { - "name": "tag", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "executed_at": { - "name": "executed_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "sessions": { - "name": "sessions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "agent_type": { - "name": "agent_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_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 - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "slash_commands": { - "name": "slash_commands", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "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": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - } -} diff --git a/resources/database/drizzle/meta/0004_snapshot.json b/resources/database/drizzle/meta/0004_snapshot.json deleted file mode 100644 index 7b58bcbcb0..0000000000 --- a/resources/database/drizzle/meta/0004_snapshot.json +++ /dev/null @@ -1,723 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "801df828-be44-457d-96b7-e80944b37b37", - "prevId": "2bde7356-6a69-4445-b163-3299b4b4972f", - "tables": { - "agents": { - "name": "agents", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "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 - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "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": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "channel_task_subscriptions": { - "name": "channel_task_subscriptions", - "columns": { - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "task_id": { - "name": "task_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "cts_channel_id_idx": { - "name": "cts_channel_id_idx", - "columns": ["channel_id"], - "isUnique": false - }, - "cts_task_id_idx": { - "name": "cts_task_id_idx", - "columns": ["task_id"], - "isUnique": false - } - }, - "foreignKeys": { - "channel_task_subscriptions_channel_id_channels_id_fk": { - "name": "channel_task_subscriptions_channel_id_channels_id_fk", - "tableFrom": "channel_task_subscriptions", - "tableTo": "channels", - "columnsFrom": ["channel_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "channel_task_subscriptions_task_id_scheduled_tasks_id_fk": { - "name": "channel_task_subscriptions_task_id_scheduled_tasks_id_fk", - "tableFrom": "channel_task_subscriptions", - "tableTo": "scheduled_tasks", - "columnsFrom": ["task_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "channel_task_subscriptions_channel_id_task_id_pk": { - "columns": ["channel_id", "task_id"], - "name": "channel_task_subscriptions_channel_id_task_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "channels": { - "name": "channels", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "config": { - "name": "config", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_active": { - "name": "is_active", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "active_chat_ids": { - "name": "active_chat_ids", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'[]'" - }, - "permission_mode": { - "name": "permission_mode", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "channels_agent_id_idx": { - "name": "channels_agent_id_idx", - "columns": ["agent_id"], - "isUnique": false - }, - "channels_type_idx": { - "name": "channels_type_idx", - "columns": ["type"], - "isUnique": false - }, - "channels_session_id_idx": { - "name": "channels_session_id_idx", - "columns": ["session_id"], - "isUnique": false - } - }, - "foreignKeys": { - "channels_agent_id_agents_id_fk": { - "name": "channels_agent_id_agents_id_fk", - "tableFrom": "channels", - "tableTo": "agents", - "columnsFrom": ["agent_id"], - "columnsTo": ["id"], - "onDelete": "set null", - "onUpdate": "no action" - }, - "channels_session_id_sessions_id_fk": { - "name": "channels_session_id_sessions_id_fk", - "tableFrom": "channels", - "tableTo": "sessions", - "columnsFrom": ["session_id"], - "columnsTo": ["id"], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": { - "channels_type_check": { - "name": "channels_type_check", - "value": "\"channels\".\"type\" IN ('telegram', 'feishu', 'qq', 'wechat', 'discord', 'slack')" - }, - "channels_permission_mode_check": { - "name": "channels_permission_mode_check", - "value": "\"channels\".\"permission_mode\" IS NULL OR \"channels\".\"permission_mode\" IN ('default', 'acceptEdits', 'bypassPermissions', 'plan')" - } - } - }, - "session_messages": { - "name": "session_messages", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": true - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_session_id": { - "name": "agent_session_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "''" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "migrations": { - "name": "migrations", - "columns": { - "version": { - "name": "version", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "tag": { - "name": "tag", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "executed_at": { - "name": "executed_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "sessions": { - "name": "sessions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "agent_type": { - "name": "agent_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_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 - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "slash_commands": { - "name": "slash_commands", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "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": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "scheduled_tasks": { - "name": "scheduled_tasks", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "prompt": { - "name": "prompt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "schedule_type": { - "name": "schedule_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "schedule_value": { - "name": "schedule_value", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "timeout_minutes": { - "name": "timeout_minutes", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 2 - }, - "next_run": { - "name": "next_run", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "last_run": { - "name": "last_run", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "last_result": { - "name": "last_result", - "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": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "task_run_logs": { - "name": "task_run_logs", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": true - }, - "task_id": { - "name": "task_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "run_at": { - "name": "run_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - } -} diff --git a/resources/database/drizzle/meta/0005_snapshot.json b/resources/database/drizzle/meta/0005_snapshot.json deleted file mode 100644 index 69f6860176..0000000000 --- a/resources/database/drizzle/meta/0005_snapshot.json +++ /dev/null @@ -1,841 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "7bf3927c-ffdf-4f66-8d86-3fe7567af50e", - "prevId": "801df828-be44-457d-96b7-e80944b37b37", - "tables": { - "agents": { - "name": "agents", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "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 - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "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": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "channel_task_subscriptions": { - "name": "channel_task_subscriptions", - "columns": { - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "task_id": { - "name": "task_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "cts_channel_id_idx": { - "name": "cts_channel_id_idx", - "columns": ["channel_id"], - "isUnique": false - }, - "cts_task_id_idx": { - "name": "cts_task_id_idx", - "columns": ["task_id"], - "isUnique": false - } - }, - "foreignKeys": { - "channel_task_subscriptions_channel_id_channels_id_fk": { - "name": "channel_task_subscriptions_channel_id_channels_id_fk", - "tableFrom": "channel_task_subscriptions", - "tableTo": "channels", - "columnsFrom": ["channel_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "channel_task_subscriptions_task_id_scheduled_tasks_id_fk": { - "name": "channel_task_subscriptions_task_id_scheduled_tasks_id_fk", - "tableFrom": "channel_task_subscriptions", - "tableTo": "scheduled_tasks", - "columnsFrom": ["task_id"], - "columnsTo": ["id"], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "channel_task_subscriptions_channel_id_task_id_pk": { - "columns": ["channel_id", "task_id"], - "name": "channel_task_subscriptions_channel_id_task_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "channels": { - "name": "channels", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "config": { - "name": "config", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_active": { - "name": "is_active", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "active_chat_ids": { - "name": "active_chat_ids", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'[]'" - }, - "permission_mode": { - "name": "permission_mode", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "channels_agent_id_idx": { - "name": "channels_agent_id_idx", - "columns": ["agent_id"], - "isUnique": false - }, - "channels_type_idx": { - "name": "channels_type_idx", - "columns": ["type"], - "isUnique": false - }, - "channels_session_id_idx": { - "name": "channels_session_id_idx", - "columns": ["session_id"], - "isUnique": false - } - }, - "foreignKeys": { - "channels_agent_id_agents_id_fk": { - "name": "channels_agent_id_agents_id_fk", - "tableFrom": "channels", - "tableTo": "agents", - "columnsFrom": ["agent_id"], - "columnsTo": ["id"], - "onDelete": "set null", - "onUpdate": "no action" - }, - "channels_session_id_sessions_id_fk": { - "name": "channels_session_id_sessions_id_fk", - "tableFrom": "channels", - "tableTo": "sessions", - "columnsFrom": ["session_id"], - "columnsTo": ["id"], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": { - "channels_type_check": { - "name": "channels_type_check", - "value": "\"channels\".\"type\" IN ('telegram', 'feishu', 'qq', 'wechat', 'discord', 'slack')" - }, - "channels_permission_mode_check": { - "name": "channels_permission_mode_check", - "value": "\"channels\".\"permission_mode\" IS NULL OR \"channels\".\"permission_mode\" IN ('default', 'acceptEdits', 'bypassPermissions', 'plan')" - } - } - }, - "session_messages": { - "name": "session_messages", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": true - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_session_id": { - "name": "agent_session_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "''" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "migrations": { - "name": "migrations", - "columns": { - "version": { - "name": "version", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "tag": { - "name": "tag", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "executed_at": { - "name": "executed_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "sessions": { - "name": "sessions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "agent_type": { - "name": "agent_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_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 - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "slash_commands": { - "name": "slash_commands", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "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": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "skills": { - "name": "skills", - "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 - }, - "folder_name": { - "name": "folder_name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "source_url": { - "name": "source_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "namespace": { - "name": "namespace", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "author": { - "name": "author", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tags": { - "name": "tags", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_enabled": { - "name": "is_enabled", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "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": { - "skills_folder_name_unique": { - "name": "skills_folder_name_unique", - "columns": ["folder_name"], - "isUnique": true - }, - "idx_skills_source": { - "name": "idx_skills_source", - "columns": ["source"], - "isUnique": false - }, - "idx_skills_is_enabled": { - "name": "idx_skills_is_enabled", - "columns": ["is_enabled"], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "scheduled_tasks": { - "name": "scheduled_tasks", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "prompt": { - "name": "prompt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "schedule_type": { - "name": "schedule_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "schedule_value": { - "name": "schedule_value", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "timeout_minutes": { - "name": "timeout_minutes", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 2 - }, - "next_run": { - "name": "next_run", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "last_run": { - "name": "last_run", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "last_result": { - "name": "last_result", - "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": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "task_run_logs": { - "name": "task_run_logs", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": true - }, - "task_id": { - "name": "task_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "run_at": { - "name": "run_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - } -} diff --git a/resources/database/drizzle/meta/0006_snapshot.json b/resources/database/drizzle/meta/0006_snapshot.json deleted file mode 100644 index e21d6d8f05..0000000000 --- a/resources/database/drizzle/meta/0006_snapshot.json +++ /dev/null @@ -1,972 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "498cd185-e5ec-4a74-ab5b-43205e43fe10", - "prevId": "7bf3927c-ffdf-4f66-8d86-3fe7567af50e", - "tables": { - "agents": { - "name": "agents", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "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 - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "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": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "agent_skills": { - "name": "agent_skills", - "columns": { - "agent_id": { - "name": "agent_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "skill_id": { - "name": "skill_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_enabled": { - "name": "is_enabled", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 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": { - "idx_agent_skills_agent_id": { - "name": "idx_agent_skills_agent_id", - "columns": [ - "agent_id" - ], - "isUnique": false - }, - "idx_agent_skills_skill_id": { - "name": "idx_agent_skills_skill_id", - "columns": [ - "skill_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "agent_skills_agent_id_agents_id_fk": { - "name": "agent_skills_agent_id_agents_id_fk", - "tableFrom": "agent_skills", - "tableTo": "agents", - "columnsFrom": [ - "agent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "agent_skills_skill_id_skills_id_fk": { - "name": "agent_skills_skill_id_skills_id_fk", - "tableFrom": "agent_skills", - "tableTo": "skills", - "columnsFrom": [ - "skill_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "agent_skills_agent_id_skill_id_pk": { - "columns": [ - "agent_id", - "skill_id" - ], - "name": "agent_skills_agent_id_skill_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "channel_task_subscriptions": { - "name": "channel_task_subscriptions", - "columns": { - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "task_id": { - "name": "task_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "cts_channel_id_idx": { - "name": "cts_channel_id_idx", - "columns": [ - "channel_id" - ], - "isUnique": false - }, - "cts_task_id_idx": { - "name": "cts_task_id_idx", - "columns": [ - "task_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "channel_task_subscriptions_channel_id_channels_id_fk": { - "name": "channel_task_subscriptions_channel_id_channels_id_fk", - "tableFrom": "channel_task_subscriptions", - "tableTo": "channels", - "columnsFrom": [ - "channel_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "channel_task_subscriptions_task_id_scheduled_tasks_id_fk": { - "name": "channel_task_subscriptions_task_id_scheduled_tasks_id_fk", - "tableFrom": "channel_task_subscriptions", - "tableTo": "scheduled_tasks", - "columnsFrom": [ - "task_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "channel_task_subscriptions_channel_id_task_id_pk": { - "columns": [ - "channel_id", - "task_id" - ], - "name": "channel_task_subscriptions_channel_id_task_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "channels": { - "name": "channels", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "config": { - "name": "config", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_active": { - "name": "is_active", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "active_chat_ids": { - "name": "active_chat_ids", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'[]'" - }, - "permission_mode": { - "name": "permission_mode", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "channels_agent_id_idx": { - "name": "channels_agent_id_idx", - "columns": [ - "agent_id" - ], - "isUnique": false - }, - "channels_type_idx": { - "name": "channels_type_idx", - "columns": [ - "type" - ], - "isUnique": false - }, - "channels_session_id_idx": { - "name": "channels_session_id_idx", - "columns": [ - "session_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "channels_agent_id_agents_id_fk": { - "name": "channels_agent_id_agents_id_fk", - "tableFrom": "channels", - "tableTo": "agents", - "columnsFrom": [ - "agent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, - "channels_session_id_sessions_id_fk": { - "name": "channels_session_id_sessions_id_fk", - "tableFrom": "channels", - "tableTo": "sessions", - "columnsFrom": [ - "session_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": { - "channels_type_check": { - "name": "channels_type_check", - "value": "\"channels\".\"type\" IN ('telegram', 'feishu', 'qq', 'wechat', 'discord', 'slack')" - }, - "channels_permission_mode_check": { - "name": "channels_permission_mode_check", - "value": "\"channels\".\"permission_mode\" IS NULL OR \"channels\".\"permission_mode\" IN ('default', 'acceptEdits', 'bypassPermissions', 'plan')" - } - } - }, - "session_messages": { - "name": "session_messages", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": true - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_session_id": { - "name": "agent_session_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "''" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "migrations": { - "name": "migrations", - "columns": { - "version": { - "name": "version", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "tag": { - "name": "tag", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "executed_at": { - "name": "executed_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "sessions": { - "name": "sessions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "agent_type": { - "name": "agent_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_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 - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "slash_commands": { - "name": "slash_commands", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "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": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "skills": { - "name": "skills", - "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 - }, - "folder_name": { - "name": "folder_name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "source_url": { - "name": "source_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "namespace": { - "name": "namespace", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "author": { - "name": "author", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tags": { - "name": "tags", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_enabled": { - "name": "is_enabled", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "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": { - "skills_folder_name_unique": { - "name": "skills_folder_name_unique", - "columns": [ - "folder_name" - ], - "isUnique": true - }, - "idx_skills_source": { - "name": "idx_skills_source", - "columns": [ - "source" - ], - "isUnique": false - }, - "idx_skills_is_enabled": { - "name": "idx_skills_is_enabled", - "columns": [ - "is_enabled" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "scheduled_tasks": { - "name": "scheduled_tasks", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "prompt": { - "name": "prompt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "schedule_type": { - "name": "schedule_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "schedule_value": { - "name": "schedule_value", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "timeout_minutes": { - "name": "timeout_minutes", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 2 - }, - "next_run": { - "name": "next_run", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "last_run": { - "name": "last_run", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "last_result": { - "name": "last_result", - "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": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "task_run_logs": { - "name": "task_run_logs", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": true - }, - "task_id": { - "name": "task_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "run_at": { - "name": "run_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - } -} \ No newline at end of file diff --git a/resources/database/drizzle/meta/0007_snapshot.json b/resources/database/drizzle/meta/0007_snapshot.json deleted file mode 100644 index b701404d9a..0000000000 --- a/resources/database/drizzle/meta/0007_snapshot.json +++ /dev/null @@ -1,979 +0,0 @@ -{ - "version": "6", - "dialect": "sqlite", - "id": "bd05ea4b-4ff1-4666-a98d-7ce82fe68548", - "prevId": "498cd185-e5ec-4a74-ab5b-43205e43fe10", - "tables": { - "agents": { - "name": "agents", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "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 - }, - "deleted_at": { - "name": "deleted_at", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "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": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "agent_skills": { - "name": "agent_skills", - "columns": { - "agent_id": { - "name": "agent_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "skill_id": { - "name": "skill_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_enabled": { - "name": "is_enabled", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 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": { - "idx_agent_skills_agent_id": { - "name": "idx_agent_skills_agent_id", - "columns": [ - "agent_id" - ], - "isUnique": false - }, - "idx_agent_skills_skill_id": { - "name": "idx_agent_skills_skill_id", - "columns": [ - "skill_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "agent_skills_agent_id_agents_id_fk": { - "name": "agent_skills_agent_id_agents_id_fk", - "tableFrom": "agent_skills", - "tableTo": "agents", - "columnsFrom": [ - "agent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "agent_skills_skill_id_skills_id_fk": { - "name": "agent_skills_skill_id_skills_id_fk", - "tableFrom": "agent_skills", - "tableTo": "skills", - "columnsFrom": [ - "skill_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "agent_skills_agent_id_skill_id_pk": { - "columns": [ - "agent_id", - "skill_id" - ], - "name": "agent_skills_agent_id_skill_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "channel_task_subscriptions": { - "name": "channel_task_subscriptions", - "columns": { - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "task_id": { - "name": "task_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "cts_channel_id_idx": { - "name": "cts_channel_id_idx", - "columns": [ - "channel_id" - ], - "isUnique": false - }, - "cts_task_id_idx": { - "name": "cts_task_id_idx", - "columns": [ - "task_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "channel_task_subscriptions_channel_id_channels_id_fk": { - "name": "channel_task_subscriptions_channel_id_channels_id_fk", - "tableFrom": "channel_task_subscriptions", - "tableTo": "channels", - "columnsFrom": [ - "channel_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "channel_task_subscriptions_task_id_scheduled_tasks_id_fk": { - "name": "channel_task_subscriptions_task_id_scheduled_tasks_id_fk", - "tableFrom": "channel_task_subscriptions", - "tableTo": "scheduled_tasks", - "columnsFrom": [ - "task_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "channel_task_subscriptions_channel_id_task_id_pk": { - "columns": [ - "channel_id", - "task_id" - ], - "name": "channel_task_subscriptions_channel_id_task_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "channels": { - "name": "channels", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "config": { - "name": "config", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_active": { - "name": "is_active", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "active_chat_ids": { - "name": "active_chat_ids", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'[]'" - }, - "permission_mode": { - "name": "permission_mode", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "channels_agent_id_idx": { - "name": "channels_agent_id_idx", - "columns": [ - "agent_id" - ], - "isUnique": false - }, - "channels_type_idx": { - "name": "channels_type_idx", - "columns": [ - "type" - ], - "isUnique": false - }, - "channels_session_id_idx": { - "name": "channels_session_id_idx", - "columns": [ - "session_id" - ], - "isUnique": false - } - }, - "foreignKeys": { - "channels_agent_id_agents_id_fk": { - "name": "channels_agent_id_agents_id_fk", - "tableFrom": "channels", - "tableTo": "agents", - "columnsFrom": [ - "agent_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - }, - "channels_session_id_sessions_id_fk": { - "name": "channels_session_id_sessions_id_fk", - "tableFrom": "channels", - "tableTo": "sessions", - "columnsFrom": [ - "session_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": { - "channels_type_check": { - "name": "channels_type_check", - "value": "\"channels\".\"type\" IN ('telegram', 'feishu', 'qq', 'wechat', 'discord', 'slack')" - }, - "channels_permission_mode_check": { - "name": "channels_permission_mode_check", - "value": "\"channels\".\"permission_mode\" IS NULL OR \"channels\".\"permission_mode\" IN ('default', 'acceptEdits', 'bypassPermissions', 'plan')" - } - } - }, - "session_messages": { - "name": "session_messages", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": true - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_session_id": { - "name": "agent_session_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "''" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "migrations": { - "name": "migrations", - "columns": { - "version": { - "name": "version", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "tag": { - "name": "tag", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "executed_at": { - "name": "executed_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "sessions": { - "name": "sessions", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "agent_type": { - "name": "agent_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_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 - }, - "accessible_paths": { - "name": "accessible_paths", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "plan_model": { - "name": "plan_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "small_model": { - "name": "small_model", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mcps": { - "name": "mcps", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "allowed_tools": { - "name": "allowed_tools", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "slash_commands": { - "name": "slash_commands", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "configuration": { - "name": "configuration", - "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": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "skills": { - "name": "skills", - "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 - }, - "folder_name": { - "name": "folder_name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "source_url": { - "name": "source_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "namespace": { - "name": "namespace", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "author": { - "name": "author", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "tags": { - "name": "tags", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "content_hash": { - "name": "content_hash", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_enabled": { - "name": "is_enabled", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "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": { - "skills_folder_name_unique": { - "name": "skills_folder_name_unique", - "columns": [ - "folder_name" - ], - "isUnique": true - }, - "idx_skills_source": { - "name": "idx_skills_source", - "columns": [ - "source" - ], - "isUnique": false - }, - "idx_skills_is_enabled": { - "name": "idx_skills_is_enabled", - "columns": [ - "is_enabled" - ], - "isUnique": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "scheduled_tasks": { - "name": "scheduled_tasks", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "agent_id": { - "name": "agent_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "prompt": { - "name": "prompt", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "schedule_type": { - "name": "schedule_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "schedule_value": { - "name": "schedule_value", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "timeout_minutes": { - "name": "timeout_minutes", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 2 - }, - "next_run": { - "name": "next_run", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "last_run": { - "name": "last_run", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "last_result": { - "name": "last_result", - "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": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "task_run_logs": { - "name": "task_run_logs", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "autoincrement": true - }, - "task_id": { - "name": "task_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "session_id": { - "name": "session_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "run_at": { - "name": "run_at", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "duration_ms": { - "name": "duration_ms", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "result": { - "name": "result", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "internal": { - "indexes": {} - } -} \ No newline at end of file diff --git a/resources/database/drizzle/meta/_journal.json b/resources/database/drizzle/meta/_journal.json deleted file mode 100644 index 22ee001b07..0000000000 --- a/resources/database/drizzle/meta/_journal.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "dialect": "sqlite", - "entries": [ - { - "breakpoints": true, - "idx": 0, - "tag": "0000_confused_wendigo", - "version": "6", - "when": 1758091173882 - }, - { - "breakpoints": true, - "idx": 1, - "tag": "0001_woozy_captain_flint", - "version": "6", - "when": 1758187378775 - }, - { - "breakpoints": true, - "idx": 2, - "tag": "0002_wealthy_naoko", - "version": "6", - "when": 1762526423527 - }, - { - "breakpoints": true, - "idx": 3, - "tag": "0003_slippery_wild_pack", - "version": "6", - "when": 1773483572773 - }, - { - "breakpoints": true, - "idx": 4, - "tag": "0004_busy_giant_girl", - "version": "6", - "when": 1775029551647 - }, - { - "breakpoints": true, - "idx": 5, - "tag": "0005_normal_doomsday", - "version": "6", - "when": 1775032005049 - }, - { - "idx": 6, - "version": "6", - "when": 1776154617146, - "tag": "0006_famous_fallen_one", - "breakpoints": true - }, - { - "idx": 7, - "version": "6", - "when": 1776236285350, - "tag": "0007_strange_galactus", - "breakpoints": true - } - ], - "version": "7" -} \ No newline at end of file diff --git a/src/main/data/migration/v2/migrators/mappings/AgentsDbMappings.ts b/src/main/data/migration/v2/migrators/mappings/AgentsDbMappings.ts index e40c0db1db..0b5e8754bd 100644 --- a/src/main/data/migration/v2/migrators/mappings/AgentsDbMappings.ts +++ b/src/main/data/migration/v2/migrators/mappings/AgentsDbMappings.ts @@ -180,8 +180,7 @@ export const AGENTS_TABLE_MIGRATION_SPECS: readonly AgentsTableMigrationSpec[] = sourceTable: 'skills', targetTable: 'agent_global_skill', // Legacy `skills.created_at` / `updated_at` are already stored as INTEGER - // epoch-milliseconds (see resources/database/drizzle/0005_normal_doomsday.sql), - // so no strftime() wrapping is needed — copy through verbatim. + // epoch-milliseconds, so no strftime() wrapping is needed — copy through verbatim. columns: [ 'id', 'name', @@ -201,8 +200,7 @@ export const AGENTS_TABLE_MIGRATION_SPECS: readonly AgentsTableMigrationSpec[] = { sourceTable: 'agent_skills', targetTable: 'agent_skill', - // Legacy `agent_skills.created_at` / `updated_at` are already INTEGER epoch-ms - // (see resources/database/drizzle/0006_famous_fallen_one.sql) — no wrapping. + // Legacy `agent_skills.created_at` / `updated_at` are already INTEGER epoch-ms — no wrapping. columns: ['agent_id', 'skill_id', notNullCol('is_enabled', '0'), 'created_at', 'updated_at'], // Only import agent_skill rows whose agent and skill were both successfully // migrated; orphaned rows would fail the FK checks. @@ -213,9 +211,8 @@ export const AGENTS_TABLE_MIGRATION_SPECS: readonly AgentsTableMigrationSpec[] = { sourceTable: 'channels', targetTable: 'agent_channel', - // Legacy `channels.created_at` / `updated_at` are NULLABLE INTEGER epoch-ms - // (resources/database/drizzle/0004_busy_giant_girl.sql:21-22). v2 - // `agent_channel` uses `createUpdateTimestamps` (`notNull().$defaultFn(...)`) — + // Legacy `channels.created_at` / `updated_at` are NULLABLE INTEGER epoch-ms. + // v2 `agent_channel` uses `createUpdateTimestamps` (`notNull().$defaultFn(...)`) — // a JS-side default that raw INSERT...SELECT bypasses, so a legacy NULL // would trip SQLITE_CONSTRAINT_NOTNULL. COALESCE to "now" mirrors the // pattern used for task_run_logs above.