|
| 1 | +/* |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | + * contributor license agreements. See the NOTICE file distributed with |
| 4 | + * this work for additional information regarding copyright ownership. |
| 5 | + * The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | + * (the "License"); you may not use this file except in compliance with |
| 7 | + * the License. You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + * See the License for the specific language governing permissions and |
| 15 | + * limitations under the License. |
| 16 | +*/ |
| 17 | + |
| 18 | +drop PROCEDURE if EXISTS t_ds_process_definition_add_column; |
| 19 | +delimiter d// |
| 20 | +CREATE PROCEDURE t_ds_process_definition_add_column() |
| 21 | +BEGIN |
| 22 | + IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS |
| 23 | + WHERE TABLE_NAME='t_ds_process_definition' |
| 24 | + AND TABLE_SCHEMA=(SELECT DATABASE()) |
| 25 | + AND COLUMN_NAME='execution_type') |
| 26 | + THEN |
| 27 | +ALTER TABLE t_ds_process_definition ADD COLUMN `execution_type` tinyint(4) DEFAULT '0' COMMENT 'execution_type 0:parallel,1:serial wait,2:serial discard,3:serial priority'; |
| 28 | +END IF; |
| 29 | +END; |
| 30 | + d// |
| 31 | + delimiter ; |
| 32 | +CALL t_ds_process_definition_add_column; |
| 33 | +DROP PROCEDURE t_ds_process_definition_add_column; |
| 34 | + |
| 35 | + |
| 36 | +-- t_ds_process_definition_log_add_column |
| 37 | +drop PROCEDURE if EXISTS t_ds_process_definition_log_add_column; |
| 38 | +delimiter d// |
| 39 | +CREATE PROCEDURE t_ds_process_definition_log_add_column() |
| 40 | +BEGIN |
| 41 | + IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS |
| 42 | + WHERE TABLE_NAME='t_ds_process_definition_log' |
| 43 | + AND TABLE_SCHEMA=(SELECT DATABASE()) |
| 44 | + AND COLUMN_NAME='execution_type') |
| 45 | + THEN |
| 46 | +ALTER TABLE t_ds_process_definition_log ADD COLUMN `execution_type` tinyint(4) DEFAULT '0' COMMENT 'execution_type 0:parallel,1:serial wait,2:serial discard,3:serial priority'; |
| 47 | +END IF; |
| 48 | +END; |
| 49 | + d// |
| 50 | + delimiter ; |
| 51 | +CALL t_ds_process_definition_log_add_column; |
| 52 | +DROP PROCEDURE t_ds_process_definition_log_add_column; |
| 53 | + |
| 54 | + |
| 55 | +-- t_ds_process_instance_add_column |
| 56 | +drop PROCEDURE if EXISTS t_ds_process_instance_add_column; |
| 57 | +delimiter d// |
| 58 | +CREATE PROCEDURE t_ds_process_instance_add_column() |
| 59 | +BEGIN |
| 60 | + IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS |
| 61 | + WHERE TABLE_NAME='t_ds_process_instance' |
| 62 | + AND TABLE_SCHEMA=(SELECT DATABASE()) |
| 63 | + AND COLUMN_NAME='next_process_instance_id') |
| 64 | + THEN |
| 65 | +ALTER TABLE t_ds_process_instance ADD COLUMN `next_process_instance_id` int(11) DEFAULT '0' COMMENT 'serial queue next processInstanceId'; |
| 66 | +END IF; |
| 67 | +END; |
| 68 | + d// |
| 69 | + delimiter ; |
| 70 | +CALL t_ds_process_instance_add_column; |
| 71 | +DROP PROCEDURE t_ds_process_instance_add_column; |
0 commit comments