From 8bad30033c1612c79b9ce230a0cdd5ac36e1ee10 Mon Sep 17 00:00:00 2001 From: Lex Li Date: Mon, 6 May 2024 22:35:36 +0800 Subject: [PATCH] [Optimization] [SQL] Increase dinky_udf_manage table's class_name column's length from 50 to 100 (#3330) --- script/sql/dinky-mysql.sql | 2 +- script/sql/dinky-pg.sql | 2 +- .../upgrade/1.1.0_schema/mysql/dinky_ddl.sql | 26 +++++++++++++++++++ .../1.1.0_schema/postgre/dinky_ddl.sql | 23 ++++++++++++++++ 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 script/sql/upgrade/1.1.0_schema/mysql/dinky_ddl.sql create mode 100644 script/sql/upgrade/1.1.0_schema/postgre/dinky_ddl.sql diff --git a/script/sql/dinky-mysql.sql b/script/sql/dinky-mysql.sql index c2cc5d0785..866faccc35 100644 --- a/script/sql/dinky-mysql.sql +++ b/script/sql/dinky-mysql.sql @@ -2012,7 +2012,7 @@ drop table if exists `dinky_udf_manage`; CREATE TABLE `dinky_udf_manage` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(50) DEFAULT NULL COMMENT 'udf name', - `class_name` varchar(50) DEFAULT NULL COMMENT 'Complete class name', + `class_name` varchar(100) DEFAULT NULL COMMENT 'Complete class name', `task_id` int(11) DEFAULT NULL COMMENT 'task id', `resources_id` int(11) DEFAULT NULL COMMENT 'resources id', `enabled` tinyint(1) DEFAULT 1 COMMENT 'is enable', diff --git a/script/sql/dinky-pg.sql b/script/sql/dinky-pg.sql index eae8ddcebc..c28e21c238 100644 --- a/script/sql/dinky-pg.sql +++ b/script/sql/dinky-pg.sql @@ -4059,7 +4059,7 @@ CREATE TABLE dinky_udf_manage ( id SERIAL PRIMARY KEY NOT NULL, name VARCHAR(50), - class_name VARCHAR(50), + class_name VARCHAR(100), task_id INT, resources_id INT, enabled BOOLEAN DEFAULT TRUE, diff --git a/script/sql/upgrade/1.1.0_schema/mysql/dinky_ddl.sql b/script/sql/upgrade/1.1.0_schema/mysql/dinky_ddl.sql new file mode 100644 index 0000000000..5dd588dfa5 --- /dev/null +++ b/script/sql/upgrade/1.1.0_schema/mysql/dinky_ddl.sql @@ -0,0 +1,26 @@ +/* + * + * 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. + * + */ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- Increase class_name column's length from 50 to 100. +ALTER TABLE dinky_udf_manage CHANGE COLUMN class_name class_name VARCHAR(100) null DEFAULT null COMMENT 'Complete class name'; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/script/sql/upgrade/1.1.0_schema/postgre/dinky_ddl.sql b/script/sql/upgrade/1.1.0_schema/postgre/dinky_ddl.sql new file mode 100644 index 0000000000..47672c2d13 --- /dev/null +++ b/script/sql/upgrade/1.1.0_schema/postgre/dinky_ddl.sql @@ -0,0 +1,23 @@ +/* + * + * 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. + * + */ + +-- Increase class_name column's length from 50 to 100. +ALTER TABLE dinky_udf_manage ALTER COLUMN class_name TYPE VARCHAR(100); + +COMMENT ON COLUMN dinky_udf_manage.class_name IS 'Complete class name';