1.7.1-1.7.2.sql 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. ALTER TABLE t_job DROP INDEX job_f_user_id;
  2. ALTER TABLE t_job DROP INDEX job_f_tag;
  3. ALTER TABLE t_job DROP INDEX job_f_initiator_role;
  4. ALTER TABLE t_job DROP INDEX job_f_initiator_party_id;
  5. ALTER TABLE t_job DROP INDEX job_f_status;
  6. ALTER TABLE t_job DROP INDEX job_f_status_code;
  7. ALTER TABLE t_job DROP INDEX job_f_is_initiator;
  8. ALTER TABLE t_job DROP INDEX job_f_ready_signal;
  9. ALTER TABLE t_job DROP INDEX job_f_cancel_signal;
  10. ALTER TABLE t_job DROP INDEX job_f_rerun_signal;
  11. ALTER TABLE t_job DROP INDEX job_f_engine_name;
  12. ALTER TABLE t_job DROP INDEX job_f_engine_type;
  13. ALTER TABLE t_job DROP INDEX job_f_cores;
  14. ALTER TABLE t_job DROP INDEX job_f_memory;
  15. ALTER TABLE t_job DROP INDEX job_f_remaining_cores;
  16. ALTER TABLE t_job DROP INDEX job_f_remaining_memory;
  17. ALTER TABLE t_job DROP INDEX job_f_resource_in_use;
  18. ALTER TABLE t_task DROP INDEX task_f_component_module;
  19. ALTER TABLE t_task DROP INDEX task_f_task_id;
  20. ALTER TABLE t_task DROP INDEX task_f_task_version;
  21. ALTER TABLE t_task DROP INDEX task_f_initiator_role;
  22. ALTER TABLE t_task DROP INDEX task_f_initiator_party_id;
  23. ALTER TABLE t_task DROP INDEX task_f_federated_mode;
  24. ALTER TABLE t_task DROP INDEX task_f_federated_status_collect_type;
  25. ALTER TABLE t_task DROP INDEX task_f_status_code;
  26. ALTER TABLE t_task DROP INDEX task_f_auto_retries;
  27. ALTER TABLE t_task DROP INDEX task_f_worker_id;
  28. ALTER TABLE t_task DROP INDEX task_f_party_status;
  29. DROP PROCEDURE IF EXISTS alter_trackingmetric;
  30. DELIMITER //
  31. CREATE PROCEDURE alter_trackingmetric()
  32. BEGIN
  33. DECLARE done BOOL DEFAULT FALSE;
  34. DECLARE date_ CHAR(8);
  35. DECLARE cur CURSOR FOR SELECT RIGHT(TABLE_NAME, 8) FROM INFORMATION_SCHEMA.TABLES
  36. WHERE TABLE_SCHEMA = (SELECT DATABASE()) AND TABLE_NAME LIKE 't\_tracking\_metric\_%';
  37. DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
  38. OPEN cur;
  39. loop_: LOOP
  40. FETCH cur INTO date_;
  41. IF done THEN
  42. LEAVE loop_;
  43. END IF;
  44. SET @sql = CONCAT(
  45. 'ALTER TABLE t_tracking_metric_', date_,
  46. ' DROP INDEX trackingmetric_', date_, '_f_metric_namespace,',
  47. ' DROP INDEX trackingmetric_', date_, '_f_metric_name,',
  48. ' DROP INDEX trackingmetric_', date_, '_f_type;'
  49. );
  50. PREPARE stmt FROM @sql;
  51. EXECUTE stmt;
  52. DEALLOCATE PREPARE stmt;
  53. END LOOP;
  54. CLOSE cur;
  55. END //
  56. DELIMITER ;
  57. CALL alter_trackingmetric();
  58. DROP PROCEDURE alter_trackingmetric;
  59. DROP PROCEDURE IF EXISTS alter_trackingoutputdatainfo;
  60. DELIMITER //
  61. CREATE PROCEDURE alter_trackingoutputdatainfo()
  62. BEGIN
  63. DECLARE done BOOL DEFAULT FALSE;
  64. DECLARE date_ CHAR(8);
  65. DECLARE cur CURSOR FOR SELECT RIGHT(TABLE_NAME, 8) FROM INFORMATION_SCHEMA.TABLES
  66. WHERE TABLE_SCHEMA = (SELECT DATABASE()) AND TABLE_NAME LIKE 't\_tracking\_output\_data\_info\_%';
  67. DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
  68. OPEN cur;
  69. loop_: LOOP
  70. FETCH cur INTO date_;
  71. IF done THEN
  72. LEAVE loop_;
  73. END IF;
  74. SET @sql = CONCAT('ALTER TABLE t_tracking_output_data_info_', date_, 'DROP INDEX trackingoutputdatainfo_', date_, '_f_task_version;');
  75. PREPARE stmt FROM @sql;
  76. EXECUTE stmt;
  77. DEALLOCATE PREPARE stmt;
  78. END LOOP;
  79. CLOSE cur;
  80. END //
  81. DELIMITER ;
  82. CALL alter_trackingoutputdatainfo();
  83. DROP PROCEDURE alter_trackingoutputdatainfo;
  84. ALTER TABLE t_machine_learning_model_info DROP INDEX machinelearningmodelinfo_f_role;
  85. ALTER TABLE t_machine_learning_model_info DROP INDEX machinelearningmodelinfo_f_party_id;
  86. ALTER TABLE t_machine_learning_model_info DROP INDEX machinelearningmodelinfo_f_initiator_role;
  87. ALTER TABLE t_machine_learning_model_info DROP INDEX machinelearningmodelinfo_f_initiator_party_id;
  88. ALTER TABLE t_data_table_tracking DROP INDEX datatabletracking_f_table_name;
  89. ALTER TABLE t_data_table_tracking DROP INDEX datatabletracking_f_table_namespace;
  90. ALTER TABLE t_cache_record DROP PRIMARY KEY, ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
  91. ALTER TABLE t_cache_record DROP INDEX cacherecord_f_task_id;
  92. DROP PROCEDURE IF EXISTS alter_componentsummary;
  93. DELIMITER //
  94. CREATE PROCEDURE alter_componentsummary()
  95. BEGIN
  96. DECLARE done BOOL DEFAULT FALSE;
  97. DECLARE date_ CHAR(8);
  98. DECLARE cur CURSOR FOR SELECT RIGHT(TABLE_NAME, 8) FROM INFORMATION_SCHEMA.TABLES
  99. WHERE TABLE_SCHEMA = (SELECT DATABASE()) AND TABLE_NAME LIKE 't\_component\_summary\_%';
  100. DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
  101. OPEN cur;
  102. loop_: LOOP
  103. FETCH cur INTO date_;
  104. IF done THEN
  105. LEAVE loop_;
  106. END IF;
  107. SET @sql = CONCAT('ALTER TABLE t_component_summary_', date_, ' DROP INDEX componentsummary_', date_, '_f_task_version;');
  108. PREPARE stmt FROM @sql;
  109. EXECUTE stmt;
  110. DEALLOCATE PREPARE stmt;
  111. END LOOP;
  112. CLOSE cur;
  113. END //
  114. DELIMITER ;
  115. CALL alter_componentsummary();
  116. DROP PROCEDURE alter_componentsummary;
  117. ALTER TABLE t_model_operation_log DROP INDEX modeloperationlog_f_model_id;
  118. ALTER TABLE t_model_operation_log DROP INDEX modeloperationlog_f_model_version;
  119. ALTER TABLE t_engine_registry DROP INDEX engineregistry_f_cores;
  120. ALTER TABLE t_engine_registry DROP INDEX engineregistry_f_memory;
  121. ALTER TABLE t_engine_registry DROP INDEX engineregistry_f_remaining_cores;
  122. ALTER TABLE t_engine_registry DROP INDEX engineregistry_f_remaining_memory;
  123. ALTER TABLE t_engine_registry DROP INDEX engineregistry_f_nodes;
  124. ALTER TABLE t_worker DROP INDEX workerinfo_f_task_id;
  125. ALTER TABLE t_worker DROP INDEX workerinfo_f_role;
  126. CREATE TABLE t_storage_connector (
  127. f_name VARCHAR(100) NOT NULL,
  128. f_create_time BIGINT,
  129. f_create_date DATETIME,
  130. f_update_time BIGINT,
  131. f_update_date DATETIME,
  132. f_engine VARCHAR(100) NOT NULL,
  133. f_connector_info LONGTEXT NOT NULL,
  134. PRIMARY KEY (f_name),
  135. INDEX storageconnectormodel_f_engine (f_engine)
  136. );
  137. ALTER TABLE t_storage_table_meta DROP INDEX storagetablemetamodel_f_engine;
  138. ALTER TABLE t_storage_table_meta DROP INDEX storagetablemetamodel_f_store_type;
  139. ALTER TABLE t_session_record DROP INDEX sessionrecord_f_engine_session_id;
  140. ALTER TABLE t_session_record DROP INDEX sessionrecord_f_manager_session_id;