|
| 1 | +CREATE DATABASE IF NOT EXISTS `modelcache`; |
| 2 | + |
| 3 | +USE `modelcache`; |
| 4 | + |
| 5 | +CREATE TABLE IF NOT EXISTS `modelcache_llm_answer` ( |
| 6 | + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT comment '主键', |
| 7 | + `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment '创建时间', |
| 8 | + `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '修改时间', |
| 9 | + `question` text NOT NULL comment 'question', |
| 10 | + `answer` text NOT NULL comment 'answer', |
| 11 | + `answer_type` int(11) NOT NULL comment 'answer_type', |
| 12 | + `hit_count` int(11) NOT NULL DEFAULT '0' comment 'hit_count', |
| 13 | + `model` varchar(1000) NOT NULL comment 'model', |
| 14 | + `embedding_data` blob NOT NULL comment 'embedding_data', |
| 15 | + `is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'delete state(0 Not deleted,-1 deleted)', |
| 16 | + PRIMARY KEY(`id`) |
| 17 | +) AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COMMENT = 'cache_codegpt_answer'; |
| 18 | + |
| 19 | +CREATE TABLE IF NOT EXISTS `modelcache_query_log` ( |
| 20 | + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT comment '主键', |
| 21 | + `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment '创建时间', |
| 22 | + `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '修改时间', |
| 23 | + `error_code` int(11) NOT NULL comment 'errorCode', |
| 24 | + `error_desc` varchar(1000) NOT NULL comment 'errorDesc', |
| 25 | + `cache_hit` varchar(100) NOT NULL comment 'cacheHit', |
| 26 | + `delta_time` float NOT NULL comment 'delta_time', |
| 27 | + `model` varchar(1000) NOT NULL comment 'model', |
| 28 | + `query` text NOT NULL comment 'query', |
| 29 | + `hit_query` text NOT NULL comment 'hitQuery', |
| 30 | + `answer` text NOT NULL comment 'answer', |
| 31 | + PRIMARY KEY(`id`) |
| 32 | +) AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8mb4 COMMENT = 'modelcache_query_log'; |
0 commit comments