dolphinscheduler_ddl.sql 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. -- uc_dolphin_T_t_ds_process_instance_A_host
  18. delimiter d//
  19. CREATE OR REPLACE FUNCTION uc_dolphin_T_t_ds_process_instance_A_host() RETURNS void AS $$
  20. BEGIN
  21. IF EXISTS (SELECT 1 FROM information_schema.COLUMNS
  22. WHERE TABLE_NAME='t_ds_process_instance'
  23. AND COLUMN_NAME ='host')
  24. THEN
  25. ALTER TABLE t_ds_process_instance ALTER COLUMN host type varchar(135);
  26. END IF;
  27. END;
  28. $$ LANGUAGE plpgsql;
  29. d//
  30. delimiter ;
  31. SELECT uc_dolphin_T_t_ds_process_instance_A_host();
  32. DROP FUNCTION IF EXISTS uc_dolphin_T_t_ds_process_instance_A_host();
  33. -- uc_dolphin_T_t_ds_task_instance_A_host
  34. delimiter d//
  35. CREATE OR REPLACE FUNCTION uc_dolphin_T_t_ds_task_instance_A_host() RETURNS void AS $$
  36. BEGIN
  37. IF EXISTS (SELECT 1 FROM information_schema.COLUMNS
  38. WHERE TABLE_NAME='t_ds_task_instance'
  39. AND COLUMN_NAME ='host')
  40. THEN
  41. ALTER TABLE t_ds_task_instance ALTER COLUMN host type varchar(135);
  42. END IF;
  43. END;
  44. $$ LANGUAGE plpgsql;
  45. d//
  46. delimiter ;
  47. SELECT uc_dolphin_T_t_ds_task_instance_A_host();
  48. DROP FUNCTION IF EXISTS uc_dolphin_T_t_ds_task_instance_A_host();