Skip to content

Commit

Permalink
👋更新task联合索引
Browse files Browse the repository at this point in the history
  • Loading branch information
zkep committed Jan 20, 2025
1 parent 99f5738 commit 7b4a8ab
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 54 deletions.
104 changes: 53 additions & 51 deletions internal/model/task.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions internal/model/task.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ option go_package = "model";
// Task
message Task {
// id
int64 id = 1 [(gogoproto.moretags) = "gorm:\"index:,composite:idx_tasks_status_deleted_at_id;primaryKey;autoIncrement;comment:id\""];
int64 id = 1 [(gogoproto.moretags) = "gorm:\"index:,priority:3,composite:idx_tasks_status_deleted_at_id;primaryKey;autoIncrement;comment:id\""];
// task id
string task_id = 2 [(gogoproto.moretags) = "gorm:\"unique;size:128;comment:task id\""];
// task pid
Expand Down Expand Up @@ -42,11 +42,11 @@ message Task {
// message
bytes statistics = 23 [(gogoproto.moretags) = "gorm:\"comment:statistics\""];
// status
int32 status = 24 [(gogoproto.moretags) = "gorm:\"index:,composite:idx_tasks_status_deleted_at_id;default:1;size:2;comment:status 1 normal\""];
int32 status = 24 [(gogoproto.moretags) = "gorm:\"index:,priority:1,composite:idx_tasks_status_deleted_at_id;default:1;size:2;comment:status 1 normal\""];
// created_at
int64 created_at = 25 [(gogoproto.moretags) = "gorm:\"index;comment:created at\""];
// updated_at
int64 updated_at = 26 [(gogoproto.moretags) = "gorm:\"index;comment:updated at\""];
// deleted_at
int64 deleted_at = 27 [(gogoproto.moretags) = "gorm:\"index:,composite:idx_tasks_status_deleted_at_id;comment:deleted at\""];
int64 deleted_at = 27 [(gogoproto.moretags) = "gorm:\"index:,priority:2,composite:idx_tasks_status_deleted_at_id;comment:deleted at\""];
}

0 comments on commit 7b4a8ab

Please sign in to comment.