Skip to content

Commit

Permalink
Merge branch 'awel-flow2.0' of https://github.com/eosphoros-ai/DB-GPT
Browse files Browse the repository at this point in the history
…into awel-flow2.0
  • Loading branch information
谨欣 committed Aug 19, 2024
2 parents 6284f6a + 3d1d275 commit 5c7b938
Show file tree
Hide file tree
Showing 41 changed files with 3,432 additions and 87 deletions.
5 changes: 5 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ DBGPT_LOG_LEVEL=INFO
# ENCRYPT KEY - The key used to encrypt and decrypt the data
# ENCRYPT_KEY=your_secret_key

#*******************************************************************#
#** File Server **#
#*******************************************************************#
## The local storage path of the file server, the default is pilot/data/file_server
# FILE_SERVER_LOCAL_STORAGE_PATH =

#*******************************************************************#
#** Application Config **#
Expand Down
3 changes: 3 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,6 @@ ignore_missing_imports = True

[mypy-networkx.*]
ignore_missing_imports = True

[mypy-pypdf.*]
ignore_missing_imports = True
44 changes: 44 additions & 0 deletions assets/schema/dbgpt.sql
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,50 @@ CREATE TABLE `dbgpt_serve_flow` (
KEY `ix_dbgpt_serve_flow_name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- dbgpt.dbgpt_serve_file definition
CREATE TABLE `dbgpt_serve_file` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'Auto increment id',
`bucket` varchar(255) NOT NULL COMMENT 'Bucket name',
`file_id` varchar(255) NOT NULL COMMENT 'File id',
`file_name` varchar(256) NOT NULL COMMENT 'File name',
`file_size` int DEFAULT NULL COMMENT 'File size',
`storage_type` varchar(32) NOT NULL COMMENT 'Storage type',
`storage_path` varchar(512) NOT NULL COMMENT 'Storage path',
`uri` varchar(512) NOT NULL COMMENT 'File URI',
`custom_metadata` text DEFAULT NULL COMMENT 'Custom metadata, JSON format',
`file_hash` varchar(128) DEFAULT NULL COMMENT 'File hash',
`user_name` varchar(128) DEFAULT NULL COMMENT 'User name',
`sys_code` varchar(128) DEFAULT NULL COMMENT 'System code',
`gmt_created` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Record creation time',
`gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Record update time',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_bucket_file_id` (`bucket`, `file_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- dbgpt.dbgpt_serve_variables definition
CREATE TABLE `dbgpt_serve_variables` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'Auto increment id',
`key` varchar(128) NOT NULL COMMENT 'Variable key',
`name` varchar(128) DEFAULT NULL COMMENT 'Variable name',
`label` varchar(128) DEFAULT NULL COMMENT 'Variable label',
`value` text DEFAULT NULL COMMENT 'Variable value, JSON format',
`value_type` varchar(32) DEFAULT NULL COMMENT 'Variable value type(string, int, float, bool)',
`category` varchar(32) DEFAULT 'common' COMMENT 'Variable category(common or secret)',
`encryption_method` varchar(32) DEFAULT NULL COMMENT 'Variable encryption method(fernet, simple, rsa, aes)',
`salt` varchar(128) DEFAULT NULL COMMENT 'Variable salt',
`scope` varchar(32) DEFAULT 'global' COMMENT 'Variable scope(global,flow,app,agent,datasource,flow:uid, flow:dag_name,agent:agent_name) etc',
`scope_key` varchar(256) DEFAULT NULL COMMENT 'Variable scope key, default is empty, for scope is "flow:uid", the scope_key is uid of flow',
`enabled` int DEFAULT 1 COMMENT 'Variable enabled, 0: disabled, 1: enabled',
`user_name` varchar(128) DEFAULT NULL COMMENT 'User name',
`sys_code` varchar(128) DEFAULT NULL COMMENT 'System code',
`gmt_created` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Record creation time',
`gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Record update time',
PRIMARY KEY (`id`),
KEY `ix_your_table_name_key` (`key`),
KEY `ix_your_table_name_name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


-- dbgpt.gpts_app definition
CREATE TABLE `gpts_app` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'autoincrement id',
Expand Down
43 changes: 43 additions & 0 deletions assets/schema/upgrade/v0_6_0/upgrade_to_v0.6.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
-- dbgpt.dbgpt_serve_file definition
CREATE TABLE `dbgpt_serve_file` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'Auto increment id',
`bucket` varchar(255) NOT NULL COMMENT 'Bucket name',
`file_id` varchar(255) NOT NULL COMMENT 'File id',
`file_name` varchar(256) NOT NULL COMMENT 'File name',
`file_size` int DEFAULT NULL COMMENT 'File size',
`storage_type` varchar(32) NOT NULL COMMENT 'Storage type',
`storage_path` varchar(512) NOT NULL COMMENT 'Storage path',
`uri` varchar(512) NOT NULL COMMENT 'File URI',
`custom_metadata` text DEFAULT NULL COMMENT 'Custom metadata, JSON format',
`file_hash` varchar(128) DEFAULT NULL COMMENT 'File hash',
`user_name` varchar(128) DEFAULT NULL COMMENT 'User name',
`sys_code` varchar(128) DEFAULT NULL COMMENT 'System code',
`gmt_created` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Record creation time',
`gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Record update time',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_bucket_file_id` (`bucket`, `file_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- dbgpt.dbgpt_serve_variables definition
CREATE TABLE `dbgpt_serve_variables` (
`id` int NOT NULL AUTO_INCREMENT COMMENT 'Auto increment id',
`key` varchar(128) NOT NULL COMMENT 'Variable key',
`name` varchar(128) DEFAULT NULL COMMENT 'Variable name',
`label` varchar(128) DEFAULT NULL COMMENT 'Variable label',
`value` text DEFAULT NULL COMMENT 'Variable value, JSON format',
`value_type` varchar(32) DEFAULT NULL COMMENT 'Variable value type(string, int, float, bool)',
`category` varchar(32) DEFAULT 'common' COMMENT 'Variable category(common or secret)',
`encryption_method` varchar(32) DEFAULT NULL COMMENT 'Variable encryption method(fernet, simple, rsa, aes)',
`salt` varchar(128) DEFAULT NULL COMMENT 'Variable salt',
`scope` varchar(32) DEFAULT 'global' COMMENT 'Variable scope(global,flow,app,agent,datasource,flow:uid, flow:dag_name,agent:agent_name) etc',
`scope_key` varchar(256) DEFAULT NULL COMMENT 'Variable scope key, default is empty, for scope is "flow:uid", the scope_key is uid of flow',
`enabled` int DEFAULT 1 COMMENT 'Variable enabled, 0: disabled, 1: enabled',
`user_name` varchar(128) DEFAULT NULL COMMENT 'User name',
`sys_code` varchar(128) DEFAULT NULL COMMENT 'System code',
`gmt_created` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'Record creation time',
`gmt_modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Record update time',
PRIMARY KEY (`id`),
KEY `ix_your_table_name_key` (`key`),
KEY `ix_your_table_name_name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Loading

0 comments on commit 5c7b938

Please sign in to comment.