Unverified Commit 8dc2431e authored by ZackYoung's avatar ZackYoung Committed by GitHub

fix_h2_init (#2511)

parent 4cad347b
......@@ -39,10 +39,9 @@ import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
......@@ -55,8 +54,7 @@ import cn.hutool.core.util.StrUtil;
*
* @since 2022/2/2 22:22
*/
@ControllerAdvice
@ResponseBody
@RestControllerAdvice
public class WebExceptionHandler {
private static final Logger logger = LoggerFactory.getLogger(WebExceptionHandler.class);
......
......@@ -72,37 +72,6 @@ public class AppConfig implements WebMvcConfigurer {
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(localeChangeInterceptor());
// 注册Sa-Token的路由拦截器
// registry.addInterceptor(new SaInterceptor(handle -> {
// // 根据路由划分模块,不同模块不同鉴权
// SaRouter.match("/api/alertGroup/**", r ->
// StpUtil.checkPermission("alertGroup"));
// SaRouter.match("/api/alertHistory/**", r ->
// StpUtil.checkPermission("alertHistory"));
// SaRouter.match("/api/alertInstance/**", r ->
// StpUtil.checkPermission("alertInstance"));
// SaRouter.match("/api/catalogue/**", r ->
// StpUtil.checkPermission("catalogue"));
// SaRouter.match("/api/clusterConfiguration/**", r ->
// StpUtil.checkPermission("clusterConfiguration"));
// SaRouter.match("/api/cluster/**", r ->
// StpUtil.checkPermission("clusterInstance"));
// SaRouter.match("/api/database/**", r ->
// StpUtil.checkPermission("database"));
// SaRouter.match("/api/document/**", r ->
// StpUtil.checkPermission("document"));
// SaRouter.match("/api/fragment/**", r ->
// StpUtil.checkPermission("fragment"));
// SaRouter.match("/api/git/**", r -> StpUtil.checkPermission("git"));
// SaRouter.match("/api/history/**", r ->
// StpUtil.checkPermission("history"));
//
// }))
// .addPathPatterns("/api/**")
// .excludePathPatterns("/api/login")
// .excludePathPatterns("/druid/**")
// .excludePathPatterns("/openapi/**");
registry.addInterceptor(new SaInterceptor(handler -> StpUtil.checkLogin()))
.addPathPatterns("/api/**")
.excludePathPatterns(
......
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.jdbc.datasource.init;
import java.sql.Connection;
import javax.sql.DataSource;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.datasource.DataSourceUtils;
import org.springframework.util.Assert;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.db.Db;
/**
* Utility methods for executing a {@link DatabasePopulator}.
*
* @author Juergen Hoeller
* @author Oliver Gierke
* @author Sam Brannen
* @since 3.1
*/
public abstract class DatabasePopulatorUtils {
private static boolean isInit = true;
/**
* Execute the given {@link DatabasePopulator} against the given {@link DataSource}.
* <p>As of Spring Framework 5.3.11, the {@link Connection} for the supplied
* {@code DataSource} will be {@linkplain Connection#commit() committed} if
* it is not configured for {@link Connection#getAutoCommit() auto-commit} and
* is not {@linkplain DataSourceUtils#isConnectionTransactional transactional}.
*
* @param populator the {@code DatabasePopulator} to execute
* @param dataSource the {@code DataSource} to execute against
* @throws DataAccessException if an error occurs, specifically a {@link ScriptException}
* @see DataSourceUtils#isConnectionTransactional(Connection, DataSource)
*/
public static void execute(DatabasePopulator populator, DataSource dataSource) throws DataAccessException {
Assert.notNull(populator, "DatabasePopulator must not be null");
Assert.notNull(dataSource, "DataSource must not be null");
try {
// Override this method and do not run it if the table exists(重写此方法,如果有表存在,则不运行)
if (isInit && CollUtil.isNotEmpty(Db.use(dataSource).query("show tables"))) {
return;
}
isInit = false;
Connection connection = DataSourceUtils.getConnection(dataSource);
try {
populator.populate(connection);
if (!connection.getAutoCommit() && !DataSourceUtils.isConnectionTransactional(connection, dataSource)) {
connection.commit();
}
} finally {
DataSourceUtils.releaseConnection(connection, dataSource);
}
} catch (ScriptException ex) {
throw ex;
} catch (Throwable ex) {
throw new UncategorizedScriptException("Failed to execute database script", ex);
}
}
}
......@@ -31,5 +31,5 @@ spring:
sql:
init:
schema-locations: classpath:db/db-h2-ddl.sql
mode: always
data-locations: classpath:db/db-h2-dml.sql
\ No newline at end of file
data-locations: classpath:db/db-h2-dml.sql
mode: always
\ No newline at end of file
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `dinky_alert_group`;
CREATE TABLE `dinky_alert_group` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'id',
`name` varchar(50) NOT null COMMENT 'alert group name',
......@@ -12,7 +12,7 @@ CREATE TABLE `dinky_alert_group` (
`create_time` datetime(0) null DEFAULT null COMMENT 'create time',
`update_time` datetime(0) null DEFAULT null COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_alert_history`;
CREATE TABLE `dinky_alert_history` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'id',
`tenant_id` int(11) NOT null DEFAULT 1 COMMENT 'tenant id',
......@@ -25,7 +25,7 @@ CREATE TABLE `dinky_alert_history` (
`create_time` datetime(0) null DEFAULT null COMMENT 'create time',
`update_time` datetime(0) null DEFAULT null COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_alert_instance`;
CREATE TABLE `dinky_alert_instance` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'id',
`name` varchar(50) NOT null COMMENT 'alert instance name',
......@@ -36,7 +36,7 @@ CREATE TABLE `dinky_alert_instance` (
`create_time` datetime(0) null DEFAULT null COMMENT 'create time',
`update_time` datetime(0) null DEFAULT null COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_catalogue`;
CREATE TABLE `dinky_catalogue` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'ID',
`tenant_id` int(11) NOT null DEFAULT 1 COMMENT 'tenant id',
......@@ -49,7 +49,7 @@ CREATE TABLE `dinky_catalogue` (
`create_time` datetime(0) null DEFAULT null COMMENT 'create time',
`update_time` datetime(0) null DEFAULT null COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_cluster`;
CREATE TABLE `dinky_cluster` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'ID',
`tenant_id` int(11) NOT null DEFAULT 1 COMMENT 'tenant id',
......@@ -68,7 +68,7 @@ CREATE TABLE `dinky_cluster` (
`create_time` datetime(0) null DEFAULT null COMMENT 'create time',
`update_time` datetime(0) null DEFAULT null COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_cluster_configuration`;
CREATE TABLE `dinky_cluster_configuration` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'ID',
`tenant_id` int(11) NOT null DEFAULT 1 COMMENT 'tenant id',
......@@ -81,7 +81,7 @@ CREATE TABLE `dinky_cluster_configuration` (
`create_time` datetime(0) null DEFAULT null COMMENT 'create time',
`update_time` datetime(0) null DEFAULT null COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_database`;
CREATE TABLE `dinky_database` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'ID',
`tenant_id` int(11) NOT null DEFAULT 1 COMMENT 'tenant id',
......@@ -104,7 +104,7 @@ CREATE TABLE `dinky_database` (
`create_time` datetime(0) null DEFAULT null COMMENT 'create time',
`update_time` datetime(0) null DEFAULT null COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_flink_document`;
CREATE TABLE `dinky_flink_document` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'id',
`category` varchar(255) null DEFAULT null COMMENT 'document category',
......@@ -120,7 +120,7 @@ CREATE TABLE `dinky_flink_document` (
`update_time` datetime(0) null DEFAULT null COMMENT 'update_time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_fragment`;
CREATE TABLE `dinky_fragment` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'id',
`name` varchar(50) NOT null COMMENT 'fragment name',
......@@ -131,7 +131,7 @@ CREATE TABLE `dinky_fragment` (
`create_time` datetime(0) null DEFAULT null COMMENT 'create time',
`update_time` datetime(0) null DEFAULT null COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_history`;
CREATE TABLE `dinky_history` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'ID',
`tenant_id` int(11) NOT null DEFAULT 1 COMMENT 'tenant id',
......@@ -154,7 +154,7 @@ CREATE TABLE `dinky_history` (
INDEX cluster_index2(`cluster_id`)
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_job_history`;
CREATE TABLE `dinky_job_history` (
`id` int(11) NOT null COMMENT 'id',
`tenant_id` int(11) NOT null DEFAULT 1 COMMENT 'tenant id',
......@@ -167,7 +167,7 @@ CREATE TABLE `dinky_job_history` (
`cluster_configuration_json` json null COMMENT 'cluster config',
`update_time` datetime(0) null DEFAULT null COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_job_instance`;
CREATE TABLE `dinky_job_instance` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'id',
`name` varchar(255) null DEFAULT null COMMENT 'job instance name',
......@@ -187,7 +187,7 @@ CREATE TABLE `dinky_job_instance` (
INDEX job_instance_task_id_idx13(`task_id`)
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_role`;
CREATE TABLE `dinky_role` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'ID',
`tenant_id` int(11) NOT null COMMENT 'tenant id',
......@@ -200,7 +200,7 @@ CREATE TABLE `dinky_role` (
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_savepoints`;
CREATE TABLE `dinky_savepoints` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'ID',
`task_id` int(11) NOT null COMMENT 'task ID',
......@@ -211,7 +211,7 @@ CREATE TABLE `dinky_savepoints` (
`create_time` datetime(0) null DEFAULT null COMMENT 'create time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_sys_config`;
CREATE TABLE `dinky_sys_config` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'ID',
`name` varchar(255) NOT null COMMENT 'configuration name',
......@@ -219,7 +219,7 @@ CREATE TABLE `dinky_sys_config` (
`create_time` datetime(0) null DEFAULT null COMMENT 'create time',
`update_time` datetime(0) null DEFAULT null COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_task`;
CREATE TABLE `dinky_task` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'ID',
`name` varchar(255) NOT null COMMENT 'Job name',
......@@ -249,7 +249,7 @@ CREATE TABLE `dinky_task` (
`statement` text null DEFAULT null COMMENT 'statement'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_task_version`;
CREATE TABLE `dinky_task_version` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'ID',
`task_id` int(11) NOT null COMMENT 'task ID ',
......@@ -262,7 +262,7 @@ CREATE TABLE `dinky_task_version` (
`task_configure` text NOT null COMMENT 'task configuration',
`create_time` datetime(0) null DEFAULT null COMMENT 'create time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_tenant`;
CREATE TABLE `dinky_tenant` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'ID',
`tenant_code` varchar(64) NOT null COMMENT 'tenant code',
......@@ -272,7 +272,7 @@ CREATE TABLE `dinky_tenant` (
`update_time` datetime(0) null DEFAULT null COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_udf`;
CREATE TABLE `dinky_udf` (
`id` int(11) NOT null AUTO_INCREMENT,
`name` varchar(200) null DEFAULT null COMMENT 'udf name',
......@@ -292,7 +292,7 @@ CREATE TABLE `dinky_udf` (
`create_time` datetime(0) null DEFAULT null COMMENT 'create time',
`update_time` datetime DEFAULT null ON UPDATE CURRENT_TIMESTAMP COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_udf_template`;
CREATE TABLE `dinky_udf_template` (
`id` int(11) NOT null AUTO_INCREMENT,
`name` varchar(100) null DEFAULT null COMMENT 'template name',
......@@ -305,7 +305,7 @@ CREATE TABLE `dinky_udf_template` (
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_user`;
CREATE TABLE `dinky_user` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'ID',
`username` varchar(50) NOT null COMMENT 'username',
......@@ -322,7 +322,7 @@ CREATE TABLE `dinky_user` (
`update_time` datetime(0) null DEFAULT null COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_user_role`;
CREATE TABLE `dinky_user_role` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'ID',
`user_id` int(11) NOT null COMMENT 'user id',
......@@ -331,7 +331,7 @@ CREATE TABLE `dinky_user_role` (
`update_time` datetime(0) null DEFAULT null COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `dinky_user_tenant`;
CREATE TABLE `dinky_user_tenant` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'ID',
`user_id` int(11) NOT null COMMENT 'user id',
......@@ -341,7 +341,7 @@ CREATE TABLE `dinky_user_tenant` (
`update_time` datetime(0) null DEFAULT null COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `metadata_column`;
CREATE TABLE `metadata_column` (
`column_name` varchar(255) NOT null COMMENT 'column name',
`column_type` varchar(255) NOT null COMMENT 'column type, such as : Physical , Metadata , Computed , WATERMARK',
......@@ -353,7 +353,7 @@ CREATE TABLE `metadata_column` (
`update_time` datetime(0) null DEFAULT null COMMENT 'update time',
`create_time` datetime(0) NOT null DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'create time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `metadata_database`;
CREATE TABLE `metadata_database` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'id',
`database_name` varchar(255) NOT null COMMENT 'database name',
......@@ -361,7 +361,7 @@ CREATE TABLE `metadata_database` (
`update_time` datetime(0) null DEFAULT null COMMENT 'update time',
`create_time` datetime(0) null DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'create time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `metadata_database_property`;
CREATE TABLE `metadata_database_property` (
`key` varchar(255) NOT null COMMENT 'key',
`value` varchar(255) null DEFAULT null COMMENT 'value',
......@@ -369,7 +369,7 @@ CREATE TABLE `metadata_database_property` (
`update_time` datetime(0) null DEFAULT null COMMENT 'update time',
`create_time` datetime(0) NOT null DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'create time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `metadata_function`;
CREATE TABLE `metadata_function` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT '主键',
`function_name` varchar(255) NOT null COMMENT 'function name',
......@@ -379,7 +379,7 @@ CREATE TABLE `metadata_function` (
`update_time` datetime(0) null DEFAULT null COMMENT 'update time',
`create_time` datetime(0) null DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'create time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `metadata_table`;
CREATE TABLE `metadata_table` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT '主键',
`table_name` varchar(255) NOT null COMMENT 'table name',
......@@ -389,7 +389,7 @@ CREATE TABLE `metadata_table` (
`update_time` datetime(0) null DEFAULT null COMMENT 'update time',
`create_time` datetime(0) null DEFAULT CURRENT_TIMESTAMP(0) COMMENT 'create time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `metadata_table_property`;
CREATE TABLE `metadata_table_property` (
`key` varchar(255) NOT null COMMENT 'key',
`value` mediumtext null COMMENT 'value',
......@@ -403,7 +403,7 @@ CREATE TABLE `metadata_table_property` (
-- ----------------------------
-- Table structure for dinky_row_permissions
-- ----------------------------
DROP TABLE IF EXISTS `dinky_row_permissions`;
CREATE TABLE dinky_row_permissions (
id int PRIMARY KEY AUTO_INCREMENT COMMENT 'ID',
role_id int NOT null COMMENT '角色ID',
......@@ -413,7 +413,7 @@ CREATE TABLE dinky_row_permissions (
update_time datetime null COMMENT '更新时间'
);
SET FOREIGN_KEY_CHECKS = 1;
DROP TABLE IF EXISTS `dinky_git_project`;
CREATE TABLE `dinky_git_project` (
`id` bigint(20) NOT null AUTO_INCREMENT,
`tenant_id` bigint(20) NOT null,
......@@ -438,7 +438,7 @@ CREATE TABLE `dinky_git_project` (
`update_time` datetime NOT null DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'update time'
) ENGINE = InnoDB;
DROP TABLE IF EXISTS dinky_metrics;
CREATE TABLE `dinky_metrics` (
`id` int(11) NOT null AUTO_INCREMENT,
`task_id` int(255) DEFAULT null,
......@@ -453,7 +453,7 @@ CREATE TABLE `dinky_metrics` (
`update_time` datetime DEFAULT null
) ENGINE = InnoDB;
DROP TABLE IF EXISTS dinky_resources;
CREATE TABLE `dinky_resources` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'key',
`file_name` varchar(64) DEFAULT null COMMENT 'file name',
......@@ -472,7 +472,7 @@ CREATE TABLE `dinky_resources` (
-- ----------------------------
-- Table structure for dinky_sys_login_log
-- ----------------------------
DROP TABLE IF EXISTS dinky_sys_login_log;
CREATE TABLE `dinky_sys_login_log` (
`id` int(11) NOT null AUTO_INCREMENT COMMENT 'key',
`user_id` int(11) NOT null COMMENT 'user id',
......@@ -492,7 +492,7 @@ CREATE TABLE `dinky_sys_login_log` (
-- ----------------------------
-- Table structure for dinky_sys_operate_log
-- ----------------------------
DROP TABLE IF EXISTS `dinky_sys_operate_log`;
CREATE TABLE `dinky_sys_operate_log` (
`id` bigint NOT null AUTO_INCREMENT COMMENT 'id',
`module_name` varchar(50) DEFAULT '' COMMENT 'module name',
......@@ -517,7 +517,7 @@ CREATE TABLE `dinky_sys_operate_log` (
-- ----------------------------
-- Table structure for dinky_sys_menu
-- ----------------------------
drop table if exists `dinky_sys_menu`;
create table `dinky_sys_menu` (
`id` bigint not null auto_increment comment ' id',
`parent_id` bigint not null comment 'parent menu id',
......@@ -538,7 +538,7 @@ create table `dinky_sys_menu` (
-- ----------------------------
-- Table structure dinky_sys_role_menu
-- ----------------------------
drop table if exists `dinky_sys_role_menu`;
CREATE TABLE `dinky_sys_role_menu` (
`id` bigint NOT null AUTO_INCREMENT COMMENT 'id',
`role_id` bigint NOT null COMMENT 'role id',
......@@ -554,7 +554,7 @@ CREATE TABLE `dinky_sys_role_menu` (
-- ----------------------------
-- Table structure dinky_sys_token
-- ----------------------------
drop table if exists `dinky_sys_token`;
CREATE TABLE `dinky_sys_token` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
`token_value` varchar(255) NOT NULL COMMENT 'token value',
......@@ -576,7 +576,7 @@ CREATE TABLE `dinky_sys_token` (
-- ----------------------------
-- Table structure dinky_sys_alert
-- ----------------------------
drop table if exists `dinky_alert_template`;
create table if not exists dinky_alert_template
(
id int auto_increment
......@@ -588,7 +588,7 @@ create table if not exists dinky_alert_template
update_time datetime null COMMENT 'update time'
);
drop table if exists `dinky_alert_rules`;
create table if not exists dinky_alert_rules
(
id int auto_increment
......
......@@ -21,10 +21,10 @@
<mapper namespace="org.dinky.mapper.UDFManageMapper">
<select id="selectAll" resultType="org.dinky.data.vo.UDFManageVO">
select u.*,"develop" source,t.dialect,null file_name from
select u.*,'develop' source,t.dialect,null file_name from
dinky_udf_manage u LEFT JOIN dinky_task t on t.id=u.task_id WHERE resources_id is null
union ALL
select u.*,"resources" source,null dialect,t.full_name from
select u.*,'resources' source,null dialect,t.full_name from
dinky_udf_manage u LEFT JOIN dinky_resources t on t.id=u.resources_id WHERE u.task_id is null
</select>
</mapper>
......@@ -21,7 +21,7 @@ package org.dinky.data.constant;
import java.io.File;
import cn.hutool.core.io.FileUtil;
import cn.hutool.system.SystemUtil;
/**
* DirConstant
......@@ -31,7 +31,7 @@ import cn.hutool.core.io.FileUtil;
public class DirConstant {
public static final String FILE_SEPARATOR = File.separator;
public static final String ROOT_PATH = FileUtil.getUserHomeDir().getAbsolutePath();
public static final String ROOT_PATH = System.getProperty(SystemUtil.USER_DIR);
public static final String LOG_DIR_PATH = ROOT_PATH + FILE_SEPARATOR + "logs";
public static final String ROOT_LOG_PATH = LOG_DIR_PATH + FILE_SEPARATOR + "dinky.log";
}
......@@ -146,7 +146,7 @@ public final class VariableManager {
return variables.get(variableName);
}
// use jexl to parse variable value
return ENGINE.eval(variableName, ENGINE_CONTEXT);
return ENGINE.eval(variableName, ENGINE_CONTEXT, null);
} catch (Exception e) {
throw new CatalogException(format("The variable of sql %s does not exist.", variableName));
}
......
......@@ -68,7 +68,7 @@
<hamcrest.version>1.3</hamcrest.version>
<hibernate-validator.version>6.2.0.Final</hibernate-validator.version>
<httpclient.version>4.5.13</httpclient.version>
<hutool.version>5.8.11</hutool.version>
<hutool.version>5.8.22</hutool.version>
<jackson.version>2.14.1</jackson.version>
<jakarta.ws.rs-api.version>2.1.6</jakarta.ws.rs-api.version>
<jasypt.version>1.9.3</jasypt.version>
......@@ -108,7 +108,7 @@
<protobuf-java.version>2.5.0</protobuf-java.version>
<reflections.version>0.10.2</reflections.version>
<revision>1.0.0-SNAPSHOT</revision>
<sa-token.version>1.36.0</sa-token.version>
<sa-token.version>1.37.0</sa-token.version>
<scala.binary.version>2.12</scala.binary.version>
<scala.version>2.12.10</scala.version>
<!-- `provided` for product environment ,`compile` for dev environment -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment