mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-29 12:34:28 +08:00
Compare commits
8 Commits
202957a4c0
...
7bf2fcb7fa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bf2fcb7fa | ||
|
|
2e81b190a4 | ||
|
|
81cd60d2da | ||
|
|
3ffc8c3d9e | ||
|
|
18db24c011 | ||
|
|
cd698ac367 | ||
|
|
58b640b087 | ||
|
|
1f28aaeaed |
@@ -24,7 +24,7 @@ public class UserWithPassword extends User {
|
|||||||
|
|
||||||
public UserWithPassword(Long id, String name, String displayName, String email, String password,
|
public UserWithPassword(Long id, String name, String displayName, String email, String password,
|
||||||
Integer isAdmin) {
|
Integer isAdmin) {
|
||||||
super(id, name, displayName, email, isAdmin);
|
super(id, name, displayName, email, isAdmin, null);
|
||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
||||||
|
import java.sql.Timestamp;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -102,7 +103,9 @@ public class DefaultUserAdaptor implements UserAdaptor {
|
|||||||
TokenService tokenService = ContextUtils.getBean(TokenService.class);
|
TokenService tokenService = ContextUtils.getBean(TokenService.class);
|
||||||
try {
|
try {
|
||||||
UserWithPassword user = getUserWithPassword(userReq);
|
UserWithPassword user = getUserWithPassword(userReq);
|
||||||
return tokenService.generateToken(UserWithPassword.convert(user), appKey);
|
String token = tokenService.generateToken(UserWithPassword.convert(user), appKey);
|
||||||
|
updateLastLogin(userReq.getName());
|
||||||
|
return token;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("", e);
|
log.error("", e);
|
||||||
throw new RuntimeException("password encrypt error, please try again");
|
throw new RuntimeException("password encrypt error, please try again");
|
||||||
@@ -267,4 +270,11 @@ public class DefaultUserAdaptor implements UserAdaptor {
|
|||||||
userToken.setExpireDate(userTokenDO.getExpireDateTime());
|
userToken.setExpireDate(userTokenDO.getExpireDateTime());
|
||||||
return userToken;
|
return userToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateLastLogin(String userName) {
|
||||||
|
UserRepository userRepository = ContextUtils.getBean(UserRepository.class);
|
||||||
|
UserDO userDO = userRepository.getUser(userName);
|
||||||
|
userDO.setLastLogin(new Timestamp(System.currentTimeMillis()));
|
||||||
|
userRepository.updateUser(userDO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,11 @@ package com.tencent.supersonic.auth.authentication.persistence.dataobject;
|
|||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
|
||||||
|
@Data
|
||||||
@TableName("s2_user")
|
@TableName("s2_user")
|
||||||
public class UserDO {
|
public class UserDO {
|
||||||
|
|
||||||
@@ -27,71 +31,25 @@ public class UserDO {
|
|||||||
/** */
|
/** */
|
||||||
private Integer isAdmin;
|
private Integer isAdmin;
|
||||||
|
|
||||||
/** @return id */
|
private Timestamp lastLogin;
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @param id */
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @return name */
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @param name */
|
/** @param name */
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.name = name == null ? null : name.trim();
|
this.name = name == null ? null : name.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return password */
|
|
||||||
public String getPassword() {
|
|
||||||
return password;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @param password */
|
/** @param password */
|
||||||
public void setPassword(String password) {
|
public void setPassword(String password) {
|
||||||
this.password = password == null ? null : password.trim();
|
this.password = password == null ? null : password.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSalt() {
|
|
||||||
return salt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSalt(String salt) {
|
public void setSalt(String salt) {
|
||||||
this.salt = salt == null ? null : salt.trim();
|
this.salt = salt == null ? null : salt.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return display_name */
|
|
||||||
public String getDisplayName() {
|
|
||||||
return displayName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @param displayName */
|
|
||||||
public void setDisplayName(String displayName) {
|
|
||||||
this.displayName = displayName == null ? null : displayName.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @return email */
|
|
||||||
public String getEmail() {
|
|
||||||
return email;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @param email */
|
/** @param email */
|
||||||
public void setEmail(String email) {
|
public void setEmail(String email) {
|
||||||
this.email = email == null ? null : email.trim();
|
this.email = email == null ? null : email.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return is_admin */
|
|
||||||
public Integer getIsAdmin() {
|
|
||||||
return isAdmin;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @param isAdmin */
|
|
||||||
public void setIsAdmin(Integer isAdmin) {
|
|
||||||
this.isAdmin = isAdmin;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,6 +136,9 @@
|
|||||||
<if test="isAdmin != null">
|
<if test="isAdmin != null">
|
||||||
is_admin = #{isAdmin,jdbcType=INTEGER},
|
is_admin = #{isAdmin,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="lastLogin != null">
|
||||||
|
last_login = #{lastLogin,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where id = #{id,jdbcType=BIGINT}
|
where id = #{id,jdbcType=BIGINT}
|
||||||
</update>
|
</update>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import lombok.NoArgsConstructor;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@@ -22,26 +23,28 @@ public class User implements Serializable {
|
|||||||
|
|
||||||
private Integer isAdmin;
|
private Integer isAdmin;
|
||||||
|
|
||||||
|
private Timestamp lastLogin;
|
||||||
|
|
||||||
public static User get(Long id, String name, String displayName, String email,
|
public static User get(Long id, String name, String displayName, String email,
|
||||||
Integer isAdmin) {
|
Integer isAdmin) {
|
||||||
return new User(id, name, displayName, email, isAdmin);
|
return new User(id, name, displayName, email, isAdmin, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static User get(Long id, String name) {
|
public static User get(Long id, String name) {
|
||||||
return new User(id, name, name, name, 0);
|
return new User(id, name, name, name, 0, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static User getDefaultUser() {
|
public static User getDefaultUser() {
|
||||||
return new User(1L, "admin", "admin", "admin@email", 1);
|
return new User(1L, "admin", "admin", "admin@email", 1, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static User getVisitUser() {
|
public static User getVisitUser() {
|
||||||
return new User(1L, "visit", "visit", "visit@email", 0);
|
return new User(1L, "visit", "visit", "visit@email", 0, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static User getAppUser(int appId) {
|
public static User getAppUser(int appId) {
|
||||||
String name = String.format("app_%s", appId);
|
String name = String.format("app_%s", appId);
|
||||||
return new User(1L, name, name, "", 1);
|
return new User(1L, name, name, "", 1, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDisplayName() {
|
public String getDisplayName() {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class EmbeddingServiceImpl implements EmbeddingService {
|
|||||||
try {
|
try {
|
||||||
EmbeddingModel embeddingModel = ModelProvider.getEmbeddingModel();
|
EmbeddingModel embeddingModel = ModelProvider.getEmbeddingModel();
|
||||||
Embedding embedding = embeddingModel.embed(question).content();
|
Embedding embedding = embeddingModel.embed(question).content();
|
||||||
boolean existSegment = existSegment(embeddingStore, query, embedding);
|
boolean existSegment = existSegment(collectionName,embeddingStore, query, embedding);
|
||||||
if (existSegment) {
|
if (existSegment) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -62,14 +62,14 @@ public class EmbeddingServiceImpl implements EmbeddingService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean existSegment(EmbeddingStore embeddingStore, TextSegment query,
|
private boolean existSegment(String collectionName,EmbeddingStore embeddingStore, TextSegment query,
|
||||||
Embedding embedding) {
|
Embedding embedding) {
|
||||||
String queryId = TextSegmentConvert.getQueryId(query);
|
String queryId = TextSegmentConvert.getQueryId(query);
|
||||||
if (queryId == null) {
|
if (queryId == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Check cache first
|
// Check cache first
|
||||||
Boolean cachedResult = cache.getIfPresent(queryId);
|
Boolean cachedResult = cache.getIfPresent(collectionName+queryId);
|
||||||
if (cachedResult != null) {
|
if (cachedResult != null) {
|
||||||
return cachedResult;
|
return cachedResult;
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ public class EmbeddingServiceImpl implements EmbeddingService {
|
|||||||
EmbeddingSearchResult result = embeddingStore.search(request);
|
EmbeddingSearchResult result = embeddingStore.search(request);
|
||||||
List<EmbeddingMatch<TextSegment>> relevant = result.matches();
|
List<EmbeddingMatch<TextSegment>> relevant = result.matches();
|
||||||
boolean exists = CollectionUtils.isNotEmpty(relevant);
|
boolean exists = CollectionUtils.isNotEmpty(relevant);
|
||||||
cache.put(queryId, exists);
|
cache.put(collectionName+queryId, exists);
|
||||||
return exists;
|
return exists;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ services:
|
|||||||
POSTGRES_PASSWORD: supersonic_password
|
POSTGRES_PASSWORD: supersonic_password
|
||||||
ports:
|
ports:
|
||||||
- "15432:5432"
|
- "15432:5432"
|
||||||
# volumes:
|
volumes:
|
||||||
# - postgres_data:/var/lib/postgresql/data
|
- ./supersonic_pg/data:/var/lib/postgresql/data
|
||||||
networks:
|
networks:
|
||||||
- supersonic_network
|
- supersonic_network
|
||||||
dns:
|
dns:
|
||||||
@@ -65,7 +65,6 @@ services:
|
|||||||
# propagation: rprivate
|
# propagation: rprivate
|
||||||
# create_host_path: true
|
# create_host_path: true
|
||||||
#volumes:
|
#volumes:
|
||||||
# postgres_data:
|
|
||||||
# supersonic_data:
|
# supersonic_data:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
package com.tencent.supersonic.headless.chat.corrector;
|
package com.tencent.supersonic.headless.chat.corrector;
|
||||||
|
|
||||||
|
import com.tencent.supersonic.common.util.ContextUtils;
|
||||||
import com.tencent.supersonic.headless.api.pojo.SemanticParseInfo;
|
import com.tencent.supersonic.headless.api.pojo.SemanticParseInfo;
|
||||||
import com.tencent.supersonic.headless.chat.ChatQueryContext;
|
import com.tencent.supersonic.headless.chat.ChatQueryContext;
|
||||||
|
import com.tencent.supersonic.headless.chat.parser.ParserConfig;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.tencent.supersonic.headless.chat.parser.ParserConfig.PARSER_RULE_CORRECTOR_ENABLE;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class RuleSqlCorrector extends BaseSemanticCorrector {
|
public class RuleSqlCorrector extends BaseSemanticCorrector {
|
||||||
private List<BaseSemanticCorrector> correctors;
|
private List<BaseSemanticCorrector> correctors;
|
||||||
@@ -20,6 +24,11 @@ public class RuleSqlCorrector extends BaseSemanticCorrector {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doCorrect(ChatQueryContext chatQueryContext, SemanticParseInfo semanticParseInfo) {
|
public void doCorrect(ChatQueryContext chatQueryContext, SemanticParseInfo semanticParseInfo) {
|
||||||
|
ParserConfig parserConfig = ContextUtils.getBean(ParserConfig.class);
|
||||||
|
if(!Boolean.parseBoolean(parserConfig.getParameterValue(PARSER_RULE_CORRECTOR_ENABLE))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (BaseSemanticCorrector corrector : correctors) {
|
for (BaseSemanticCorrector corrector : correctors) {
|
||||||
corrector.correct(chatQueryContext, semanticParseInfo);
|
corrector.correct(chatQueryContext, semanticParseInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ public class ParserConfig extends ParameterConfig {
|
|||||||
"ONE_PASS_SELF_CONSISTENCY: 通过投票方式一步生成sql", "list", "语义解析配置",
|
"ONE_PASS_SELF_CONSISTENCY: 通过投票方式一步生成sql", "list", "语义解析配置",
|
||||||
Lists.newArrayList("ONE_PASS_SELF_CONSISTENCY"));
|
Lists.newArrayList("ONE_PASS_SELF_CONSISTENCY"));
|
||||||
|
|
||||||
|
public static final Parameter PARSER_RULE_CORRECTOR_ENABLE =
|
||||||
|
new Parameter("s2.parser.rule.corrector.enable", "false", "是否开启规则修正器",
|
||||||
|
"规则修正器灵活度有限,在大模型能力足够情况下,不必强制做规则修正", "bool", "语义解析配置");
|
||||||
|
|
||||||
public static final Parameter PARSER_LINKING_VALUE_ENABLE =
|
public static final Parameter PARSER_LINKING_VALUE_ENABLE =
|
||||||
new Parameter("s2.parser.linking.value.enable", "true", "是否将Mapper探测识别到的维度值提供给大模型",
|
new Parameter("s2.parser.linking.value.enable", "true", "是否将Mapper探测识别到的维度值提供给大模型",
|
||||||
"为了数据安全考虑, 这里可进行开关选择", "bool", "语义解析配置");
|
"为了数据安全考虑, 这里可进行开关选择", "bool", "语义解析配置");
|
||||||
@@ -55,7 +59,7 @@ public class ParserConfig extends ParameterConfig {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Parameter> getSysParameters() {
|
public List<Parameter> getSysParameters() {
|
||||||
return Lists.newArrayList(PARSER_LINKING_VALUE_ENABLE, PARSER_FEW_SHOT_NUMBER,
|
return Lists.newArrayList(PARSER_LINKING_VALUE_ENABLE, PARSER_RULE_CORRECTOR_ENABLE, PARSER_FEW_SHOT_NUMBER,
|
||||||
PARSER_SELF_CONSISTENCY_NUMBER, PARSER_SHOW_COUNT, PARSER_FIELDS_COUNT_THRESHOLD);
|
PARSER_SELF_CONSISTENCY_NUMBER, PARSER_SHOW_COUNT, PARSER_FIELDS_COUNT_THRESHOLD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ public class DimValueAspect {
|
|||||||
List<String> values = JsonUtil.toList(fieldValue, String.class);
|
List<String> values = JsonUtil.toList(fieldValue, String.class);
|
||||||
List<String> revisedValues = new ArrayList<>();
|
List<String> revisedValues = new ArrayList<>();
|
||||||
for (int i = 0; i < values.size(); i++) {
|
for (int i = 0; i < values.size(); i++) {
|
||||||
Boolean flag = new Boolean(false);
|
Boolean flag = false;
|
||||||
for (DimValueMap dimValueMap : dimension.getDimValueMaps()) {
|
for (DimValueMap dimValueMap : dimension.getDimValueMaps()) {
|
||||||
if (!CollectionUtils.isEmpty(dimValueMap.getAlias())
|
if (!CollectionUtils.isEmpty(dimValueMap.getAlias())
|
||||||
&& dimValueMap.getAlias().contains(values.get(i))) {
|
&& dimValueMap.getAlias().contains(values.get(i))) {
|
||||||
|
|||||||
@@ -426,6 +426,9 @@ public class DimensionServiceImpl extends ServiceImpl<DimensionDOMapper, Dimensi
|
|||||||
dimValueMapList = JsonUtil.toList(dimensionDO.getDimValueMaps(), DimValueMap.class);
|
dimValueMapList = JsonUtil.toList(dimensionDO.getDimValueMaps(), DimValueMap.class);
|
||||||
}
|
}
|
||||||
DimValueMap dimValueMaps = req.getDimValueMaps();
|
DimValueMap dimValueMaps = req.getDimValueMaps();
|
||||||
|
if (StringUtils.isEmpty(dimValueMaps.getTechName())) {
|
||||||
|
dimValueMaps.setTechName(dimValueMaps.getValue());
|
||||||
|
}
|
||||||
Map<String, DimValueMap> valeAndMapInfo = dimValueMapList.stream()
|
Map<String, DimValueMap> valeAndMapInfo = dimValueMapList.stream()
|
||||||
.collect(Collectors.toMap(DimValueMap::getValue, v -> v, (v1, v2) -> v2));
|
.collect(Collectors.toMap(DimValueMap::getValue, v -> v, (v1, v2) -> v2));
|
||||||
String value = dimValueMaps.getValue();
|
String value = dimValueMaps.getValue();
|
||||||
|
|||||||
@@ -418,3 +418,6 @@ ALTER TABLE s2_model_rela alter column join_condition type text;
|
|||||||
--20250310
|
--20250310
|
||||||
ALTER TABLE s2_chat_model add column is_open tinyint DEFAULT NULL COMMENT '是否公开';
|
ALTER TABLE s2_chat_model add column is_open tinyint DEFAULT NULL COMMENT '是否公开';
|
||||||
ALTER TABLE s2_database add column is_open tinyint DEFAULT NULL COMMENT '是否公开';
|
ALTER TABLE s2_database add column is_open tinyint DEFAULT NULL COMMENT '是否公开';
|
||||||
|
|
||||||
|
--20250321
|
||||||
|
ALTER TABLE s2_user add column last_loin datetime DEFAULT NULL;
|
||||||
@@ -129,6 +129,7 @@ create table IF NOT EXISTS s2_user
|
|||||||
salt varchar(256) NULL,
|
salt varchar(256) NULL,
|
||||||
email varchar(100) null,
|
email varchar(100) null,
|
||||||
is_admin INT null,
|
is_admin INT null,
|
||||||
|
last_login TIMESTAMP NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
);
|
);
|
||||||
COMMENT ON TABLE s2_user IS 'user information table';
|
COMMENT ON TABLE s2_user IS 'user information table';
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
CREATE TABLE IF NOT EXISTS `s2_agent` (
|
CREATE TABLE IF NOT EXISTS `s2_agent` (
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
|
`name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`description` TEXT COLLATE utf8_unicode_ci DEFAULT NULL,
|
`description` TEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`examples` TEXT COLLATE utf8_unicode_ci DEFAULT NULL,
|
`examples` TEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`status` tinyint DEFAULT NULL,
|
`status` tinyint DEFAULT NULL,
|
||||||
`model` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
|
`model` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`tool_config` TEXT COLLATE utf8_unicode_ci DEFAULT NULL,
|
`tool_config` TEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`llm_config` TEXT COLLATE utf8_unicode_ci DEFAULT NULL,
|
`llm_config` TEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`chat_model_config` text COLLATE utf8_unicode_ci DEFAULT NULL,
|
`chat_model_config` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`visual_config` TEXT COLLATE utf8_unicode_ci DEFAULT NULL,
|
`visual_config` TEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`enable_search` tinyint DEFAULT 1,
|
`enable_search` tinyint DEFAULT 1,
|
||||||
`enable_feedback` tinyint DEFAULT 1,
|
`enable_feedback` tinyint DEFAULT 1,
|
||||||
`created_by` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
|
`created_by` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`created_at` datetime DEFAULT NULL,
|
`created_at` datetime DEFAULT NULL,
|
||||||
`updated_by` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
|
`updated_by` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`updated_at` datetime DEFAULT NULL,
|
`updated_at` datetime DEFAULT NULL,
|
||||||
`admin` varchar(1000) DEFAULT NULL COMMENT '管理员',
|
`admin` varchar(1000) DEFAULT NULL COMMENT '管理员',
|
||||||
`admin_org` varchar(1000) DEFAULT NULL COMMENT '管理员组织',
|
`admin_org` varchar(1000) DEFAULT NULL COMMENT '管理员组织',
|
||||||
@@ -21,7 +21,7 @@ CREATE TABLE IF NOT EXISTS `s2_agent` (
|
|||||||
`viewer` varchar(1000) DEFAULT NULL COMMENT '可用用户',
|
`viewer` varchar(1000) DEFAULT NULL COMMENT '可用用户',
|
||||||
`view_org` varchar(1000) DEFAULT NULL COMMENT '可用组织',
|
`view_org` varchar(1000) DEFAULT NULL COMMENT '可用组织',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_auth_groups` (
|
CREATE TABLE IF NOT EXISTS `s2_auth_groups` (
|
||||||
`group_id` int(11) NOT NULL,
|
`group_id` int(11) NOT NULL,
|
||||||
@@ -60,7 +60,7 @@ CREATE TABLE IF NOT EXISTS `s2_chat` (
|
|||||||
`is_delete` tinyint DEFAULT '0' COMMENT 'is deleted',
|
`is_delete` tinyint DEFAULT '0' COMMENT 'is deleted',
|
||||||
`is_top` tinyint DEFAULT '0' COMMENT 'is top',
|
`is_top` tinyint DEFAULT '0' COMMENT 'is top',
|
||||||
PRIMARY KEY (`chat_id`)
|
PRIMARY KEY (`chat_id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_chat_config` (
|
CREATE TABLE IF NOT EXISTS `s2_chat_config` (
|
||||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
@@ -75,7 +75,7 @@ CREATE TABLE IF NOT EXISTS `s2_chat_config` (
|
|||||||
`status` tinyint NOT NULL COMMENT '主题域扩展信息状态, 0-删除,1-生效',
|
`status` tinyint NOT NULL COMMENT '主题域扩展信息状态, 0-删除,1-生效',
|
||||||
`llm_examples` text COMMENT 'llm examples',
|
`llm_examples` text COMMENT 'llm examples',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='主题域扩展信息表';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='主题域扩展信息表';
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_chat_memory` (
|
CREATE TABLE IF NOT EXISTS `s2_chat_memory` (
|
||||||
`id` INT NOT NULL AUTO_INCREMENT,
|
`id` INT NOT NULL AUTO_INCREMENT,
|
||||||
@@ -95,7 +95,7 @@ CREATE TABLE IF NOT EXISTS `s2_chat_memory` (
|
|||||||
`created_by` varchar(100) DEFAULT NULL ,
|
`created_by` varchar(100) DEFAULT NULL ,
|
||||||
`updated_by` varchar(100) DEFAULT NULL ,
|
`updated_by` varchar(100) DEFAULT NULL ,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_chat_context` (
|
CREATE TABLE IF NOT EXISTS `s2_chat_context` (
|
||||||
`chat_id` bigint(20) NOT NULL COMMENT 'context chat id',
|
`chat_id` bigint(20) NOT NULL COMMENT 'context chat id',
|
||||||
@@ -105,7 +105,7 @@ CREATE TABLE IF NOT EXISTS `s2_chat_context` (
|
|||||||
`semantic_parse` text COMMENT 'parse data',
|
`semantic_parse` text COMMENT 'parse data',
|
||||||
`ext_data` text COMMENT 'extend data',
|
`ext_data` text COMMENT 'extend data',
|
||||||
PRIMARY KEY (`chat_id`)
|
PRIMARY KEY (`chat_id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_chat_parse` (
|
CREATE TABLE IF NOT EXISTS `s2_chat_parse` (
|
||||||
`question_id` bigint NOT NULL,
|
`question_id` bigint NOT NULL,
|
||||||
@@ -117,7 +117,7 @@ CREATE TABLE IF NOT EXISTS `s2_chat_parse` (
|
|||||||
`parse_info` mediumtext NOT NULL,
|
`parse_info` mediumtext NOT NULL,
|
||||||
`is_candidate` int(11) DEFAULT '1' COMMENT '1是candidate,0是selected',
|
`is_candidate` int(11) DEFAULT '1' COMMENT '1是candidate,0是selected',
|
||||||
KEY `commonIndex` (`question_id`)
|
KEY `commonIndex` (`question_id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_chat_query`
|
CREATE TABLE IF NOT EXISTS `s2_chat_query`
|
||||||
@@ -135,7 +135,7 @@ CREATE TABLE IF NOT EXISTS `s2_chat_query`
|
|||||||
`similar_queries` varchar(1024) DEFAULT '',
|
`similar_queries` varchar(1024) DEFAULT '',
|
||||||
`parse_time_cost` varchar(1024) DEFAULT '',
|
`parse_time_cost` varchar(1024) DEFAULT '',
|
||||||
PRIMARY KEY (`question_id`)
|
PRIMARY KEY (`question_id`)
|
||||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8;
|
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_chat_statistics` (
|
CREATE TABLE IF NOT EXISTS `s2_chat_statistics` (
|
||||||
@@ -148,7 +148,7 @@ CREATE TABLE IF NOT EXISTS `s2_chat_statistics` (
|
|||||||
`type` int(11) DEFAULT NULL,
|
`type` int(11) DEFAULT NULL,
|
||||||
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
KEY `commonIndex` (`question_id`)
|
KEY `commonIndex` (`question_id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_chat_model` (
|
CREATE TABLE IF NOT EXISTS `s2_chat_model` (
|
||||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
@@ -163,7 +163,7 @@ CREATE TABLE IF NOT EXISTS `s2_chat_model` (
|
|||||||
`viewer` varchar(500) DEFAULT NULL,
|
`viewer` varchar(500) DEFAULT NULL,
|
||||||
`is_open` tinyint DEFAULT NULL COMMENT '是否公开',
|
`is_open` tinyint DEFAULT NULL COMMENT '是否公开',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='对话大模型实例表';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='对话大模型实例表';
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_database` (
|
CREATE TABLE IF NOT EXISTS `s2_database` (
|
||||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
@@ -180,7 +180,7 @@ CREATE TABLE IF NOT EXISTS `s2_database` (
|
|||||||
`viewer` varchar(500) DEFAULT NULL,
|
`viewer` varchar(500) DEFAULT NULL,
|
||||||
`is_open` tinyint DEFAULT NULL COMMENT '是否公开',
|
`is_open` tinyint DEFAULT NULL COMMENT '是否公开',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='数据库实例表';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='数据库实例表';
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_dictionary_conf` (
|
CREATE TABLE IF NOT EXISTS `s2_dictionary_conf` (
|
||||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
@@ -192,7 +192,7 @@ CREATE TABLE IF NOT EXISTS `s2_dictionary_conf` (
|
|||||||
`created_at` datetime NOT NULL COMMENT '创建时间' ,
|
`created_at` datetime NOT NULL COMMENT '创建时间' ,
|
||||||
`created_by` varchar(100) NOT NULL ,
|
`created_by` varchar(100) NOT NULL ,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典配置信息表';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='字典配置信息表';
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_dictionary_task` (
|
CREATE TABLE IF NOT EXISTS `s2_dictionary_task` (
|
||||||
@@ -207,7 +207,7 @@ CREATE TABLE IF NOT EXISTS `s2_dictionary_task` (
|
|||||||
`created_by` varchar(100) NOT NULL ,
|
`created_by` varchar(100) NOT NULL ,
|
||||||
`elapsed_ms` int(10) DEFAULT NULL ,
|
`elapsed_ms` int(10) DEFAULT NULL ,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典运行任务表';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='字典运行任务表';
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_dimension` (
|
CREATE TABLE IF NOT EXISTS `s2_dimension` (
|
||||||
@@ -227,13 +227,13 @@ CREATE TABLE IF NOT EXISTS `s2_dimension` (
|
|||||||
`updated_at` datetime NOT NULL COMMENT '更新时间',
|
`updated_at` datetime NOT NULL COMMENT '更新时间',
|
||||||
`updated_by` varchar(100) NOT NULL COMMENT '更新人',
|
`updated_by` varchar(100) NOT NULL COMMENT '更新人',
|
||||||
`semantic_type` varchar(20) NOT NULL COMMENT '语义类型DATE, ID, CATEGORY',
|
`semantic_type` varchar(20) NOT NULL COMMENT '语义类型DATE, ID, CATEGORY',
|
||||||
`alias` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
|
`alias` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`default_values` varchar(500) DEFAULT NULL,
|
`default_values` varchar(500) DEFAULT NULL,
|
||||||
`dim_value_maps` varchar(5000) DEFAULT NULL,
|
`dim_value_maps` varchar(5000) DEFAULT NULL,
|
||||||
`is_tag` tinyint DEFAULT NULL,
|
`is_tag` tinyint DEFAULT NULL,
|
||||||
`ext` varchar(1000) DEFAULT NULL,
|
`ext` varchar(1000) DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='维度表';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='维度表';
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_domain` (
|
CREATE TABLE IF NOT EXISTS `s2_domain` (
|
||||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
|
||||||
@@ -252,7 +252,7 @@ CREATE TABLE IF NOT EXISTS `s2_domain` (
|
|||||||
`view_org` varchar(3000) DEFAULT NULL COMMENT '主题域可用组织',
|
`view_org` varchar(3000) DEFAULT NULL COMMENT '主题域可用组织',
|
||||||
`entity` varchar(500) DEFAULT NULL COMMENT '主题域实体信息',
|
`entity` varchar(500) DEFAULT NULL COMMENT '主题域实体信息',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='主题域基础信息表';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='主题域基础信息表';
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_metric`
|
CREATE TABLE IF NOT EXISTS `s2_metric`
|
||||||
@@ -272,35 +272,35 @@ CREATE TABLE IF NOT EXISTS `s2_metric`
|
|||||||
`updated_by` varchar(100) NOT NULL COMMENT '更新人',
|
`updated_by` varchar(100) NOT NULL COMMENT '更新人',
|
||||||
`data_format_type` varchar(50) DEFAULT NULL COMMENT '数值类型',
|
`data_format_type` varchar(50) DEFAULT NULL COMMENT '数值类型',
|
||||||
`data_format` varchar(500) DEFAULT NULL COMMENT '数值类型参数',
|
`data_format` varchar(500) DEFAULT NULL COMMENT '数值类型参数',
|
||||||
`alias` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
|
`alias` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`classifications` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
|
`classifications` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`relate_dimensions` varchar(500) DEFAULT NULL COMMENT '指标相关维度',
|
`relate_dimensions` varchar(500) DEFAULT NULL COMMENT '指标相关维度',
|
||||||
`ext` text DEFAULT NULL,
|
`ext` text DEFAULT NULL,
|
||||||
`define_type` varchar(50) DEFAULT NULL, -- MEASURE, FIELD, METRIC
|
`define_type` varchar(50) DEFAULT NULL, -- MEASURE, FIELD, METRIC
|
||||||
`is_publish` tinyint DEFAULT NULL COMMENT '是否发布',
|
`is_publish` tinyint DEFAULT NULL COMMENT '是否发布',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE = InnoDB
|
) ENGINE = InnoDB
|
||||||
DEFAULT CHARSET = utf8 COMMENT ='指标表';
|
DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT ='指标表';
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_model` (
|
CREATE TABLE IF NOT EXISTS `s2_model` (
|
||||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
`name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
|
`name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`biz_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
|
`biz_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`domain_id` bigint(20) DEFAULT NULL,
|
`domain_id` bigint(20) DEFAULT NULL,
|
||||||
`alias` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
|
`alias` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`status` tinyint DEFAULT NULL,
|
`status` tinyint DEFAULT NULL,
|
||||||
`description` varchar(500) DEFAULT NULL,
|
`description` varchar(500) DEFAULT NULL,
|
||||||
`viewer` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
|
`viewer` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`view_org` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
|
`view_org` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`admin` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
|
`admin` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`admin_org` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
|
`admin_org` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`is_open` tinyint DEFAULT NULL,
|
`is_open` tinyint DEFAULT NULL,
|
||||||
`created_by` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
|
`created_by` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`created_at` datetime DEFAULT NULL,
|
`created_at` datetime DEFAULT NULL,
|
||||||
`updated_by` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
|
`updated_by` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`updated_at` datetime DEFAULT NULL,
|
`updated_at` datetime DEFAULT NULL,
|
||||||
`entity` text COLLATE utf8_unicode_ci,
|
`entity` text COLLATE utf8mb4_unicode_ci,
|
||||||
`drill_down_dimensions` TEXT DEFAULT NULL,
|
`drill_down_dimensions` TEXT DEFAULT NULL,
|
||||||
`database_id` INT NOT NULL ,
|
`database_id` INT NOT NULL ,
|
||||||
`model_detail` text NOT NULL ,
|
`model_detail` text NOT NULL ,
|
||||||
@@ -310,24 +310,24 @@ CREATE TABLE IF NOT EXISTS `s2_model` (
|
|||||||
`tag_object_id` int(11) DEFAULT '0',
|
`tag_object_id` int(11) DEFAULT '0',
|
||||||
`ext` varchar(1000) DEFAULT NULL,
|
`ext` varchar(1000) DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_plugin` (
|
CREATE TABLE IF NOT EXISTS `s2_plugin` (
|
||||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
`type` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'DASHBOARD,WIDGET,URL',
|
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'DASHBOARD,WIDGET,URL',
|
||||||
`data_set` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
`data_set` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`pattern` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
|
`pattern` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`parse_mode` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
`parse_mode` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`parse_mode_config` text COLLATE utf8mb4_unicode_ci,
|
`parse_mode_config` text COLLATE utf8mb4_unicode_ci,
|
||||||
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
|
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`created_at` datetime DEFAULT NULL,
|
`created_at` datetime DEFAULT NULL,
|
||||||
`created_by` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
|
`created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`updated_at` datetime DEFAULT NULL,
|
`updated_at` datetime DEFAULT NULL,
|
||||||
`updated_by` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
|
`updated_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
`config` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
|
`config` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
|
||||||
`comment` text COLLATE utf8mb4_unicode_ci,
|
`comment` text COLLATE utf8mb4_unicode_ci,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_query_stat_info` (
|
CREATE TABLE IF NOT EXISTS `s2_query_stat_info` (
|
||||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
@@ -377,7 +377,7 @@ CREATE TABLE IF NOT EXISTS `s2_canvas`
|
|||||||
`updated_at` datetime DEFAULT NULL,
|
`updated_at` datetime DEFAULT NULL,
|
||||||
`updated_by` varchar(100) NOT NULL,
|
`updated_by` varchar(100) NOT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8;
|
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS s2_user
|
CREATE TABLE IF NOT EXISTS s2_user
|
||||||
(
|
(
|
||||||
@@ -388,9 +388,10 @@ CREATE TABLE IF NOT EXISTS s2_user
|
|||||||
salt varchar(256) DEFAULT NULL COMMENT 'md5密码盐',
|
salt varchar(256) DEFAULT NULL COMMENT 'md5密码盐',
|
||||||
email varchar(100) null,
|
email varchar(100) null,
|
||||||
is_admin tinyint null,
|
is_admin tinyint null,
|
||||||
|
last_login datetime DEFAULT NULL,
|
||||||
UNIQUE (`name`),
|
UNIQUE (`name`),
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
);
|
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS s2_system_config
|
CREATE TABLE IF NOT EXISTS s2_system_config
|
||||||
(
|
(
|
||||||
@@ -493,7 +494,7 @@ CREATE TABLE IF NOT EXISTS `s2_tag_object`
|
|||||||
`ext` text DEFAULT NULL,
|
`ext` text DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE = InnoDB
|
) ENGINE = InnoDB
|
||||||
DEFAULT CHARSET = utf8 COMMENT ='标签对象表';
|
DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT ='标签对象表';
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_query_rule` (
|
CREATE TABLE IF NOT EXISTS `s2_query_rule` (
|
||||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
@@ -512,7 +513,7 @@ CREATE TABLE IF NOT EXISTS `s2_query_rule` (
|
|||||||
`updated_by` varchar(100) DEFAULT NULL ,
|
`updated_by` varchar(100) DEFAULT NULL ,
|
||||||
`ext` text DEFAULT NULL ,
|
`ext` text DEFAULT NULL ,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COMMENT ='查询规则表';
|
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT ='查询规则表';
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_term` (
|
CREATE TABLE IF NOT EXISTS `s2_term` (
|
||||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
@@ -527,7 +528,7 @@ CREATE TABLE IF NOT EXISTS `s2_term` (
|
|||||||
`updated_at` datetime DEFAULT NULL ,
|
`updated_at` datetime DEFAULT NULL ,
|
||||||
`updated_by` varchar(100) DEFAULT NULL ,
|
`updated_by` varchar(100) DEFAULT NULL ,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COMMENT ='术语表';
|
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT ='术语表';
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `s2_user_token` (
|
CREATE TABLE IF NOT EXISTS `s2_user_token` (
|
||||||
`id` bigint NOT NULL AUTO_INCREMENT,
|
`id` bigint NOT NULL AUTO_INCREMENT,
|
||||||
@@ -543,4 +544,4 @@ CREATE TABLE IF NOT EXISTS `s2_user_token` (
|
|||||||
`expire_date_time` DATETIME NOT NULL,
|
`expire_date_time` DATETIME NOT NULL,
|
||||||
unique key name_username (`name`, `user_name`),
|
unique key name_username (`name`, `user_name`),
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin comment='用户令牌信息表';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci comment='用户令牌信息表';
|
||||||
|
|||||||
@@ -498,5 +498,6 @@ CREATE TABLE IF NOT EXISTS s2_user (
|
|||||||
salt varchar(256) DEFAULT NULL,
|
salt varchar(256) DEFAULT NULL,
|
||||||
email varchar(100) NULL,
|
email varchar(100) NULL,
|
||||||
is_admin smallint NULL,
|
is_admin smallint NULL,
|
||||||
|
last_login timestamp NULL,
|
||||||
UNIQUE(name)
|
UNIQUE(name)
|
||||||
);
|
);
|
||||||
Reference in New Issue
Block a user