feat: Optimize the table creation statement (#495)

This commit is contained in:
Ryo
2025-08-02 21:15:11 +08:00
committed by GitHub
parent d11aa71c0a
commit f094abe2fd
8 changed files with 221 additions and 199 deletions

View File

@@ -0,0 +1,18 @@
-- Modify "connector_workflow_version" table
ALTER TABLE `opencoze`.`connector_workflow_version` COMMENT "connector workflow version", RENAME INDEX `idx_connector_id_workflow_id_version` TO `uniq_connector_id_workflow_id_version`;
-- Modify "knowledge" table
ALTER TABLE `opencoze`.`knowledge` MODIFY COLUMN `name` varchar(150) NOT NULL DEFAULT "" COMMENT "knowledge_s name";
-- Modify "node_execution" table
ALTER TABLE `opencoze`.`node_execution` MODIFY COLUMN `composite_node_index` bigint unsigned NULL COMMENT "loop or batch_s execution index", MODIFY COLUMN `parent_node_id` varchar(128) NULL COMMENT "when as inner node for loop or batch, this is the parent node_s key" COLLATE utf8mb4_unicode_ci;
-- Modify "plugin_oauth_auth" table
ALTER TABLE `opencoze`.`plugin_oauth_auth` MODIFY COLUMN `access_token` text NULL COMMENT "Access Token", MODIFY COLUMN `refresh_token` text NULL COMMENT "Refresh Token";
-- Modify "single_agent_draft" table
ALTER TABLE `opencoze`.`single_agent_draft` MODIFY COLUMN `description` text NULL COMMENT "Agent Description";
-- Modify "single_agent_version" table
ALTER TABLE `opencoze`.`single_agent_version` MODIFY COLUMN `description` text NULL COMMENT "Agent Description";
-- Modify "workflow_draft" table
ALTER TABLE `opencoze`.`workflow_draft` MODIFY COLUMN `canvas` mediumtext NULL COMMENT "Front end schema";
-- Modify "workflow_snapshot" table
ALTER TABLE `opencoze`.`workflow_snapshot` MODIFY COLUMN `canvas` mediumtext NULL COMMENT "frontend schema for this snapshot";
-- Modify "workflow_version" table
ALTER TABLE `opencoze`.`workflow_version` MODIFY COLUMN `canvas` mediumtext NULL COMMENT "Front end schema";

View File

@@ -1,4 +1,4 @@
h1:NkRT9U8wV1wIRcHvkU2N3yjWDjvyi6avhjzgpMJdEtM=
h1:3ar6fnSw3e4ni74BcE2N9cIentO27OcfSt465WTv2Po=
20250703095335_initial.sql h1:/joaeUTMhXqAEc0KwsSve5+bYM0qPOp+9OizJtsRc+U=
20250703115304_update.sql h1:cbYo6Q6Lh96hB4hu5KW2Nn/Mr0VDpg7a1WPgpIb1SOc=
20250704040445_update.sql h1:QWmoPY//oQ+GFZwET9w/oAWa8mM0KVaD5G8Yiu9bMqY=
@@ -7,3 +7,4 @@ h1:NkRT9U8wV1wIRcHvkU2N3yjWDjvyi6avhjzgpMJdEtM=
20250711034533_update.sql h1:EWeK//5urS9hJIRCeD3lwQYWNH9AIKEWG9pMLdw7KPc=
20250717125913_update.sql h1:WtPR99RlWZn0rXZsB19qp1hq0FwO5qmFhcTcV6EnFYs=
20250730131847_update.sql h1:qIutMrXtuOA98jeucTFxXck+sQNjNTtIF2apbCYt3IY=
20250802115105_update.sql h1:irreQaMAL0LtXcDlkdHP86C7/0e2HzEVsa1hP/FkZ2M=

View File

@@ -507,7 +507,8 @@ table "app_release_record" {
}
}
table "connector_workflow_version" {
schema = schema.opencoze
schema = schema.opencoze
comment = "connector workflow version"
column "id" {
null = false
type = bigint
@@ -550,7 +551,7 @@ table "connector_workflow_version" {
index "idx_connector_id_workflow_id_create_at" {
columns = [column.connector_id, column.workflow_id, column.created_at]
}
index "idx_connector_id_workflow_id_version" {
index "uniq_connector_id_workflow_id_version" {
unique = true
columns = [column.connector_id, column.workflow_id, column.version]
}
@@ -862,7 +863,7 @@ table "knowledge" {
null = false
type = varchar(150)
default = ""
comment = "knowledge's name"
comment = "knowledge_s name"
}
column "app_id" {
null = false
@@ -1647,7 +1648,7 @@ table "node_execution" {
null = true
type = bigint
unsigned = true
comment = "loop or batch's execution index"
comment = "loop or batch_s execution index"
}
column "composite_node_items" {
null = true
@@ -1658,7 +1659,7 @@ table "node_execution" {
column "parent_node_id" {
null = true
type = varchar(128)
comment = "when as inner node for loop or batch, this is the parent node's key"
comment = "when as inner node for loop or batch, this is the parent node_s key"
collate = "utf8mb4_unicode_ci"
}
column "sub_execute_id" {
@@ -2005,12 +2006,12 @@ table "plugin_oauth_auth" {
comment = "Authorization Code OAuth Config"
}
column "access_token" {
null = false
null = true
type = text
comment = "Access Token"
}
column "refresh_token" {
null = false
null = true
type = text
comment = "Refresh Token"
}
@@ -2523,7 +2524,7 @@ table "single_agent_draft" {
comment = "Agent Name"
}
column "description" {
null = false
null = true
type = text
comment = "Agent Description"
}
@@ -2751,7 +2752,7 @@ table "single_agent_version" {
comment = "Agent Name"
}
column "description" {
null = false
null = true
type = text
comment = "Agent Description"
}
@@ -3526,7 +3527,7 @@ table "workflow_draft" {
comment = "workflow ID"
}
column "canvas" {
null = false
null = true
type = mediumtext
comment = "Front end schema"
}
@@ -3948,7 +3949,7 @@ table "workflow_snapshot" {
comment = "the commit id of the workflow draft"
}
column "canvas" {
null = false
null = true
type = mediumtext
comment = "frontend schema for this snapshot"
}
@@ -4010,7 +4011,7 @@ table "workflow_version" {
comment = "Version Description"
}
column "canvas" {
null = false
null = true
type = mediumtext
comment = "Front end schema"
}