You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/01/04 18:23:27 UTC

[GitHub] [incubator-dolphinscheduler] IamMujuziMoses commented on a change in pull request #4164: [Feature][Dao] Execute sql from the latest image version not earliest to current version

IamMujuziMoses commented on a change in pull request #4164:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/4164#discussion_r551486402



##########
File path: dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/UpgradeDao.java
##########
@@ -475,7 +542,12 @@ private void upgradeDolphinSchedulerDDL(String schemaDir) {
         if (StringUtils.isEmpty(rootDir)) {
             throw new RuntimeException("Environment variable user.dir not found");
         }
-        String sqlFilePath = MessageFormat.format("{0}/sql/upgrade/{1}/{2}/dolphinscheduler_ddl.sql", rootDir, schemaDir, getDbType().name().toLowerCase());
+        String sqlFilePath = "";
+        if (schemaDir.startsWith("m")) {
+            sqlFilePath = MessageFormat.format("{0}/sql/create/{1}/{2}/dolphinscheduler_dml.sql", rootDir, schemaDir, getDbType().name().toLowerCase());

Review comment:
       its ddl instead of dml

##########
File path: dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/UpgradeDao.java
##########
@@ -475,7 +542,12 @@ private void upgradeDolphinSchedulerDDL(String schemaDir) {
         if (StringUtils.isEmpty(rootDir)) {
             throw new RuntimeException("Environment variable user.dir not found");
         }
-        String sqlFilePath = MessageFormat.format("{0}/sql/upgrade/{1}/{2}/dolphinscheduler_ddl.sql", rootDir, schemaDir, getDbType().name().toLowerCase());
+        String sqlFilePath = "";
+        if (schemaDir.startsWith("m")) {
+            sqlFilePath = MessageFormat.format("{0}/sql/create/{1}/{2}/dolphinscheduler_dml.sql", rootDir, schemaDir, getDbType().name().toLowerCase());
+        } else if (schemaDir.startsWith("1")) {
+            sqlFilePath = MessageFormat.format("{0}/sql/upgrade/{1}/{2}/dolphinscheduler_dml.sql", rootDir, schemaDir, getDbType().name().toLowerCase());

Review comment:
       its ddl instead of dml




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org