mirror of
https://github.com/n8n-io/n8n.git
synced 2026-08-30 18:01:23 +08:00
refactor(core): Drop redundant agent execution columns (#32862)
This commit is contained in:
@@ -10,7 +10,7 @@ Auto-generated from the PostgreSQL migrations in @n8n/db. Do not edit by hand.
|
||||
| ---- | ------- | ------- | ---- |
|
||||
| [public.agent_chat_subscriptions](public.agent_chat_subscriptions.md) | 6 | | BASE TABLE |
|
||||
| [public.agent_checkpoints](public.agent_checkpoints.md) | 6 | | BASE TABLE |
|
||||
| [public.agent_execution](public.agent_execution.md) | 20 | | BASE TABLE |
|
||||
| [public.agent_execution](public.agent_execution.md) | 18 | | BASE TABLE |
|
||||
| [public.agent_execution_threads](public.agent_execution_threads.md) | 17 | | BASE TABLE |
|
||||
| [public.agent_files](public.agent_files.md) | 8 | | BASE TABLE |
|
||||
| [public.agent_history](public.agent_history.md) | 9 | | BASE TABLE |
|
||||
@@ -307,7 +307,6 @@ erDiagram
|
||||
timestamp_3__with_time_zone updatedAt
|
||||
}
|
||||
"public.agent_execution" {
|
||||
text assistantResponse
|
||||
integer completionTokens
|
||||
double_precision cost
|
||||
timestamp_3__with_time_zone createdAt
|
||||
@@ -323,7 +322,6 @@ erDiagram
|
||||
timestamp_3__with_time_zone stoppedAt
|
||||
varchar_128_ threadId FK
|
||||
json timeline
|
||||
json toolCalls
|
||||
integer totalTokens
|
||||
timestamp_3__with_time_zone updatedAt
|
||||
text userMessage
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
| Name | Type | Default | Nullable | Children | Parents | Comment |
|
||||
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
|
||||
| assistantResponse | text | | false | | | |
|
||||
| completionTokens | integer | | true | | | |
|
||||
| cost | double precision | | true | | | |
|
||||
| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | |
|
||||
@@ -20,10 +19,9 @@
|
||||
| stoppedAt | timestamp(3) with time zone | | true | | | |
|
||||
| threadId | varchar(128) | | false | | [public.agent_execution_threads](public.agent_execution_threads.md) | |
|
||||
| timeline | json | | true | | | |
|
||||
| toolCalls | json | | true | | | |
|
||||
| totalTokens | integer | | true | | | |
|
||||
| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | |
|
||||
| userMessage | text | | false | | | |
|
||||
| userMessage | text | | true | | | |
|
||||
|
||||
## Constraints
|
||||
|
||||
@@ -33,14 +31,12 @@
|
||||
| CHK_agent_execution_status | CHECK | CHECK (((status)::text = ANY ((ARRAY['success'::character varying, 'error'::character varying])::text[]))) |
|
||||
| FK_add2432fb6034cc18b6af299dce | FOREIGN KEY | FOREIGN KEY ("threadId") REFERENCES agent_execution_threads(id) ON DELETE CASCADE |
|
||||
| PK_ba438acc8532addc12d1ef17049 | PRIMARY KEY | PRIMARY KEY (id) |
|
||||
| agent_execution_assistantResponse_not_null | n | NOT NULL "assistantResponse" |
|
||||
| agent_execution_createdAt_not_null | n | NOT NULL "createdAt" |
|
||||
| agent_execution_duration_not_null | n | NOT NULL duration |
|
||||
| agent_execution_id_not_null | n | NOT NULL id |
|
||||
| agent_execution_status_not_null | n | NOT NULL status |
|
||||
| agent_execution_threadId_not_null | n | NOT NULL "threadId" |
|
||||
| agent_execution_updatedAt_not_null | n | NOT NULL "updatedAt" |
|
||||
| agent_execution_userMessage_not_null | n | NOT NULL "userMessage" |
|
||||
|
||||
## Indexes
|
||||
|
||||
@@ -57,7 +53,6 @@ erDiagram
|
||||
"public.agent_execution" }o--|| "public.agent_execution_threads" : "FOREIGN KEY (#quot;threadId#quot;) REFERENCES agent_execution_threads(id) ON DELETE CASCADE"
|
||||
|
||||
"public.agent_execution" {
|
||||
text assistantResponse
|
||||
integer completionTokens
|
||||
double_precision cost
|
||||
timestamp_3__with_time_zone createdAt
|
||||
@@ -73,7 +68,6 @@ erDiagram
|
||||
timestamp_3__with_time_zone stoppedAt
|
||||
varchar_128_ threadId FK
|
||||
json timeline
|
||||
json toolCalls
|
||||
integer totalTokens
|
||||
timestamp_3__with_time_zone updatedAt
|
||||
text userMessage
|
||||
|
||||
@@ -94,7 +94,6 @@ erDiagram
|
||||
varchar_36_ versionId
|
||||
}
|
||||
"public.agent_execution" {
|
||||
text assistantResponse
|
||||
integer completionTokens
|
||||
double_precision cost
|
||||
timestamp_3__with_time_zone createdAt
|
||||
@@ -110,7 +109,6 @@ erDiagram
|
||||
timestamp_3__with_time_zone stoppedAt
|
||||
varchar_128_ threadId FK
|
||||
json timeline
|
||||
json toolCalls
|
||||
integer totalTokens
|
||||
timestamp_3__with_time_zone updatedAt
|
||||
text userMessage
|
||||
|
||||
@@ -10,7 +10,7 @@ Auto-generated from the SQLite migrations in @n8n/db. Do not edit by hand.
|
||||
| ---- | ------- | ------- | ---- |
|
||||
| [agent_chat_subscriptions](agent_chat_subscriptions.md) | 6 | | table |
|
||||
| [agent_checkpoints](agent_checkpoints.md) | 6 | | table |
|
||||
| [agent_execution](agent_execution.md) | 20 | | table |
|
||||
| [agent_execution](agent_execution.md) | 18 | | table |
|
||||
| [agent_execution_threads](agent_execution_threads.md) | 17 | | table |
|
||||
| [agent_files](agent_files.md) | 8 | | table |
|
||||
| [agent_history](agent_history.md) | 9 | | table |
|
||||
@@ -295,7 +295,6 @@ erDiagram
|
||||
datetime_3_ updatedAt
|
||||
}
|
||||
"agent_execution" {
|
||||
TEXT assistantResponse
|
||||
INTEGER completionTokens
|
||||
REAL cost
|
||||
datetime_3_ createdAt
|
||||
@@ -311,7 +310,6 @@ erDiagram
|
||||
datetime_3_ stoppedAt
|
||||
varchar_128_ threadId FK
|
||||
TEXT timeline
|
||||
TEXT toolCalls
|
||||
INTEGER totalTokens
|
||||
datetime_3_ updatedAt
|
||||
TEXT userMessage
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<summary><strong>Table Definition</strong></summary>
|
||||
|
||||
```sql
|
||||
CREATE TABLE "agent_execution" ("id" varchar(36) PRIMARY KEY NOT NULL, "threadId" varchar(128) NOT NULL, "status" varchar(16) NOT NULL, "startedAt" datetime(3), "stoppedAt" datetime(3), "duration" integer NOT NULL DEFAULT (0), "userMessage" text NOT NULL, "assistantResponse" text NOT NULL, "model" varchar(255), "promptTokens" integer, "completionTokens" integer, "totalTokens" integer, "cost" real, "toolCalls" text, "timeline" text, "error" text, "hitlStatus" varchar(16), "source" varchar(32), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "CHK_agent_execution_status" CHECK (("status" IN ('success', 'error'))), CONSTRAINT "CHK_agent_execution_hitlStatus" CHECK (("hitlStatus" IN ('suspended', 'resumed'))), CONSTRAINT "FK_add2432fb6034cc18b6af299dce" FOREIGN KEY ("threadId") REFERENCES "agent_execution_threads" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)
|
||||
CREATE TABLE "agent_execution" ("id" varchar(36) PRIMARY KEY NOT NULL, "threadId" varchar(128) NOT NULL, "status" varchar(16) NOT NULL, "startedAt" datetime(3), "stoppedAt" datetime(3), "duration" integer NOT NULL DEFAULT (0), "userMessage" text, "model" varchar(255), "promptTokens" integer, "completionTokens" integer, "totalTokens" integer, "cost" real, "timeline" text, "error" text, "hitlStatus" varchar(16), "source" varchar(32), "createdAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), "updatedAt" datetime(3) NOT NULL DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')), CONSTRAINT "CHK_agent_execution_status" CHECK (((("status" IN ('success', 'error'))))), CONSTRAINT "CHK_agent_execution_hitlStatus" CHECK (((("hitlStatus" IN ('suspended', 'resumed'))))), CONSTRAINT "FK_add2432fb6034cc18b6af299dce" FOREIGN KEY ("threadId") REFERENCES "agent_execution_threads" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)
|
||||
```
|
||||
|
||||
</details>
|
||||
@@ -15,7 +15,6 @@ CREATE TABLE "agent_execution" ("id" varchar(36) PRIMARY KEY NOT NULL, "threadId
|
||||
|
||||
| Name | Type | Default | Nullable | Children | Parents | Comment |
|
||||
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
|
||||
| assistantResponse | TEXT | | false | | | |
|
||||
| completionTokens | INTEGER | | true | | | |
|
||||
| cost | REAL | | true | | | |
|
||||
| createdAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | |
|
||||
@@ -31,17 +30,16 @@ CREATE TABLE "agent_execution" ("id" varchar(36) PRIMARY KEY NOT NULL, "threadId
|
||||
| stoppedAt | datetime(3) | | true | | | |
|
||||
| threadId | varchar(128) | | false | | [agent_execution_threads](agent_execution_threads.md) | |
|
||||
| timeline | TEXT | | true | | | |
|
||||
| toolCalls | TEXT | | true | | | |
|
||||
| totalTokens | INTEGER | | true | | | |
|
||||
| updatedAt | datetime(3) | STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW') | false | | | |
|
||||
| userMessage | TEXT | | false | | | |
|
||||
| userMessage | TEXT | | true | | | |
|
||||
|
||||
## Constraints
|
||||
|
||||
| Name | Type | Definition |
|
||||
| ---- | ---- | ---------- |
|
||||
| - | CHECK | CHECK (("status" IN ('success', 'error'))) |
|
||||
| - | CHECK | CHECK (("hitlStatus" IN ('suspended', 'resumed'))) |
|
||||
| - | CHECK | CHECK (((("status" IN ('success', 'error'))))) |
|
||||
| - | CHECK | CHECK (((("hitlStatus" IN ('suspended', 'resumed'))))) |
|
||||
| - (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (threadId) REFERENCES agent_execution_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE |
|
||||
| id | PRIMARY KEY | PRIMARY KEY (id) |
|
||||
| sqlite_autoindex_agent_execution_1 | PRIMARY KEY | PRIMARY KEY (id) |
|
||||
@@ -61,7 +59,6 @@ erDiagram
|
||||
"agent_execution" }o--|| "agent_execution_threads" : "FOREIGN KEY (threadId) REFERENCES agent_execution_threads (id) ON UPDATE NO ACTION ON DELETE CASCADE MATCH NONE"
|
||||
|
||||
"agent_execution" {
|
||||
TEXT assistantResponse
|
||||
INTEGER completionTokens
|
||||
REAL cost
|
||||
datetime_3_ createdAt
|
||||
@@ -77,7 +74,6 @@ erDiagram
|
||||
datetime_3_ stoppedAt
|
||||
varchar_128_ threadId FK
|
||||
TEXT timeline
|
||||
TEXT toolCalls
|
||||
INTEGER totalTokens
|
||||
datetime_3_ updatedAt
|
||||
TEXT userMessage
|
||||
|
||||
@@ -95,7 +95,6 @@ erDiagram
|
||||
varchar_36_ versionId
|
||||
}
|
||||
"agent_execution" {
|
||||
TEXT assistantResponse
|
||||
INTEGER completionTokens
|
||||
REAL cost
|
||||
datetime_3_ createdAt
|
||||
@@ -111,7 +110,6 @@ erDiagram
|
||||
datetime_3_ stoppedAt
|
||||
varchar_128_ threadId FK
|
||||
TEXT timeline
|
||||
TEXT toolCalls
|
||||
INTEGER totalTokens
|
||||
datetime_3_ updatedAt
|
||||
TEXT userMessage
|
||||
|
||||
Reference in New Issue
Block a user