dolphinscheduler_ddl.sql 17.4 KB
Newer Older
B
bao liang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * 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.
*/

L
lgcareer 已提交
18
SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
L
lgcareer 已提交
19 20
-- ut_dolphin_T_t_ds_access_token
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_access_token;
L
lgcareer 已提交
21
delimiter d//
L
lgcareer 已提交
22
CREATE PROCEDURE ut_dolphin_T_t_ds_access_token()
L
lgcareer 已提交
23 24 25 26 27
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_access_token'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
28
			ALTER TABLE t_escheduler_access_token RENAME t_ds_access_token;
L
lgcareer 已提交
29 30 31 32 33
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
34 35
CALL ut_dolphin_T_t_ds_access_token;
DROP PROCEDURE ut_dolphin_T_t_ds_access_token;
L
lgcareer 已提交
36

L
lgcareer 已提交
37 38
-- ut_dolphin_T_t_ds_alert
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_alert;
L
lgcareer 已提交
39
delimiter d//
L
lgcareer 已提交
40
CREATE PROCEDURE ut_dolphin_T_t_ds_alert()
L
lgcareer 已提交
41 42 43 44 45
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_alert'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
46
			ALTER TABLE t_escheduler_alert RENAME t_ds_alert;
L
lgcareer 已提交
47 48 49 50 51
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
52 53
CALL ut_dolphin_T_t_ds_alert;
DROP PROCEDURE ut_dolphin_T_t_ds_alert;
L
lgcareer 已提交
54

L
lgcareer 已提交
55 56
-- ut_dolphin_T_t_ds_alertgroup
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_alertgroup;
L
lgcareer 已提交
57
delimiter d//
L
lgcareer 已提交
58
CREATE PROCEDURE ut_dolphin_T_t_ds_alertgroup()
L
lgcareer 已提交
59 60 61 62 63
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_alertgroup'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
64
			ALTER TABLE t_escheduler_alertgroup RENAME t_ds_alertgroup;
L
lgcareer 已提交
65 66 67 68 69
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
70 71
CALL ut_dolphin_T_t_ds_alertgroup;
DROP PROCEDURE ut_dolphin_T_t_ds_alertgroup;
L
lgcareer 已提交
72

L
lgcareer 已提交
73 74
-- ut_dolphin_T_t_ds_command
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_command;
L
lgcareer 已提交
75
delimiter d//
L
lgcareer 已提交
76
CREATE PROCEDURE ut_dolphin_T_t_ds_command()
L
lgcareer 已提交
77 78 79 80 81
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_command'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
82
			ALTER TABLE t_escheduler_command RENAME t_ds_command;
L
lgcareer 已提交
83 84 85 86 87
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
88 89
CALL ut_dolphin_T_t_ds_command;
DROP PROCEDURE ut_dolphin_T_t_ds_command;
L
lgcareer 已提交
90

L
lgcareer 已提交
91 92
-- ut_dolphin_T_t_ds_datasource
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_datasource;
L
lgcareer 已提交
93
delimiter d//
L
lgcareer 已提交
94
CREATE PROCEDURE ut_dolphin_T_t_ds_datasource()
L
lgcareer 已提交
95 96 97 98 99
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_datasource'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
100
			ALTER TABLE t_escheduler_datasource RENAME t_ds_datasource;
L
lgcareer 已提交
101 102 103 104 105
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
106 107
CALL ut_dolphin_T_t_ds_datasource;
DROP PROCEDURE ut_dolphin_T_t_ds_datasource;
L
lgcareer 已提交
108

L
lgcareer 已提交
109 110
-- ut_dolphin_T_t_ds_error_command
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_error_command;
L
lgcareer 已提交
111
delimiter d//
L
lgcareer 已提交
112
CREATE PROCEDURE ut_dolphin_T_t_ds_error_command()
L
lgcareer 已提交
113 114 115 116 117
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_error_command'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
118
			ALTER TABLE t_escheduler_error_command RENAME t_ds_error_command;
L
lgcareer 已提交
119 120 121 122 123
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
124 125
CALL ut_dolphin_T_t_ds_error_command;
DROP PROCEDURE ut_dolphin_T_t_ds_error_command;
L
lgcareer 已提交
126

L
lgcareer 已提交
127 128
-- ut_dolphin_T_t_ds_master_server
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_master_server;
L
lgcareer 已提交
129
delimiter d//
L
lgcareer 已提交
130
CREATE PROCEDURE ut_dolphin_T_t_ds_master_server()
L
lgcareer 已提交
131 132 133 134 135
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_master_server'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
136
			ALTER TABLE t_escheduler_master_server RENAME t_ds_master_server;
L
lgcareer 已提交
137 138 139 140 141
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
142 143
CALL ut_dolphin_T_t_ds_master_server;
DROP PROCEDURE ut_dolphin_T_t_ds_master_server;
L
lgcareer 已提交
144

L
lgcareer 已提交
145 146
-- ut_dolphin_T_t_ds_process_definition
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_process_definition;
L
lgcareer 已提交
147
delimiter d//
L
lgcareer 已提交
148
CREATE PROCEDURE ut_dolphin_T_t_ds_process_definition()
L
lgcareer 已提交
149 150 151 152 153
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_process_definition'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
154
			ALTER TABLE t_escheduler_process_definition RENAME t_ds_process_definition;
L
lgcareer 已提交
155 156 157 158 159
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
160 161
CALL ut_dolphin_T_t_ds_process_definition;
DROP PROCEDURE ut_dolphin_T_t_ds_process_definition;
L
lgcareer 已提交
162

L
lgcareer 已提交
163 164
-- ut_dolphin_T_t_ds_process_instance
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_process_instance;
L
lgcareer 已提交
165
delimiter d//
L
lgcareer 已提交
166
CREATE PROCEDURE ut_dolphin_T_t_ds_process_instance()
L
lgcareer 已提交
167 168 169 170 171
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_process_instance'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
172
			ALTER TABLE t_escheduler_process_instance RENAME t_ds_process_instance;
L
lgcareer 已提交
173 174 175 176 177
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
178 179
CALL ut_dolphin_T_t_ds_process_instance;
DROP PROCEDURE ut_dolphin_T_t_ds_process_instance;
L
lgcareer 已提交
180

L
lgcareer 已提交
181 182
-- ut_dolphin_T_t_ds_project
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_project;
L
lgcareer 已提交
183
delimiter d//
L
lgcareer 已提交
184
CREATE PROCEDURE ut_dolphin_T_t_ds_project()
L
lgcareer 已提交
185 186 187 188 189
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_project'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
190
			ALTER TABLE t_escheduler_project RENAME t_ds_project;
L
lgcareer 已提交
191 192 193 194 195
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
196 197
CALL ut_dolphin_T_t_ds_project;
DROP PROCEDURE ut_dolphin_T_t_ds_project;
L
lgcareer 已提交
198

L
lgcareer 已提交
199 200
-- ut_dolphin_T_t_ds_queue
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_queue;
L
lgcareer 已提交
201
delimiter d//
L
lgcareer 已提交
202
CREATE PROCEDURE ut_dolphin_T_t_ds_queue()
L
lgcareer 已提交
203 204 205 206 207
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_queue'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
208
			ALTER TABLE t_escheduler_queue RENAME t_ds_queue;
L
lgcareer 已提交
209 210 211 212 213
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
214 215
CALL ut_dolphin_T_t_ds_queue;
DROP PROCEDURE ut_dolphin_T_t_ds_queue;
L
lgcareer 已提交
216

L
lgcareer 已提交
217 218
-- ut_dolphin_T_t_ds_relation_datasource_user
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_relation_datasource_user;
L
lgcareer 已提交
219
delimiter d//
L
lgcareer 已提交
220
CREATE PROCEDURE ut_dolphin_T_t_ds_relation_datasource_user()
L
lgcareer 已提交
221 222 223 224 225
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_relation_datasource_user'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
226
			ALTER TABLE t_escheduler_relation_datasource_user RENAME t_ds_relation_datasource_user;
L
lgcareer 已提交
227 228 229 230 231
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
232 233
CALL ut_dolphin_T_t_ds_relation_datasource_user;
DROP PROCEDURE ut_dolphin_T_t_ds_relation_datasource_user;
L
lgcareer 已提交
234

L
lgcareer 已提交
235 236
-- ut_dolphin_T_t_ds_relation_process_instance
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_relation_process_instance;
L
lgcareer 已提交
237
delimiter d//
L
lgcareer 已提交
238
CREATE PROCEDURE ut_dolphin_T_t_ds_relation_process_instance()
L
lgcareer 已提交
239 240 241 242 243
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_relation_process_instance'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
244
			ALTER TABLE t_escheduler_relation_process_instance RENAME t_ds_relation_process_instance;
L
lgcareer 已提交
245 246 247 248 249
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
250 251
CALL ut_dolphin_T_t_ds_relation_process_instance;
DROP PROCEDURE ut_dolphin_T_t_ds_relation_process_instance;
L
lgcareer 已提交
252

L
lgcareer 已提交
253 254
-- ut_dolphin_T_t_ds_relation_project_user
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_relation_project_user;
L
lgcareer 已提交
255
delimiter d//
L
lgcareer 已提交
256
CREATE PROCEDURE ut_dolphin_T_t_ds_relation_project_user()
L
lgcareer 已提交
257 258 259 260 261
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_relation_project_user'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
262
			ALTER TABLE t_escheduler_relation_project_user RENAME t_ds_relation_project_user;
L
lgcareer 已提交
263 264 265 266 267
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
268 269
CALL ut_dolphin_T_t_ds_relation_project_user;
DROP PROCEDURE ut_dolphin_T_t_ds_relation_project_user;
L
lgcareer 已提交
270

L
lgcareer 已提交
271 272
-- ut_dolphin_T_t_ds_relation_resources_user
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_relation_resources_user;
L
lgcareer 已提交
273
delimiter d//
L
lgcareer 已提交
274
CREATE PROCEDURE ut_dolphin_T_t_ds_relation_resources_user()
L
lgcareer 已提交
275 276 277 278 279
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_relation_resources_user'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
280
			ALTER TABLE t_escheduler_relation_resources_user RENAME t_ds_relation_resources_user;
L
lgcareer 已提交
281 282 283 284 285
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
286 287
CALL ut_dolphin_T_t_ds_relation_resources_user;
DROP PROCEDURE ut_dolphin_T_t_ds_relation_resources_user;
L
lgcareer 已提交
288

L
lgcareer 已提交
289 290
-- ut_dolphin_T_t_ds_relation_udfs_user
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_relation_udfs_user;
L
lgcareer 已提交
291
delimiter d//
L
lgcareer 已提交
292
CREATE PROCEDURE ut_dolphin_T_t_ds_relation_udfs_user()
L
lgcareer 已提交
293 294 295 296 297
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_relation_udfs_user'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
298
			ALTER TABLE t_escheduler_relation_udfs_user RENAME t_ds_relation_udfs_user;
L
lgcareer 已提交
299 300 301 302 303
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
304 305
CALL ut_dolphin_T_t_ds_relation_udfs_user;
DROP PROCEDURE ut_dolphin_T_t_ds_relation_udfs_user;
L
lgcareer 已提交
306

L
lgcareer 已提交
307 308
-- ut_dolphin_T_t_ds_relation_user_alertgroup
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_relation_user_alertgroup;
L
lgcareer 已提交
309
delimiter d//
L
lgcareer 已提交
310
CREATE PROCEDURE ut_dolphin_T_t_ds_relation_user_alertgroup()
L
lgcareer 已提交
311 312 313 314 315
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_relation_user_alertgroup'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
316
			ALTER TABLE t_escheduler_relation_user_alertgroup RENAME t_ds_relation_user_alertgroup;
L
lgcareer 已提交
317 318 319 320 321
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
322 323
CALL ut_dolphin_T_t_ds_relation_user_alertgroup;
DROP PROCEDURE ut_dolphin_T_t_ds_relation_user_alertgroup;
L
lgcareer 已提交
324

L
lgcareer 已提交
325 326
-- ut_dolphin_T_t_ds_resources
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_resources;
L
lgcareer 已提交
327
delimiter d//
L
lgcareer 已提交
328
CREATE PROCEDURE ut_dolphin_T_t_ds_resources()
L
lgcareer 已提交
329 330 331 332 333
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_resources'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
334
			ALTER TABLE t_escheduler_resources RENAME t_ds_resources;
L
lgcareer 已提交
335 336 337 338 339
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
340 341
CALL ut_dolphin_T_t_ds_resources;
DROP PROCEDURE ut_dolphin_T_t_ds_resources;
L
lgcareer 已提交
342

L
lgcareer 已提交
343 344
-- ut_dolphin_T_t_ds_schedules
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_schedules;
L
lgcareer 已提交
345
delimiter d//
L
lgcareer 已提交
346
CREATE PROCEDURE ut_dolphin_T_t_ds_schedules()
L
lgcareer 已提交
347 348 349 350 351
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_schedules'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
352
			ALTER TABLE t_escheduler_schedules RENAME t_ds_schedules;
L
lgcareer 已提交
353 354 355 356 357
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
358 359
CALL ut_dolphin_T_t_ds_schedules;
DROP PROCEDURE ut_dolphin_T_t_ds_schedules;
L
lgcareer 已提交
360

L
lgcareer 已提交
361 362
-- ut_dolphin_T_t_ds_session
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_session;
L
lgcareer 已提交
363
delimiter d//
L
lgcareer 已提交
364
CREATE PROCEDURE ut_dolphin_T_t_ds_session()
L
lgcareer 已提交
365 366 367 368 369
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_session'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
370
			ALTER TABLE t_escheduler_session RENAME t_ds_session;
L
lgcareer 已提交
371 372 373 374 375
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
376 377
CALL ut_dolphin_T_t_ds_session;
DROP PROCEDURE ut_dolphin_T_t_ds_session;
L
lgcareer 已提交
378

L
lgcareer 已提交
379 380
-- ut_dolphin_T_t_ds_task_instance
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_task_instance;
L
lgcareer 已提交
381
delimiter d//
L
lgcareer 已提交
382
CREATE PROCEDURE ut_dolphin_T_t_ds_task_instance()
L
lgcareer 已提交
383 384 385 386 387
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_task_instance'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
388
			ALTER TABLE t_escheduler_task_instance RENAME t_ds_task_instance;
L
lgcareer 已提交
389 390 391 392 393
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
394 395
CALL ut_dolphin_T_t_ds_task_instance;
DROP PROCEDURE ut_dolphin_T_t_ds_task_instance;
L
lgcareer 已提交
396

L
lgcareer 已提交
397 398
-- ut_dolphin_T_t_ds_tenant
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_tenant;
L
lgcareer 已提交
399
delimiter d//
L
lgcareer 已提交
400
CREATE PROCEDURE ut_dolphin_T_t_ds_tenant()
L
lgcareer 已提交
401 402 403 404 405
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_tenant'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
406
			ALTER TABLE t_escheduler_tenant RENAME t_ds_tenant;
L
lgcareer 已提交
407 408 409 410 411
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
412 413
CALL ut_dolphin_T_t_ds_tenant;
DROP PROCEDURE ut_dolphin_T_t_ds_tenant;
L
lgcareer 已提交
414

L
lgcareer 已提交
415 416
-- ut_dolphin_T_t_ds_udfs
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_udfs;
L
lgcareer 已提交
417
delimiter d//
L
lgcareer 已提交
418
CREATE PROCEDURE ut_dolphin_T_t_ds_udfs()
L
lgcareer 已提交
419 420 421 422 423
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_udfs'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
424
			ALTER TABLE t_escheduler_udfs RENAME t_ds_udfs;
L
lgcareer 已提交
425 426 427 428 429
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
430 431
CALL ut_dolphin_T_t_ds_udfs;
DROP PROCEDURE ut_dolphin_T_t_ds_udfs;
L
lgcareer 已提交
432

L
lgcareer 已提交
433 434
-- ut_dolphin_T_t_ds_user
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_user;
L
lgcareer 已提交
435
delimiter d//
L
lgcareer 已提交
436
CREATE PROCEDURE ut_dolphin_T_t_ds_user()
L
lgcareer 已提交
437 438 439 440 441
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_user'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
442
			ALTER TABLE t_escheduler_user RENAME t_ds_user;
L
lgcareer 已提交
443 444 445 446 447
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
448 449
CALL ut_dolphin_T_t_ds_user;
DROP PROCEDURE ut_dolphin_T_t_ds_user;
L
lgcareer 已提交
450

L
lgcareer 已提交
451 452
-- ut_dolphin_T_t_ds_version
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_version;
L
lgcareer 已提交
453
delimiter d//
L
lgcareer 已提交
454
CREATE PROCEDURE ut_dolphin_T_t_ds_version()
L
lgcareer 已提交
455 456 457 458 459
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_version'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
460
			ALTER TABLE t_escheduler_version RENAME t_ds_version;
L
lgcareer 已提交
461 462 463 464 465
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
466 467
CALL ut_dolphin_T_t_ds_version;
DROP PROCEDURE ut_dolphin_T_t_ds_version;
L
lgcareer 已提交
468

L
lgcareer 已提交
469 470
-- ut_dolphin_T_t_ds_worker_group
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_worker_group;
L
lgcareer 已提交
471
delimiter d//
L
lgcareer 已提交
472
CREATE PROCEDURE ut_dolphin_T_t_ds_worker_group()
L
lgcareer 已提交
473 474 475 476 477
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_worker_group'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
478
			ALTER TABLE t_escheduler_worker_group RENAME t_ds_worker_group;
L
lgcareer 已提交
479 480 481 482 483
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
484 485
CALL ut_dolphin_T_t_ds_worker_group;
DROP PROCEDURE ut_dolphin_T_t_ds_worker_group;
L
lgcareer 已提交
486

L
lgcareer 已提交
487 488
-- ut_dolphin_T_t_ds_worker_server
drop PROCEDURE if EXISTS ut_dolphin_T_t_ds_worker_server;
L
lgcareer 已提交
489
delimiter d//
L
lgcareer 已提交
490
CREATE PROCEDURE ut_dolphin_T_t_ds_worker_server()
L
lgcareer 已提交
491 492 493 494 495
	BEGIN
		IF EXISTS (SELECT 1 FROM information_schema.TABLES
			WHERE TABLE_NAME='t_escheduler_worker_server'
			AND TABLE_SCHEMA=(SELECT DATABASE()))
		THEN
L
lgcareer 已提交
496
			ALTER TABLE t_escheduler_worker_server RENAME t_ds_worker_server;
L
lgcareer 已提交
497 498 499 500 501
		END IF;
	END;
d//

delimiter ;
L
lgcareer 已提交
502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530
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
531
           WHERE TABLE_NAME='t_ds_process_definition'
L
lgcareer 已提交
532 533 534
           AND TABLE_SCHEMA=(SELECT DATABASE())
           AND COLUMN_NAME='desc')
   THEN
535
         ALTER TABLE t_ds_process_definition CHANGE COLUMN `desc` description text;
L
lgcareer 已提交
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623
       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;