Browse Source

change table name in mysql ddl (#949)

* rename from DatasourceUserMapper to DataSourceUserMapper

* add unit test in UserMapper and WorkerGroupMapper

* change cn.escheduler to org.apache.dolphinscheduler

* add unit test in UdfFuncMapperTest

* add unit test in UdfFuncMapperTest

* remove DatabaseConfiguration

* add ConnectionFactoryTest

* cal duration in processInstancesList

* change desc to description

* change table name in mysql ddl
pull/2/head
lgcareer 5 years ago committed by qiaozhanwei
parent
commit
e5862afe6e
  1. 4
      dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/DolphinSchedulerManager.java
  2. 4
      dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/UpgradeDao.java
  3. 444
      sql/upgrade/1.2.0_schema/mysql/dolphinscheduler_ddl.sql

4
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/DolphinSchedulerManager.java

@ -82,8 +82,8 @@ public class DolphinSchedulerManager {
// Gets the version of the current system
if (upgradeDao.isExistsTable("t_escheduler_version")) {
version = upgradeDao.getCurrentVersion("t_escheduler_version");
}else if(upgradeDao.isExistsTable("t_dolphinscheduler_version")){
version = upgradeDao.getCurrentVersion("t_dolphinscheduler_version");
}else if(upgradeDao.isExistsTable("t_ds_version")){
version = upgradeDao.getCurrentVersion("t_ds_version");
}else if(upgradeDao.isExistsColumn("t_escheduler_queue","create_time")){
version = "1.0.1";
}else if(upgradeDao.isExistsTable("t_escheduler_queue")){

4
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/UpgradeDao.java

@ -37,7 +37,7 @@ public abstract class UpgradeDao extends AbstractBaseDao {
public static final Logger logger = LoggerFactory.getLogger(UpgradeDao.class);
private static final String T_VERSION_NAME = "t_escheduler_version";
private static final String T_NEW_VERSION_NAME = "t_dolphinscheduler_version";
private static final String T_NEW_VERSION_NAME = "t_ds_version";
private static final String rootDir = System.getProperty("user.dir");
private static final DbType dbType = getCurrentDbType();
@ -336,7 +336,7 @@ public abstract class UpgradeDao extends AbstractBaseDao {
// Change version in the version table to the new version
String versionName = T_VERSION_NAME;
if(!SchemaUtils.isAGreatVersion("1.2.0" , version)){
versionName = "t_dolphinscheduler_version";
versionName = "t_ds_version";
}
String upgradeSQL = String.format("update %s set version = ?",versionName);
PreparedStatement pstmt = null;

444
sql/upgrade/1.2.0_schema/mysql/dolphinscheduler_ddl.sql

@ -1,486 +1,606 @@
SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
-- ut_dolphin_T_t_dolphinscheduler_access_token
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_access_token;
-- ut_dolphin_T_t_ds_access_token
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_access_token;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_access_token()
CREATE PROCEDURE ut_dolphin_T_t_ds_access_token()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_access_token'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_access_token RENAME t_dolphinscheduler_access_token;
ALTER TABLE t_escheduler_access_token RENAME t_ds_access_token;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_access_token;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_access_token;
CALL ut_dolphin_T_t_ds_access_token;
DROP PROCEDURE ut_dolphin_T_t_ds_access_token;
-- ut_dolphin_T_t_dolphinscheduler_alert
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_alert;
-- ut_dolphin_T_t_ds_alert
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_alert;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_alert()
CREATE PROCEDURE ut_dolphin_T_t_ds_alert()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_alert'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_alert RENAME t_dolphinscheduler_alert;
ALTER TABLE t_escheduler_alert RENAME t_ds_alert;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_alert;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_alert;
CALL ut_dolphin_T_t_ds_alert;
DROP PROCEDURE ut_dolphin_T_t_ds_alert;
-- ut_dolphin_T_t_dolphinscheduler_alertgroup
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_alertgroup;
-- ut_dolphin_T_t_ds_alertgroup
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_alertgroup;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_alertgroup()
CREATE PROCEDURE ut_dolphin_T_t_ds_alertgroup()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_alertgroup'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_alertgroup RENAME t_dolphinscheduler_alertgroup;
ALTER TABLE t_escheduler_alertgroup RENAME t_ds_alertgroup;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_alertgroup;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_alertgroup;
CALL ut_dolphin_T_t_ds_alertgroup;
DROP PROCEDURE ut_dolphin_T_t_ds_alertgroup;
-- ut_dolphin_T_t_dolphinscheduler_command
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_command;
-- ut_dolphin_T_t_ds_command
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_command;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_command()
CREATE PROCEDURE ut_dolphin_T_t_ds_command()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_command'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_command RENAME t_dolphinscheduler_command;
ALTER TABLE t_escheduler_command RENAME t_ds_command;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_command;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_command;
CALL ut_dolphin_T_t_ds_command;
DROP PROCEDURE ut_dolphin_T_t_ds_command;
-- ut_dolphin_T_t_dolphinscheduler_datasource
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_datasource;
-- ut_dolphin_T_t_ds_datasource
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_datasource;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_datasource()
CREATE PROCEDURE ut_dolphin_T_t_ds_datasource()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_datasource'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_datasource RENAME t_dolphinscheduler_datasource;
ALTER TABLE t_escheduler_datasource RENAME t_ds_datasource;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_datasource;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_datasource;
CALL ut_dolphin_T_t_ds_datasource;
DROP PROCEDURE ut_dolphin_T_t_ds_datasource;
-- ut_dolphin_T_t_dolphinscheduler_error_command
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_error_command;
-- ut_dolphin_T_t_ds_error_command
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_error_command;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_error_command()
CREATE PROCEDURE ut_dolphin_T_t_ds_error_command()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_error_command'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_error_command RENAME t_dolphinscheduler_error_command;
ALTER TABLE t_escheduler_error_command RENAME t_ds_error_command;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_error_command;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_error_command;
CALL ut_dolphin_T_t_ds_error_command;
DROP PROCEDURE ut_dolphin_T_t_ds_error_command;
-- ut_dolphin_T_t_dolphinscheduler_master_server
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_master_server;
-- ut_dolphin_T_t_ds_master_server
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_master_server;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_master_server()
CREATE PROCEDURE ut_dolphin_T_t_ds_master_server()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_master_server'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_master_server RENAME t_dolphinscheduler_master_server;
ALTER TABLE t_escheduler_master_server RENAME t_ds_master_server;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_master_server;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_master_server;
CALL ut_dolphin_T_t_ds_master_server;
DROP PROCEDURE ut_dolphin_T_t_ds_master_server;
-- ut_dolphin_T_t_dolphinscheduler_process_definition
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_process_definition;
-- ut_dolphin_T_t_ds_process_definition
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_process_definition;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_process_definition()
CREATE PROCEDURE ut_dolphin_T_t_ds_process_definition()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_process_definition'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_process_definition RENAME t_dolphinscheduler_process_definition;
ALTER TABLE t_escheduler_process_definition RENAME t_ds_process_definition;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_process_definition;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_process_definition;
CALL ut_dolphin_T_t_ds_process_definition;
DROP PROCEDURE ut_dolphin_T_t_ds_process_definition;
-- ut_dolphin_T_t_dolphinscheduler_process_instance
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_process_instance;
-- ut_dolphin_T_t_ds_process_instance
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_process_instance;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_process_instance()
CREATE PROCEDURE ut_dolphin_T_t_ds_process_instance()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_process_instance'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_process_instance RENAME t_dolphinscheduler_process_instance;
ALTER TABLE t_escheduler_process_instance RENAME t_ds_process_instance;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_process_instance;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_process_instance;
CALL ut_dolphin_T_t_ds_process_instance;
DROP PROCEDURE ut_dolphin_T_t_ds_process_instance;
-- ut_dolphin_T_t_dolphinscheduler_project
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_project;
-- ut_dolphin_T_t_ds_project
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_project;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_project()
CREATE PROCEDURE ut_dolphin_T_t_ds_project()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_project'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_project RENAME t_dolphinscheduler_project;
ALTER TABLE t_escheduler_project RENAME t_ds_project;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_project;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_project;
CALL ut_dolphin_T_t_ds_project;
DROP PROCEDURE ut_dolphin_T_t_ds_project;
-- ut_dolphin_T_t_dolphinscheduler_queue
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_queue;
-- ut_dolphin_T_t_ds_queue
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_queue;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_queue()
CREATE PROCEDURE ut_dolphin_T_t_ds_queue()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_queue'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_queue RENAME t_dolphinscheduler_queue;
ALTER TABLE t_escheduler_queue RENAME t_ds_queue;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_queue;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_queue;
CALL ut_dolphin_T_t_ds_queue;
DROP PROCEDURE ut_dolphin_T_t_ds_queue;
-- ut_dolphin_T_t_dolphinscheduler_relation_datasource_user
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_relation_datasource_user;
-- ut_dolphin_T_t_ds_relation_datasource_user
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_relation_datasource_user;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_relation_datasource_user()
CREATE PROCEDURE ut_dolphin_T_t_ds_relation_datasource_user()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_relation_datasource_user'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_relation_datasource_user RENAME t_dolphinscheduler_relation_datasource_user;
ALTER TABLE t_escheduler_relation_datasource_user RENAME t_ds_relation_datasource_user;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_relation_datasource_user;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_relation_datasource_user;
CALL ut_dolphin_T_t_ds_relation_datasource_user;
DROP PROCEDURE ut_dolphin_T_t_ds_relation_datasource_user;
-- ut_dolphin_T_t_dolphinscheduler_relation_process_instance
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_relation_process_instance;
-- ut_dolphin_T_t_ds_relation_process_instance
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_relation_process_instance;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_relation_process_instance()
CREATE PROCEDURE ut_dolphin_T_t_ds_relation_process_instance()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_relation_process_instance'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_relation_process_instance RENAME t_dolphinscheduler_relation_process_instance;
ALTER TABLE t_escheduler_relation_process_instance RENAME t_ds_relation_process_instance;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_relation_process_instance;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_relation_process_instance;
CALL ut_dolphin_T_t_ds_relation_process_instance;
DROP PROCEDURE ut_dolphin_T_t_ds_relation_process_instance;
-- ut_dolphin_T_t_dolphinscheduler_relation_project_user
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_relation_project_user;
-- ut_dolphin_T_t_ds_relation_project_user
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_relation_project_user;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_relation_project_user()
CREATE PROCEDURE ut_dolphin_T_t_ds_relation_project_user()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_relation_project_user'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_relation_project_user RENAME t_dolphinscheduler_relation_project_user;
ALTER TABLE t_escheduler_relation_project_user RENAME t_ds_relation_project_user;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_relation_project_user;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_relation_project_user;
CALL ut_dolphin_T_t_ds_relation_project_user;
DROP PROCEDURE ut_dolphin_T_t_ds_relation_project_user;
-- ut_dolphin_T_t_dolphinscheduler_relation_resources_user
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_relation_resources_user;
-- ut_dolphin_T_t_ds_relation_resources_user
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_relation_resources_user;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_relation_resources_user()
CREATE PROCEDURE ut_dolphin_T_t_ds_relation_resources_user()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_relation_resources_user'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_relation_resources_user RENAME t_dolphinscheduler_relation_resources_user;
ALTER TABLE t_escheduler_relation_resources_user RENAME t_ds_relation_resources_user;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_relation_resources_user;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_relation_resources_user;
CALL ut_dolphin_T_t_ds_relation_resources_user;
DROP PROCEDURE ut_dolphin_T_t_ds_relation_resources_user;
-- ut_dolphin_T_t_dolphinscheduler_relation_udfs_user
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_relation_udfs_user;
-- ut_dolphin_T_t_ds_relation_udfs_user
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_relation_udfs_user;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_relation_udfs_user()
CREATE PROCEDURE ut_dolphin_T_t_ds_relation_udfs_user()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_relation_udfs_user'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_relation_udfs_user RENAME t_dolphinscheduler_relation_udfs_user;
ALTER TABLE t_escheduler_relation_udfs_user RENAME t_ds_relation_udfs_user;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_relation_udfs_user;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_relation_udfs_user;
CALL ut_dolphin_T_t_ds_relation_udfs_user;
DROP PROCEDURE ut_dolphin_T_t_ds_relation_udfs_user;
-- ut_dolphin_T_t_dolphinscheduler_relation_user_alertgroup
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_relation_user_alertgroup;
-- ut_dolphin_T_t_ds_relation_user_alertgroup
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_relation_user_alertgroup;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_relation_user_alertgroup()
CREATE PROCEDURE ut_dolphin_T_t_ds_relation_user_alertgroup()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_relation_user_alertgroup'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_relation_user_alertgroup RENAME t_dolphinscheduler_relation_user_alertgroup;
ALTER TABLE t_escheduler_relation_user_alertgroup RENAME t_ds_relation_user_alertgroup;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_relation_user_alertgroup;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_relation_user_alertgroup;
CALL ut_dolphin_T_t_ds_relation_user_alertgroup;
DROP PROCEDURE ut_dolphin_T_t_ds_relation_user_alertgroup;
-- ut_dolphin_T_t_dolphinscheduler_resources
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_resources;
-- ut_dolphin_T_t_ds_resources
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_resources;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_resources()
CREATE PROCEDURE ut_dolphin_T_t_ds_resources()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_resources'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_resources RENAME t_dolphinscheduler_resources;
ALTER TABLE t_escheduler_resources RENAME t_ds_resources;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_resources;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_resources;
CALL ut_dolphin_T_t_ds_resources;
DROP PROCEDURE ut_dolphin_T_t_ds_resources;
-- ut_dolphin_T_t_dolphinscheduler_schedules
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_schedules;
-- ut_dolphin_T_t_ds_schedules
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_schedules;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_schedules()
CREATE PROCEDURE ut_dolphin_T_t_ds_schedules()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_schedules'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_schedules RENAME t_dolphinscheduler_schedules;
ALTER TABLE t_escheduler_schedules RENAME t_ds_schedules;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_schedules;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_schedules;
CALL ut_dolphin_T_t_ds_schedules;
DROP PROCEDURE ut_dolphin_T_t_ds_schedules;
-- ut_dolphin_T_t_dolphinscheduler_session
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_session;
-- ut_dolphin_T_t_ds_session
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_session;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_session()
CREATE PROCEDURE ut_dolphin_T_t_ds_session()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_session'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_session RENAME t_dolphinscheduler_session;
ALTER TABLE t_escheduler_session RENAME t_ds_session;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_session;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_session;
CALL ut_dolphin_T_t_ds_session;
DROP PROCEDURE ut_dolphin_T_t_ds_session;
-- ut_dolphin_T_t_dolphinscheduler_task_instance
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_task_instance;
-- ut_dolphin_T_t_ds_task_instance
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_task_instance;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_task_instance()
CREATE PROCEDURE ut_dolphin_T_t_ds_task_instance()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_task_instance'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_task_instance RENAME t_dolphinscheduler_task_instance;
ALTER TABLE t_escheduler_task_instance RENAME t_ds_task_instance;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_task_instance;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_task_instance;
CALL ut_dolphin_T_t_ds_task_instance;
DROP PROCEDURE ut_dolphin_T_t_ds_task_instance;
-- ut_dolphin_T_t_dolphinscheduler_tenant
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_tenant;
-- ut_dolphin_T_t_ds_tenant
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_tenant;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_tenant()
CREATE PROCEDURE ut_dolphin_T_t_ds_tenant()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_tenant'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_tenant RENAME t_dolphinscheduler_tenant;
ALTER TABLE t_escheduler_tenant RENAME t_ds_tenant;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_tenant;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_tenant;
CALL ut_dolphin_T_t_ds_tenant;
DROP PROCEDURE ut_dolphin_T_t_ds_tenant;
-- ut_dolphin_T_t_dolphinscheduler_udfs
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_udfs;
-- ut_dolphin_T_t_ds_udfs
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_udfs;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_udfs()
CREATE PROCEDURE ut_dolphin_T_t_ds_udfs()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_udfs'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_udfs RENAME t_dolphinscheduler_udfs;
ALTER TABLE t_escheduler_udfs RENAME t_ds_udfs;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_udfs;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_udfs;
CALL ut_dolphin_T_t_ds_udfs;
DROP PROCEDURE ut_dolphin_T_t_ds_udfs;
-- ut_dolphin_T_t_dolphinscheduler_user
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_user;
-- ut_dolphin_T_t_ds_user
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_user;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_user()
CREATE PROCEDURE ut_dolphin_T_t_ds_user()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_user'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_user RENAME t_dolphinscheduler_user;
ALTER TABLE t_escheduler_user RENAME t_ds_user;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_user;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_user;
CALL ut_dolphin_T_t_ds_user;
DROP PROCEDURE ut_dolphin_T_t_ds_user;
-- ut_dolphin_T_t_dolphinscheduler_version
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_version;
-- ut_dolphin_T_t_ds_version
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_version;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_version()
CREATE PROCEDURE ut_dolphin_T_t_ds_version()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_version'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_version RENAME t_dolphinscheduler_version;
ALTER TABLE t_escheduler_version RENAME t_ds_version;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_version;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_version;
CALL ut_dolphin_T_t_ds_version;
DROP PROCEDURE ut_dolphin_T_t_ds_version;
-- ut_dolphin_T_t_dolphinscheduler_worker_group
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_worker_group;
-- ut_dolphin_T_t_ds_worker_group
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_worker_group;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_worker_group()
CREATE PROCEDURE ut_dolphin_T_t_ds_worker_group()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_worker_group'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_worker_group RENAME t_dolphinscheduler_worker_group;
ALTER TABLE t_escheduler_worker_group RENAME t_ds_worker_group;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_worker_group;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_worker_group;
CALL ut_dolphin_T_t_ds_worker_group;
DROP PROCEDURE ut_dolphin_T_t_ds_worker_group;
-- ut_dolphin_T_t_dolphinscheduler_worker_server
drop PROCEDURE if EXISTS ut_dolphin_T_t_dolphinscheduler_worker_server;
-- ut_dolphin_T_t_ds_worker_server
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_worker_server;
delimiter d//
CREATE PROCEDURE ut_dolphin_T_t_dolphinscheduler_worker_server()
CREATE PROCEDURE ut_dolphin_T_t_ds_worker_server()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.TABLES
WHERE TABLE_NAME='t_escheduler_worker_server'
AND TABLE_SCHEMA=(SELECT DATABASE()))
THEN
ALTER TABLE t_escheduler_worker_server RENAME t_dolphinscheduler_worker_server;
ALTER TABLE t_escheduler_worker_server RENAME t_ds_worker_server;
END IF;
END;
d//
delimiter ;
CALL ut_dolphin_T_t_dolphinscheduler_worker_server;
DROP PROCEDURE ut_dolphin_T_t_dolphinscheduler_worker_server;
CALL ut_dolphin_T_t_ds_worker_server;
DROP PROCEDURE ut_dolphin_T_t_ds_worker_server;
-- uc_dolphin_T_t_ds_alertgroup_C_desc
drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_alertgroup_C_desc;
delimiter d//
CREATE PROCEDURE uc_dolphin_T_t_ds_alertgroup_C_desc()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_NAME='t_ds_alertgroup'
AND TABLE_SCHEMA=(SELECT DATABASE())
AND COLUMN_NAME='desc')
THEN
ALTER TABLE t_ds_alertgroup CHANGE COLUMN `desc` description varchar(255);
END IF;
END;
d//
delimiter ;
CALL uc_dolphin_T_t_ds_alertgroup_C_desc;
DROP PROCEDURE uc_dolphin_T_t_ds_alertgroup_C_desc;
-- uc_dolphin_T_t_ds_process_definition_C_desc
drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_process_definition_C_desc;
delimiter d//
CREATE PROCEDURE uc_dolphin_T_t_ds_process_definition_C_desc()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_NAME='t_dolphinscheduler_process_definition'
AND TABLE_SCHEMA=(SELECT DATABASE())
AND COLUMN_NAME='desc')
THEN
ALTER TABLE t_dolphinscheduler_process_definition CHANGE COLUMN `desc` description text;
END IF;
END;
d//
delimiter ;
CALL uc_dolphin_T_t_ds_process_definition_C_desc;
DROP PROCEDURE uc_dolphin_T_t_ds_process_definition_C_desc;
-- uc_dolphin_T_t_ds_project_C_desc
drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_project_C_desc;
delimiter d//
CREATE PROCEDURE uc_dolphin_T_t_ds_project_C_desc()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_NAME='t_ds_project'
AND TABLE_SCHEMA=(SELECT DATABASE())
AND COLUMN_NAME='desc')
THEN
ALTER TABLE t_ds_project CHANGE COLUMN `desc` description varchar(200);
END IF;
END;
d//
delimiter ;
CALL uc_dolphin_T_t_ds_project_C_desc;
DROP PROCEDURE uc_dolphin_T_t_ds_project_C_desc;
-- uc_dolphin_T_t_ds_resources_C_desc
drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_resources_C_desc;
delimiter d//
CREATE PROCEDURE uc_dolphin_T_t_ds_resources_C_desc()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_NAME='t_ds_resources'
AND TABLE_SCHEMA=(SELECT DATABASE())
AND COLUMN_NAME='desc')
THEN
ALTER TABLE t_ds_resources CHANGE COLUMN `desc` description varchar(256);
END IF;
END;
d//
delimiter ;
CALL uc_dolphin_T_t_ds_resources_C_desc;
DROP PROCEDURE uc_dolphin_T_t_ds_resources_C_desc;
-- uc_dolphin_T_t_ds_tenant_C_desc
drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_tenant_C_desc;
delimiter d//
CREATE PROCEDURE uc_dolphin_T_t_ds_tenant_C_desc()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_NAME='t_ds_tenant'
AND TABLE_SCHEMA=(SELECT DATABASE())
AND COLUMN_NAME='desc')
THEN
ALTER TABLE t_ds_tenant CHANGE COLUMN `desc` description varchar(256);
END IF;
END;
d//
delimiter ;
CALL uc_dolphin_T_t_ds_tenant_C_desc;
DROP PROCEDURE uc_dolphin_T_t_ds_tenant_C_desc;
-- uc_dolphin_T_t_ds_udfs_C_desc
drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_udfs_C_desc;
delimiter d//
CREATE PROCEDURE uc_dolphin_T_t_ds_udfs_C_desc()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_NAME='t_ds_udfs'
AND TABLE_SCHEMA=(SELECT DATABASE())
AND COLUMN_NAME='desc')
THEN
ALTER TABLE t_ds_udfs CHANGE COLUMN `desc` description varchar(255);
END IF;
END;
d//
delimiter ;
CALL uc_dolphin_T_t_ds_udfs_C_desc;
DROP PROCEDURE uc_dolphin_T_t_ds_udfs_C_desc;
Loading…
Cancel
Save