mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-11 13:58:58 +00:00
feat(dbgpts): fix dbgpts update blocking service problem
This commit is contained in:
@@ -467,7 +467,7 @@ CREATE TABLE `user_recent_apps` (
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='User recently used apps';
|
||||
|
||||
-- dbgpt.dbgpt_serve_dbgpts_my definition
|
||||
CREATE TABLE `dbgpts_my` (
|
||||
CREATE TABLE `dbgpt_serve_dbgpts_my` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT 'autoincrement id',
|
||||
`name` varchar(255) NOT NULL COMMENT 'plugin name',
|
||||
`user_code` varchar(255) DEFAULT NULL COMMENT 'user code',
|
||||
@@ -481,12 +481,12 @@ CREATE TABLE `dbgpts_my` (
|
||||
`gmt_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'plugin install time',
|
||||
`gmt_modified` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'update time',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`, `user_code`),
|
||||
UNIQUE KEY `name` (`name`, `user_name`),
|
||||
KEY `ix_my_plugin_sys_code` (`sys_code`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- dbgpt.dbgpt_serve_dbgpts_hub definition
|
||||
CREATE TABLE `dbgpts_hub` (
|
||||
CREATE TABLE `dbgpt_serve_dbgpts_hub` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT 'autoincrement id',
|
||||
`name` varchar(255) NOT NULL COMMENT 'plugin name',
|
||||
`description` varchar(255) NULL COMMENT 'plugin description',
|
||||
|
@@ -117,7 +117,7 @@ CREATE TABLE `dbgpt_serve_variables` (
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- dbgpt.dbgpt_serve_dbgpts_my definition
|
||||
CREATE TABLE `dbgpts_my` (
|
||||
CREATE TABLE `dbgpt_serve_dbgpts_my` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT 'autoincrement id',
|
||||
`name` varchar(255) NOT NULL COMMENT 'plugin name',
|
||||
`user_name` varchar(255) DEFAULT NULL COMMENT 'user name',
|
||||
@@ -130,12 +130,12 @@ CREATE TABLE `dbgpts_my` (
|
||||
`gmt_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'plugin install time',
|
||||
`gmt_modified` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'update time',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`, `user_code`),
|
||||
UNIQUE KEY `name` (`name`, `user_name`),
|
||||
KEY `ix_my_plugin_sys_code` (`sys_code`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- dbgpt.dbgpt_serve_dbgpts_hub definition
|
||||
CREATE TABLE `dbgpts_hub` (
|
||||
CREATE TABLE `dbgpt_serve_dbgpts_hub` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT 'autoincrement id',
|
||||
`name` varchar(255) NOT NULL COMMENT 'plugin name',
|
||||
`description` varchar(255) NULL COMMENT 'plugin description',
|
||||
|
@@ -9,7 +9,7 @@ SERVE_APP_NAME_HUMP = "dbgpt_serve_DbgptsHub"
|
||||
SERVE_CONFIG_KEY_PREFIX = "dbgpt.serve.dbgpts_hub."
|
||||
SERVE_SERVICE_COMPONENT_NAME = f"{SERVE_APP_NAME}_service"
|
||||
# Database table name
|
||||
SERVER_APP_TABLE_NAME = "dbgpts_hub"
|
||||
SERVER_APP_TABLE_NAME = SERVE_APP_NAME
|
||||
|
||||
|
||||
@dataclass
|
||||
|
@@ -9,7 +9,7 @@ SERVE_APP_NAME_HUMP = "dbgpt_serve_DbgptsMy"
|
||||
SERVE_CONFIG_KEY_PREFIX = "dbgpt.serve.dbgpts_my."
|
||||
SERVE_SERVICE_COMPONENT_NAME = f"{SERVE_APP_NAME}_service"
|
||||
# Database table name
|
||||
SERVER_APP_TABLE_NAME = "dbgpts_my"
|
||||
SERVER_APP_TABLE_NAME = SERVE_APP_NAME
|
||||
|
||||
|
||||
@dataclass
|
||||
|
@@ -34,7 +34,7 @@ class ServeEntity(Model):
|
||||
onupdate=datetime.utcnow,
|
||||
comment="Record update time",
|
||||
)
|
||||
UniqueConstraint("user_code", "name", name="uk_name")
|
||||
UniqueConstraint("user_name", "name", name="uk_name")
|
||||
|
||||
|
||||
class ServeDao(BaseDao[ServeEntity, ServeRequest, ServerResponse]):
|
||||
|
Reference in New Issue
Block a user