From 3cfc2887d46a5a83868ccd0b2608d381e81f533c Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Tue, 18 Apr 2023 15:55:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=88=9D=E5=A7=8B=E5=8C=96sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/glxp/api/config/HdSchemaExecutor.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/glxp/api/config/HdSchemaExecutor.java b/src/main/java/com/glxp/api/config/HdSchemaExecutor.java index ef180f36..d4ac94ea 100644 --- a/src/main/java/com/glxp/api/config/HdSchemaExecutor.java +++ b/src/main/java/com/glxp/api/config/HdSchemaExecutor.java @@ -7,6 +7,7 @@ import com.glxp.api.dao.system.DbVersionDao; import com.glxp.api.entity.system.DbVersionEntity; import com.glxp.api.entity.system.SchemaData; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; import org.springframework.core.annotation.Order; @@ -26,10 +27,16 @@ public class HdSchemaExecutor implements ApplicationRunner { @Resource DbVersionDao hdCommonDao; + @Value("${initSql:true}") + private boolean initSql; + private List schema = new ArrayList<>(); @Override public void run(ApplicationArguments args) throws Exception { + if (!initSql) { + return; + } //初始版本列表 buildSchemas(); //定义sql文件路径