File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33> ** For Claude:** REQUIRED SUB-SKILL: Use superpowers: executing-plans to implement this plan task-by-task.
44
5- ** Goal:** 将 ` execution_logs .id` 改为数据库自增的整数主键,并同步代码与前端类型。
5+ ** Goal:** 将 ` worker_run_log .id` 改为数据库自增的整数主键,并同步代码与前端类型。
66
77** Architecture:** 不新增运行时迁移逻辑,默认由用户手动删除旧表后重新建表。后端将 ` WorkerLog.ID ` 改为 ` int64 ` 自增主键,写入时不再生成 UUID,前端日志类型同步改为数字。
88
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -5,18 +5,18 @@ import "time"
55// WorkerLog 表示函数执行日志。
66type WorkerLog struct {
77 ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
8- WorkerID string `json:"worker_id" gorm:"column:worker_id;type:text;not null;index:idx_execution_logs_worker_created ,priority:1"`
9- RequestID string `json:"request_id" gorm:"column:request_id;type:text;not null;index:idx_execution_logs_request_id "`
8+ WorkerID string `json:"worker_id" gorm:"column:worker_id;type:text;not null;index:idx_worker_run_log_worker_created ,priority:1"`
9+ RequestID string `json:"request_id" gorm:"column:request_id;type:text;not null;index:idx_worker_run_log_request_id "`
1010 Status int `json:"status" gorm:"column:status"`
1111 Stdin string `json:"stdin" gorm:"column:stdin;type:text"`
1212 Stdout string `json:"stdout" gorm:"column:stdout;type:text"`
1313 Stderr string `json:"stderr" gorm:"column:stderr;type:text"`
1414 Result string `json:"result" gorm:"column:result;type:text"`
1515 Error string `json:"error" gorm:"column:error;type:text"`
1616 DurationMS int64 `json:"duration_ms" gorm:"column:duration_ms"`
17- CreatedAt time.Time `json:"created_at" gorm:"column:created_at;not null;index:idx_execution_logs_worker_created ,priority:2;autoCreateTime:false"`
17+ CreatedAt time.Time `json:"created_at" gorm:"column:created_at;not null;index:idx_worker_run_log_worker_created ,priority:2;autoCreateTime:false"`
1818}
1919
2020func (WorkerLog ) TableName () string {
21- return "execution_logs "
21+ return "worker_run_log "
2222}
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ CREATE TABLE worker (
99 updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
1010);
1111
12- CREATE TABLE execution_logs (
12+ CREATE TABLE worker_run_log (
1313 id INTEGER PRIMARY KEY AUTOINCREMENT,
1414 worker_id TEXT NOT NULL ,
1515 request_id TEXT NOT NULL ,
@@ -23,8 +23,8 @@ CREATE TABLE execution_logs (
2323 created_at DATETIME DEFAULT CURRENT_TIMESTAMP
2424);
2525
26- CREATE INDEX idx_execution_logs_worker_created
27- ON execution_logs (worker_id, created_at);
26+ CREATE INDEX idx_worker_run_log_worker_created
27+ ON worker_run_log (worker_id, created_at);
2828
29- CREATE INDEX idx_execution_logs_request_id
30- ON execution_logs (request_id);
29+ CREATE INDEX idx_worker_run_log_request_id
30+ ON worker_run_log (request_id);
You can’t perform that action at this time.
0 commit comments