mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-26 13:19:34 +07:00
* 🗃️ chore: add agent task system database schema Add 6 new tables for the Agent Task System: - tasks: core task with tree structure, heartbeat, scheduling - task_dependencies: inter-task dependency graph (blocks/relates) - task_documents: MVP workspace document pinning - task_topics: topic tracking with handoff (jsonb) and review results - task_comments: user/agent comments with author tracking (text id: cmt_) - briefs: unresolved notification system (text id: brf_) All sub-tables include userId FK for row-level user isolation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add self-referential FK on tasks.parentTaskId (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: use foreignKey() for self-referential parentTaskId to avoid TS circular inference Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on task_topics.topic_id → topics.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: resolve pre-existing TS type-check errors - Fix i18next defaultValue type (string | null → string) - Fix i18next options type mismatches - Fix fieldTags.webhook possibly undefined Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on tasks.currentTopicId → topics.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK constraints for assignee, author, topic, and parent fields - tasks.assigneeUserId → users.id (ON DELETE SET NULL) - tasks.assigneeAgentId → agents.id (ON DELETE SET NULL) - tasks.parentTaskId → tasks.id (ON DELETE SET NULL) - tasks.currentTopicId → topics.id (ON DELETE SET NULL) - task_comments.authorUserId → users.id (ON DELETE SET NULL) - task_comments.authorAgentId → agents.id (ON DELETE SET NULL) - task_topics.topicId → topics.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: change task_topics.topicId FK to ON DELETE CASCADE Topic deleted → task_topic mapping row removed (not just nulled). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ♻️ refactor: use inline .references() for currentTopicId FK No circular inference issue — only parentTaskId (self-ref) needs foreignKey(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on task_comments.briefId and topicId (ON DELETE SET NULL) - task_comments.briefId → briefs.id (SET NULL) - task_comments.topicId → topics.id (SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ♻️ refactor: merge briefs table into task.ts to fix circular dependency brief.ts imported task.ts (briefs.taskId FK) and task.ts imported brief.ts (taskComments.briefId FK), causing circular dependency error. Merged briefs into task.ts since briefs are part of the task system. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on tasks.createdByAgentId → agents.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
679 lines
14 KiB
JSON
679 lines
14 KiB
JSON
{
|
|
"dialect": "postgresql",
|
|
"entries": [
|
|
{
|
|
"idx": 0,
|
|
"version": "6",
|
|
"when": 1716982944425,
|
|
"tag": "0000_init",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 1,
|
|
"version": "6",
|
|
"when": 1717153686544,
|
|
"tag": "0001_add_client_id",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 2,
|
|
"version": "6",
|
|
"when": 1717587734458,
|
|
"tag": "0002_amusing_puma",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 3,
|
|
"version": "6",
|
|
"when": 1718460779230,
|
|
"tag": "0003_naive_echo",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 4,
|
|
"version": "7",
|
|
"when": 1721724512422,
|
|
"tag": "0004_add_next_auth",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 5,
|
|
"version": "7",
|
|
"when": 1722944166657,
|
|
"tag": "0005_pgvector",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 6,
|
|
"version": "7",
|
|
"when": 1724089032064,
|
|
"tag": "0006_add_knowledge_base",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 7,
|
|
"version": "7",
|
|
"when": 1724254147447,
|
|
"tag": "0007_fix_embedding_table",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 8,
|
|
"version": "7",
|
|
"when": 1725366565650,
|
|
"tag": "0008_add_rag_evals",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 9,
|
|
"version": "7",
|
|
"when": 1729699958471,
|
|
"tag": "0009_remove_unused_user_tables",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 10,
|
|
"version": "7",
|
|
"when": 1730900133049,
|
|
"tag": "0010_add_accessed_at_and_clean_tables",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 11,
|
|
"version": "7",
|
|
"when": 1731138670427,
|
|
"tag": "0011_add_topic_history_summary",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 12,
|
|
"version": "7",
|
|
"when": 1731858381716,
|
|
"tag": "0012_add_thread",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 13,
|
|
"version": "7",
|
|
"when": 1735834653361,
|
|
"tag": "0013_add_ai_infra",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 14,
|
|
"version": "7",
|
|
"when": 1737609172353,
|
|
"tag": "0014_add_message_reasoning",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 15,
|
|
"version": "7",
|
|
"when": 1739901891891,
|
|
"tag": "0015_add_message_search_metadata",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 16,
|
|
"version": "7",
|
|
"when": 1741844738677,
|
|
"tag": "0016_add_message_index",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 17,
|
|
"version": "7",
|
|
"when": 1742269437903,
|
|
"tag": "0017_add_user_id_to_tables",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 18,
|
|
"version": "7",
|
|
"when": 1742616026643,
|
|
"tag": "0018_add_client_id_for_entities",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 19,
|
|
"version": "7",
|
|
"when": 1742806552131,
|
|
"tag": "0019_add_hotkey_user_settings",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 20,
|
|
"version": "7",
|
|
"when": 1744458287757,
|
|
"tag": "0020_add_oidc",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 21,
|
|
"version": "7",
|
|
"when": 1744602998656,
|
|
"tag": "0021_add_agent_opening_settings",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 22,
|
|
"version": "7",
|
|
"when": 1746724476380,
|
|
"tag": "0022_add_documents",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 23,
|
|
"version": "7",
|
|
"when": 1748925630721,
|
|
"tag": "0023_remove_param_and_doubao",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 24,
|
|
"version": "7",
|
|
"when": 1749301573666,
|
|
"tag": "0024_add_rbac_tables",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 25,
|
|
"version": "7",
|
|
"when": 1749309388370,
|
|
"tag": "0025_add_provider_config",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 26,
|
|
"version": "7",
|
|
"when": 1752212281564,
|
|
"tag": "0026_add_autovacuum_tuning",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 27,
|
|
"version": "7",
|
|
"when": 1752413805765,
|
|
"tag": "0027_ai_image",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 28,
|
|
"version": "7",
|
|
"when": 1752567402506,
|
|
"tag": "0028_oauth_handoffs",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 29,
|
|
"version": "7",
|
|
"when": 1753201379817,
|
|
"tag": "0029_add_apikey_manage",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 30,
|
|
"version": "7",
|
|
"when": 1756298669289,
|
|
"tag": "0030_add_group_chat",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 31,
|
|
"version": "7",
|
|
"when": 1757902833213,
|
|
"tag": "0031_add_agent_index",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 32,
|
|
"version": "7",
|
|
"when": 1757993755131,
|
|
"tag": "0032_improve_agents_field",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 33,
|
|
"version": "7",
|
|
"when": 1758012348218,
|
|
"tag": "0033_add_table_index",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 34,
|
|
"version": "7",
|
|
"when": 1758825944181,
|
|
"tag": "0034_fix_chat_group",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 35,
|
|
"version": "7",
|
|
"when": 1759116400580,
|
|
"tag": "0035_add_virtual",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 36,
|
|
"version": "7",
|
|
"when": 1759666151079,
|
|
"tag": "0036_add_group_messages",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 37,
|
|
"version": "7",
|
|
"when": 1760086906862,
|
|
"tag": "0037_add_user_memory",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 38,
|
|
"version": "7",
|
|
"when": 1760108430562,
|
|
"tag": "0038_add_image_user_settings",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 39,
|
|
"version": "7",
|
|
"when": 1761554153406,
|
|
"tag": "0039_add_editor_data",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 40,
|
|
"version": "7",
|
|
"when": 1761563458595,
|
|
"tag": "0040_improve_user_memory_field",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 41,
|
|
"version": "7",
|
|
"when": 1761878697451,
|
|
"tag": "0041_improve_index",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 42,
|
|
"version": "7",
|
|
"when": 1762232313711,
|
|
"tag": "0042_improve_agent_index",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 43,
|
|
"version": "7",
|
|
"when": 1762251112601,
|
|
"tag": "0043_add_ai_model_settings",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 44,
|
|
"version": "7",
|
|
"when": 1762870034882,
|
|
"tag": "0044_high_toxin",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 45,
|
|
"version": "7",
|
|
"when": 1762911968658,
|
|
"tag": "0045_add_tool_intervention",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 46,
|
|
"version": "7",
|
|
"when": 1763453175961,
|
|
"tag": "0046_add_parent_id",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 47,
|
|
"version": "7",
|
|
"when": 1763987922211,
|
|
"tag": "0047_add_slug_document",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 48,
|
|
"version": "7",
|
|
"when": 1764215503726,
|
|
"tag": "0048_add_editor_data",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 49,
|
|
"version": "7",
|
|
"when": 1764229953081,
|
|
"tag": "0049_better_auth",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 50,
|
|
"version": "7",
|
|
"when": 1764303057060,
|
|
"tag": "0050_thread_and_user_id",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 51,
|
|
"version": "7",
|
|
"when": 1764335703306,
|
|
"tag": "0051_add_market_into_user_settings",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 52,
|
|
"version": "7",
|
|
"when": 1764500630663,
|
|
"tag": "0052_topic_and_messages",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 53,
|
|
"version": "7",
|
|
"when": 1764511006123,
|
|
"tag": "0053_better_auth_admin",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 54,
|
|
"version": "7",
|
|
"when": 1764579351312,
|
|
"tag": "0054_better_auth_two_factor",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 55,
|
|
"version": "7",
|
|
"when": 1764583392443,
|
|
"tag": "0055_rename_phone_number_to_phone",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 56,
|
|
"version": "7",
|
|
"when": 1764685643024,
|
|
"tag": "0056_update_agent_slug_index",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 57,
|
|
"version": "7",
|
|
"when": 1764734167674,
|
|
"tag": "0057_add_topic_user_memory_extract_status",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 58,
|
|
"version": "7",
|
|
"when": 1764842015809,
|
|
"tag": "0058_add_source_into_user_plugins",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 59,
|
|
"version": "7",
|
|
"when": 1764858574403,
|
|
"tag": "0059_add_normalized_email_indexes",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 60,
|
|
"version": "7",
|
|
"when": 1765437218969,
|
|
"tag": "0060_add_user_last_active_at",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 61,
|
|
"version": "7",
|
|
"when": 1765540257262,
|
|
"tag": "0061_add_document_and_memory_index",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 62,
|
|
"version": "7",
|
|
"when": 1765728439737,
|
|
"tag": "0062_add_more_index",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 63,
|
|
"version": "7",
|
|
"when": 1766157362540,
|
|
"tag": "0063_add_columns_for_several_tables",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 64,
|
|
"version": "7",
|
|
"when": 1766297832021,
|
|
"tag": "0064_add_agents_session_group_id",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 65,
|
|
"version": "7",
|
|
"when": 1766408202688,
|
|
"tag": "0065_add_passkey",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 66,
|
|
"version": "7",
|
|
"when": 1766474494249,
|
|
"tag": "0066_add_document_fields",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 67,
|
|
"version": "7",
|
|
"when": 1767929492232,
|
|
"tag": "0067_add_agent_cron_tables",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 68,
|
|
"version": "7",
|
|
"when": 1768189437504,
|
|
"tag": "0068_update_group_data",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 69,
|
|
"version": "7",
|
|
"when": 1768303764632,
|
|
"tag": "0069_add_topic_shares_table",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 70,
|
|
"version": "7",
|
|
"when": 1768999498635,
|
|
"tag": "0070_add_user_memory_activities",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 71,
|
|
"version": "7",
|
|
"when": 1769093425330,
|
|
"tag": "0071_add_async_task_extend",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 72,
|
|
"version": "7",
|
|
"when": 1769251608013,
|
|
"tag": "0072_add_market_identifier_chat_group",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 73,
|
|
"version": "7",
|
|
"when": 1769272397744,
|
|
"tag": "0073_add_message_group_metadata",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 74,
|
|
"version": "7",
|
|
"when": 1769341100106,
|
|
"tag": "0074_add_fk_indexes_for_cascade_delete",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 75,
|
|
"version": "7",
|
|
"when": 1769362978088,
|
|
"tag": "0075_add_user_memory_persona",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 76,
|
|
"version": "7",
|
|
"when": 1770179814971,
|
|
"tag": "0076_add_message_group_index",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 77,
|
|
"version": "7",
|
|
"when": 1770392264696,
|
|
"tag": "0077_add_agent_skills",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 78,
|
|
"version": "7",
|
|
"when": 1770621740632,
|
|
"tag": "0078_added_id_nanoid_for_replacing_id",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 79,
|
|
"version": "7",
|
|
"when": 1770621892194,
|
|
"tag": "0079_update_id_nanoid_from_casted_id",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 80,
|
|
"version": "7",
|
|
"when": 1770624987735,
|
|
"tag": "0080_add_constraint_unique_not_null_to_id_nanoid",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 81,
|
|
"version": "7",
|
|
"when": 1770626135088,
|
|
"tag": "0081_switch_forgien_key_to_id_nanoid",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 82,
|
|
"version": "7",
|
|
"when": 1770628390927,
|
|
"tag": "0082_set_id_nanoid_as_primary",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 83,
|
|
"version": "7",
|
|
"when": 1770628799077,
|
|
"tag": "0083_remove_id_seq_identity_column",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 84,
|
|
"version": "7",
|
|
"when": 1770631019385,
|
|
"tag": "0084_rename_id_nanoid_to_id",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 85,
|
|
"version": "7",
|
|
"when": 1770632176750,
|
|
"tag": "0085_remove_id_unique_constraint",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 86,
|
|
"version": "7",
|
|
"when": 1770955654188,
|
|
"tag": "0086_video_generation_schema",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 87,
|
|
"version": "7",
|
|
"when": 1771386090928,
|
|
"tag": "0087_add_eval_benchmark",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 88,
|
|
"version": "7",
|
|
"when": 1772277762014,
|
|
"tag": "0088_fix_benchmark_add_bot_provider",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 89,
|
|
"version": "7",
|
|
"when": 1772723999146,
|
|
"tag": "0089_add_api_key_hash",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 90,
|
|
"version": "7",
|
|
"when": 1773115333051,
|
|
"tag": "0090_enable_pg_search",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 91,
|
|
"version": "7",
|
|
"when": 1773308533505,
|
|
"tag": "0091_topics_add_description",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 92,
|
|
"version": "7",
|
|
"when": 1773419250145,
|
|
"tag": "0092_add_agent_documents",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 93,
|
|
"version": "7",
|
|
"when": 1773653550268,
|
|
"tag": "0093_add_bm25_indexes_with_icu",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 94,
|
|
"version": "7",
|
|
"when": 1773764776073,
|
|
"tag": "0094_agent_bot_providers_add_settings",
|
|
"breakpoints": true
|
|
},
|
|
{
|
|
"idx": 95,
|
|
"version": "7",
|
|
"when": 1774502940061,
|
|
"tag": "0095_add_agent_task_system",
|
|
"breakpoints": true
|
|
}
|
|
],
|
|
"version": "6"
|
|
}
|