From a1608cce1969d673b7b3a47171d997c759449742 Mon Sep 17 00:00:00 2001 From: Avgustin Marinov Date: Mon, 9 Mar 2026 16:58:31 +0200 Subject: [PATCH] Remove DB migrations up to 1.0.0 baseline (#2953) For the existing DBs the 0.10.0 release shall be applied before hawkbit 1.0.0! Signed-off-by: Avgustin Marinov --- .../db/migration/H2/V1_0_1__init___H2.sql | 494 ---------- .../H2/V1_10_0__advanced_rolloutgroup__H2.sql | 4 - ...V1_10_1__consolidate_artifact_sha1__H2.sql | 4 - .../H2/V1_10_2__rollout_auto_start__H2.sql | 2 - .../V1_10_3__add_rollout_deleted_flag__H2.sql | 26 - .../H2/V1_11_0__drop_target_info__H2.sql | 31 - .../V1_11_1__target_filter_query_UQ___H2.sql | 2 - .../H2/V1_11_2__remove_unused_idexes___H2.sql | 8 - .../V1_11_3__add_module_md_targetvis__H2.sql | 1 - .../H2/V1_12_0__action_performance___H2.sql | 25 - ...e_length_of_target_attributes_key___H2.sql | 1 - ...2_11__add_auto_assign_action_type___H2.sql | 1 - ..._length_of_controller_id_and_name___H2.sql | 13 - .../V1_12_13__add_action_external_id___H2.sql | 4 - .../H2/V1_12_14__add_sha256_hash___H2.sql | 1 - .../H2/V1_12_15__add_weight___H2.sql | 3 - ...V1_12_16__add_action_initiated_by___H2.sql | 2 - ..._12_17__add_index_target_modified___H2.sql | 1 - .../H2/V1_12_18__add_target_type___H2.sql | 50 - .../V1_12_19__add_valid_flag_to_ds___H2.sql | 3 - .../H2/V1_12_1__missing_non_null___H2.sql | 12 - ..._12_20__add_encryption_flag_to_sm___H2.sql | 3 - ..._12_21__add_rollouts_status_index___H2.sql | 1 - ...2__change_target_type_name_length___H2.sql | 1 - .../V1_12_23__add_action_status_code___H2.sql | 2 - ...2_24__add_last_action_status_code___H2.sql | 1 - .../V1_12_25__add_confirmation_flag___H2.sql | 22 - ...12_26__add_access_control_context___H2.sql | 2 - ...1_12_27__target_type_inherit_type___H2.sql | 3 - .../H2/V1_12_28__add_dynamic_rollout___H2.sql | 9 - .../H2/V1_12_29__add_ds_sm_locked___H2.sql | 2 - .../V1_12_2__missing_non_null_enum___H2.sql | 3 - .../V1_12_30__add_distrubuted_lock___H2.sql | 8 - .../V1_12_31__add_type_to_ds_index___H2.sql | 2 - .../H2/V1_12_32__refactoring_rename___H2.sql | 73 -- .../H2/V1_12_33__add_group_to_target__H2.sql | 2 - .../V1_12_34__sm_type_min_artifacts__H2.sql | 4 - .../H2/V1_12_35__cleanup_prop_changes__H2.sql | 4 - .../db/migration/H2/V1_12_37__unify__H2.sql | 8 - .../H2/V1_12_38__varchar_to_clob___H2.sql | 3 - ...9__add_rollout_group_parent_index___H2.sql | 1 - .../H2/V1_12_3__cascade_delete___H2.sql | 1 - .../V1_12_4__add_maintenance_window___H2.sql | 3 - .../migration/H2/V1_12_6__add_index___H2.sql | 2 - ...12_7__add_rollout_approval_fields___H2.sql | 2 - ...ength_of_created_last_modified_by___H2.sql | 45 - .../H2/V1_12_9__add_target_metadata___H2.sql | 12 - ...0__update_target_info_for_message___H2.sql | 13 - .../H2/V1_4_0__cascade_delete___H2.sql | 69 -- .../H2/V1_4_1__cascade_delete___H2.sql | 6 - .../H2/V1_5_0__target_filter_query___H2.sql | 14 - .../H2/V1_6_0__rollout_management___H2.sql | 103 --- ...0__swmType_maxAssignment_greater_0__H2.sql | 1 - .../H2/V1_7_1__reduce_length_enums___H2.sql | 5 - .../H2/V1_8_0__auto_assign_ds_filter__H2.sql | 8 - .../H2/V1_8_1__cascade_delete___H2.sql | 27 - .../V1_8_2__remove_external_artifact___H2.sql | 2 - ...1_9_0__add_rollout_groups_created___H2.sql | 2 - .../migration/MYSQL/V1_0_1__init___MYSQL.sql | 494 ---------- .../V1_10_0__advanced_rolloutgroup__MYSQL.sql | 4 - ...10_1__consolidate_artifact_sha1__MYSQL.sql | 3 - .../V1_10_2__rollout_auto_start__MYSQL.sql | 2 - ..._10_3__add_rollout_deleted_flag__MYSQL.sql | 26 - .../V1_11_0__drop_target_info__MYSQL.sql | 31 - ...1_11_1__target_filter_query_UQ___MYSQL.sql | 2 - .../V1_11_2__remove_unused_idexes___MYSQL.sql | 8 - ...1_11_3__add_module_md_targetvis__MYSQL.sql | 1 - .../V1_12_0__action_performance___MYSQL.sql | 25 - ...ength_of_target_attributes_key___MYSQL.sql | 1 - ...1__add_auto_assign_action_type___MYSQL.sql | 1 - ...ngth_of_controller_id_and_name___MYSQL.sql | 13 - ..._12_13__add_action_external_id___MYSQL.sql | 4 - .../V1_12_14__add_sha256_hash___MYSQL.sql | 1 - .../MYSQL/V1_12_15__add_weight___MYSQL.sql | 3 - ...12_16__add_action_initiated_by___MYSQL.sql | 2 - ..._17__add_index_target_modified___MYSQL.sql | 1 - .../V1_12_18__add_target_type___MYSQL.sql | 47 - ...V1_12_19__add_valid_flag_to_ds___MYSQL.sql | 3 - .../V1_12_1__missing_non_null___MYSQL.sql | 12 - ..._20__add_encryption_flag_to_sm___MYSQL.sql | 3 - ..._21__add_rollouts_status_index___MYSQL.sql | 1 - ...change_target_type_name_length___MYSQL.sql | 1 - ..._12_23__add_action_status_code___MYSQL.sql | 2 - ...4__add_last_action_status_code___MYSQL.sql | 1 - ...1_12_25__add_confirmation_flag___MYSQL.sql | 22 - ...26__add_access_control_context___MYSQL.sql | 2 - ...2_27__target_type_inherit_type___MYSQL.sql | 3 - .../V1_12_28__add_dynamic_rollout___MYSQL.sql | 9 - .../V1_12_29__add_ds_sm_locked___MYSQL.sql | 2 - ...V1_12_2__missing_non_null_enum___MYSQL.sql | 3 - ...V1_12_30__add_distrubuted_lock___MYSQL.sql | 8 - ...V1_12_31__add_type_to_ds_index___MYSQL.sql | 2 - .../V1_12_32__refactoring_rename____MYSQL.sql | 63 -- .../V1_12_33__add_group_to_target__MYSQL.sql | 2 - ...V1_12_34__sm_type_min_artifacts__MYSQL.sql | 4 - .../V1_12_35__cleanup_prop_changes__MYSQL.sql | 4 - .../MYSQL/V1_12_37__unify__MYSQL.sql | 198 ---- .../V1_12_38__varchar_to_text___MYSQL.sql | 3 - ...add_rollout_group_parent_index___MYSQL.sql | 1 - .../MYSQL/V1_12_3__cascade_delete___MYSQL.sql | 1 - ...1_12_4__add_maintenance_window___MYSQL.sql | 3 - .../MYSQL/V1_12_6__add_index___MYSQL.sql | 2 - ...7__add_rollout_approval_fields___MYSQL.sql | 2 - ...th_of_created_last_modified_by___MYSQL.sql | 29 - .../V1_12_9__add_target_metadata___MYSQL.sql | 12 - ...update_target_info_for_message___MYSQL.sql | 8 - .../MYSQL/V1_4_0__cascade_delete___MYSQL.sql | 73 -- .../MYSQL/V1_4_1__cascade_delete___MYSQL.sql | 6 - .../V1_5_0__target_filter_query___MYSQL.sql | 15 - .../V1_6_0__rollout_management___MYSQL.sql | 103 --- ...swmType_maxAssignment_greater_0__MYSQL.sql | 1 - .../V1_7_1__reduce_length_enums___MYSQL.sql | 5 - .../V1_8_0__auto_assign_ds_filter__MYSQL.sql | 8 - .../MYSQL/V1_8_1__cascade_delete___MYSQL.sql | 27 - ..._8_2__remove_external_artifact___MYSQL.sql | 2 - ..._0__add_rollout_groups_created___MYSQL.sql | 2 - .../V1_12_15__baseline___POSTGRESQL.sql | 872 ------------------ ...__add_action_initiated_by___POSTGRESQL.sql | 7 - ...add_index_target_modified___POSTGRESQL.sql | 3 - ...V1_12_18__add_target_type___POSTGRESQL.sql | 65 -- ..._19__add_valid_flag_to_ds___POSTGRESQL.sql | 3 - ...add_encryption_flag_to_sm___POSTGRESQL.sql | 3 - ...add_rollouts_status_index___POSTGRESQL.sql | 3 - ...e_target_type_name_length___POSTGRESQL.sql | 1 - ...3__add_action_status_code___POSTGRESQL.sql | 4 - ...d_last_action_status_code___POSTGRESQL.sql | 1 - ...25__add_confirmation_flag___POSTGRESQL.sql | 26 - ...dd_access_control_context___POSTGRESQL.sql | 2 - ..._target_type_inherit_type___POSTGRESQL.sql | 3 - ...2_28__add_dynamic_rollout___POSTGRESQL.sql | 9 - ...1_12_29__add_ds_sm_locked___POSTGRESQL.sql | 2 - .../V1_12_30__add_indexes___POSTGRESQL.sql | 11 - ..._31__add_distrubuted_lock___POSTGRESQL.sql | 8 - ..._32__add_type_to_ds_index___POSTGRESQL.sql | 2 - ...12_33__refactoring_rename___POSTGRESQL.sql | 98 -- ...12_34__add_group_to_target__POSTGRESQL.sql | 2 - ..._35__sm_type_min_artifacts__POSTGRESQL.sql | 4 - ...2_36__cleanup_prop_changes__POSTGRESQL.sql | 4 - .../V1_12_37__unify__POSTGRESQL.sql | 115 --- ...V1_12_38__varchar_to_text___POSTGRESQL.sql | 5 - ...ollout_group_parent_index___POSTGRESQL.sql | 1 - 141 files changed, 3728 deletions(-) delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_0_1__init___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_0__advanced_rolloutgroup__H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_1__consolidate_artifact_sha1__H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_2__rollout_auto_start__H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_3__add_rollout_deleted_flag__H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_0__drop_target_info__H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_1__target_filter_query_UQ___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_2__remove_unused_idexes___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_3__add_module_md_targetvis__H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_0__action_performance___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_10__change_length_of_target_attributes_key___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_11__add_auto_assign_action_type___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_12__change_length_of_controller_id_and_name___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_13__add_action_external_id___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_14__add_sha256_hash___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_15__add_weight___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_16__add_action_initiated_by___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_17__add_index_target_modified___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_18__add_target_type___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_19__add_valid_flag_to_ds___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_1__missing_non_null___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_20__add_encryption_flag_to_sm___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_21__add_rollouts_status_index___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_22__change_target_type_name_length___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_23__add_action_status_code___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_24__add_last_action_status_code___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_25__add_confirmation_flag___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_26__add_access_control_context___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_27__target_type_inherit_type___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_28__add_dynamic_rollout___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_29__add_ds_sm_locked___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_2__missing_non_null_enum___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_30__add_distrubuted_lock___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_31__add_type_to_ds_index___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_32__refactoring_rename___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_33__add_group_to_target__H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_34__sm_type_min_artifacts__H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_35__cleanup_prop_changes__H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_37__unify__H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_38__varchar_to_clob___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_39__add_rollout_group_parent_index___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_3__cascade_delete___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_4__add_maintenance_window___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_6__add_index___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_7__add_rollout_approval_fields___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_8__change_length_of_created_last_modified_by___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_9__add_target_metadata___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_2_0__update_target_info_for_message___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_4_0__cascade_delete___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_4_1__cascade_delete___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_5_0__target_filter_query___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_6_0__rollout_management___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_7_0__swmType_maxAssignment_greater_0__H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_7_1__reduce_length_enums___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_8_0__auto_assign_ds_filter__H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_8_1__cascade_delete___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_8_2__remove_external_artifact___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_9_0__add_rollout_groups_created___H2.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_0_1__init___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_0__advanced_rolloutgroup__MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_1__consolidate_artifact_sha1__MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_2__rollout_auto_start__MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_3__add_rollout_deleted_flag__MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_0__drop_target_info__MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_1__target_filter_query_UQ___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_2__remove_unused_idexes___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_3__add_module_md_targetvis__MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_0__action_performance___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_10__change_length_of_target_attributes_key___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_11__add_auto_assign_action_type___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_12__change_length_of_controller_id_and_name___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_13__add_action_external_id___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_14__add_sha256_hash___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_15__add_weight___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_16__add_action_initiated_by___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_17__add_index_target_modified___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_18__add_target_type___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_19__add_valid_flag_to_ds___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_1__missing_non_null___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_20__add_encryption_flag_to_sm___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_21__add_rollouts_status_index___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_22__change_target_type_name_length___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_23__add_action_status_code___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_24__add_last_action_status_code___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_25__add_confirmation_flag___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_26__add_access_control_context___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_27__target_type_inherit_type___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_28__add_dynamic_rollout___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_29__add_ds_sm_locked___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_2__missing_non_null_enum___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_30__add_distrubuted_lock___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_31__add_type_to_ds_index___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_32__refactoring_rename____MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_33__add_group_to_target__MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_34__sm_type_min_artifacts__MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_35__cleanup_prop_changes__MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_37__unify__MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_38__varchar_to_text___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_39__add_rollout_group_parent_index___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_3__cascade_delete___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_4__add_maintenance_window___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_6__add_index___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_7__add_rollout_approval_fields___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_8__change_length_of_created_last_modified_by___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_9__add_target_metadata___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_2_0__update_target_info_for_message___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_4_0__cascade_delete___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_4_1__cascade_delete___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_5_0__target_filter_query___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_6_0__rollout_management___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_7_0__swmType_maxAssignment_greater_0__MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_7_1__reduce_length_enums___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_8_0__auto_assign_ds_filter__MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_8_1__cascade_delete___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_8_2__remove_external_artifact___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_9_0__add_rollout_groups_created___MYSQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_15__baseline___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_16__add_action_initiated_by___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_17__add_index_target_modified___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_18__add_target_type___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_19__add_valid_flag_to_ds___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_20__add_encryption_flag_to_sm___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_21__add_rollouts_status_index___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_22__change_target_type_name_length___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_23__add_action_status_code___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_24__add_last_action_status_code___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_25__add_confirmation_flag___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_26__add_access_control_context___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_27__target_type_inherit_type___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_28__add_dynamic_rollout___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_29__add_ds_sm_locked___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_30__add_indexes___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_31__add_distrubuted_lock___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_32__add_type_to_ds_index___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_33__refactoring_rename___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_34__add_group_to_target__POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_35__sm_type_min_artifacts__POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_36__cleanup_prop_changes__POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_37__unify__POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_38__varchar_to_text___POSTGRESQL.sql delete mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_39__add_rollout_group_parent_index___POSTGRESQL.sql diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_0_1__init___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_0_1__init___H2.sql deleted file mode 100644 index 5f022bb3c..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_0_1__init___H2.sql +++ /dev/null @@ -1,494 +0,0 @@ - - create table sp_action ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - action_type varchar(255) not null, - active boolean, - forced_time bigint, - status integer, - distribution_set bigint, - target bigint, - primary key (id) - ); - - create table sp_action_status ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - target_occurred_at bigint, - status integer, - action bigint not null, - primary key (id) - ); - - create table sp_action_status_messages ( - action_status_id bigint not null, - detail_message varchar(512) - ); - - create table sp_artifact ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - md5_hash varchar(32), - sha1_hash varchar(40), - file_size bigint, - provided_file_name varchar(256), - gridfs_file_name varchar(40), - software_module bigint not null, - primary key (id) - ); - - create table sp_base_software_module ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - version varchar(64) not null, - deleted boolean, - vendor varchar(256), - module_type bigint not null, - primary key (id) - ); - - create table sp_distribution_set ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - version varchar(64) not null, - complete boolean, - deleted boolean, - required_migration_step boolean, - ds_id bigint not null, - primary key (id) - ); - - create table sp_distribution_set_type ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - colour varchar(16), - deleted boolean, - type_key varchar(64) not null, - primary key (id) - ); - - create table sp_distributionset_tag ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - colour varchar(16), - primary key (id) - ); - - create table sp_ds_dstag ( - ds bigint not null, - TAG bigint not null, - primary key (ds, TAG) - ); - - create table sp_ds_metadata ( - meta_key varchar(128) not null, - meta_value varchar(4000), - ds_id bigint not null, - primary key (ds_id, meta_key) - ); - - create table sp_ds_module ( - ds_id bigint not null, - module_id bigint not null, - primary key (ds_id, module_id) - ); - - create table sp_ds_type_element ( - mandatory boolean, - distribution_set_type bigint not null, - software_module_type bigint not null, - primary key (distribution_set_type, software_module_type) - ); - - create table sp_external_artifact ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - md5_hash varchar(32), - sha1_hash varchar(40), - file_size bigint, - url_suffix varchar(512), - provider bigint not null, - software_module bigint not null, - primary key (id) - ); - - create table sp_external_provider ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - base_url varchar(512) not null, - default_url_suffix varchar(512), - primary key (id) - ); - - create table sp_software_module_type ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - colour varchar(16), - deleted boolean, - type_key varchar(64) not null, - max_ds_assignments integer not null, - primary key (id) - ); - - create table sp_sw_metadata ( - meta_key varchar(128) not null, - meta_value varchar(4000), - sw_id bigint not null, - primary key (meta_key, sw_id) - ); - - create table sp_target ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - controller_id varchar(64), - sec_token varchar(128) not null, - assigned_distribution_set bigint, - primary key (id) - ); - - create table sp_target_attributes ( - target_id bigint not null, - attribute_value varchar(128), - attribute_key varchar(32) not null, - primary key (target_id, attribute_key) - ); - - create table sp_target_info ( - target_id bigint not null, - install_date bigint, - ip_address varchar(46), - last_target_query bigint, - request_controller_attributes boolean not null, - update_status varchar(255) not null, - installed_distribution_set bigint, - primary key (target_id) - ); - - create table sp_target_tag ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - colour varchar(16), - primary key (id) - ); - - create table sp_target_target_tag ( - target bigint not null, - tag bigint not null, - primary key (target, tag) - ); - - create table sp_tenant ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - default_ds_type bigint not null, - primary key (id) - ); - - create table sp_tenant_configuration ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - conf_key varchar(128), - conf_value varchar(512), - primary key (id) - ); - - create index sp_idx_action_01 on sp_action (tenant, distribution_set); - - create index sp_idx_action_02 on sp_action (tenant, target, active); - - create index sp_idx_action_prim on sp_action (tenant, id); - - create index sp_idx_action_status_01 on sp_action_status (tenant, action); - - create index sp_idx_action_status_02 on sp_action_status (tenant, action, status); - - create index sp_idx_action_status_prim on sp_action_status (tenant, id); - - create index sp_idx_action_status_msgs_01 on sp_action_status_messages (action_status_id); - - create index sp_idx_artifact_01 on sp_artifact (tenant, software_module); - - create index sp_idx_artifact_prim on sp_artifact (tenant, id); - - alter table sp_base_software_module - add constraint uk_base_sw_mod unique (module_type, name, version, tenant); - - create index sp_idx_base_sw_module_01 on sp_base_software_module (tenant, deleted, name, version); - - create index sp_idx_base_sw_module_02 on sp_base_software_module (tenant, deleted, module_type); - - create index sp_idx_base_sw_module_prim on sp_base_software_module (tenant, id); - - alter table sp_distribution_set - add constraint uk_distrib_set unique (name, version, tenant); - - create index sp_idx_distribution_set_01 on sp_distribution_set (tenant, deleted, name, complete); - - create index sp_idx_distribution_set_02 on sp_distribution_set (tenant, required_migration_step); - - create index sp_idx_distribution_set_prim on sp_distribution_set (tenant, id); - - alter table sp_distribution_set_type - add constraint uk_dst_name unique (name, tenant); - - alter table sp_distribution_set_type - add constraint uk_dst_key unique (type_key, tenant); - - create index sp_idx_distribution_set_type_01 on sp_distribution_set_type (tenant, deleted); - - create index sp_idx_distribution_set_type_prim on sp_distribution_set_type (tenant, id); - - alter table sp_distributionset_tag - add constraint uk_ds_tag unique (name, tenant); - - create index sp_idx_distribution_set_tag_prim on sp_distributionset_tag (tenant, id); - - create index sp_idx_external_artifact_prim on sp_external_artifact (id, tenant); - - create index sp_idx_external_provider_prim on sp_external_provider (tenant, id); - - alter table sp_software_module_type - add constraint uk_smt_type_key unique (type_key, tenant); - - alter table sp_software_module_type - add constraint uk_smt_name unique (name, tenant); - - create index sp_idx_software_module_type_01 on sp_software_module_type (tenant, deleted); - - create index sp_idx_software_module_type_prim on sp_software_module_type (tenant, id); - - alter table sp_target - add constraint uk_tenant_controller_id unique (controller_id, tenant); - - create index sp_idx_target_01 on sp_target (tenant, name, assigned_distribution_set); - - create index sp_idx_target_02 on sp_target (tenant, name); - - create index sp_idx_target_03 on sp_target (tenant, controller_id, assigned_distribution_set); - - create index sp_idx_target_04 on sp_target (tenant, created_at); - - create index sp_idx_target_prim on sp_target (tenant, id); - - create index sp_idx_target_info_01 on sp_target_info (ip_address); - - create index sp_idx_target_info_02 on sp_target_info (target_id, update_status); - - alter table sp_target_tag - add constraint uk_targ_tag unique (name, tenant); - - create index sp_idx_target_tag_prim on sp_target_tag (tenant, id); - - alter table sp_tenant - add constraint uk_tenantmd_tenant unique (tenant); - - create index sp_idx_tenant_prim on sp_tenant (tenant, id); - - alter table sp_tenant_configuration - add constraint uk_tenant_key unique (conf_key, tenant); - - alter table sp_action - add constraint fk_action_ds - foreign key (distribution_set) - references sp_distribution_set; - - alter table sp_action - add constraint fk_targ_act_hist_targ - foreign key (target) - references sp_target; - - alter table sp_action_status - add constraint fk_act_stat_action - foreign key (action) - references sp_action; - - alter table sp_action_status_messages - add constraint fk_stat_msg_act_stat - foreign key (action_status_id) - references sp_action_status; - - alter table sp_artifact - add constraint fk_assigned_sm - foreign key (software_module) - references sp_base_software_module; - - alter table sp_base_software_module - add constraint fk_module_type - foreign key (module_type) - references sp_software_module_type; - - alter table sp_distribution_set - add constraint fk_ds_dstype_ds - foreign key (ds_id) - references sp_distribution_set_type; - - alter table sp_ds_dstag - add constraint fk_ds_dstag_tag - foreign key (TAG) - references sp_distributionset_tag; - - alter table sp_ds_dstag - add constraint fk_ds_dstag_ds - foreign key (ds) - references sp_distribution_set; - - alter table sp_ds_metadata - add constraint fk_metadata_ds - foreign key (ds_id) - references sp_distribution_set; - - alter table sp_ds_module - add constraint fk_ds_module_module - foreign key (module_id) - references sp_base_software_module; - - alter table sp_ds_module - add constraint fk_ds_module_ds - foreign key (ds_id) - references sp_distribution_set; - - alter table sp_ds_type_element - add constraint fk_ds_type_element_element - foreign key (distribution_set_type) - references sp_distribution_set_type; - - alter table sp_ds_type_element - add constraint fk_ds_type_element_smtype - foreign key (software_module_type) - references sp_software_module_type; - - alter table sp_external_artifact - add constraint fk_art_to_ext_provider - foreign key (provider) - references sp_external_provider; - - alter table sp_external_artifact - add constraint fk_external_assigned_sm - foreign key (software_module) - references sp_base_software_module; - - alter table sp_sw_metadata - add constraint fk_metadata_sw - foreign key (sw_id) - references sp_base_software_module; - - alter table sp_target - add constraint fk_target_assign_ds - foreign key (assigned_distribution_set) - references sp_distribution_set; - - alter table sp_target_attributes - add constraint fk_targ_attrib_target - foreign key (target_id) - references sp_target_info; - - alter table sp_target_info - add constraint fk_target_inst_ds - foreign key (installed_distribution_set) - references sp_distribution_set; - - alter table sp_target_info - add constraint fk_targ_stat_targ - foreign key (target_id) - references sp_target; - - alter table sp_target_target_tag - add constraint fk_targ_targtag_tag - foreign key (tag) - references sp_target_tag; - - alter table sp_target_target_tag - add constraint fk_targ_targtag_target - foreign key (target) - references sp_target; - - alter table sp_tenant - add constraint fk_tenant_md_default_ds_type - foreign key (default_ds_type) - references sp_distribution_set_type; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_0__advanced_rolloutgroup__H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_0__advanced_rolloutgroup__H2.sql deleted file mode 100644 index 7c4954ad8..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_0__advanced_rolloutgroup__H2.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE sp_rolloutgroup - ADD COLUMN target_percentage FLOAT; -ALTER TABLE sp_rolloutgroup - ADD COLUMN target_filter VARCHAR (1024); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_1__consolidate_artifact_sha1__H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_1__consolidate_artifact_sha1__H2.sql deleted file mode 100644 index 5611b8921..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_1__consolidate_artifact_sha1__H2.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE sp_artifact DROP COLUMN sha1_hash; -ALTER TABLE sp_artifact ALTER COLUMN gridfs_file_name RENAME TO sha1_hash; -ALTER TABLE sp_artifact ALTER sha1_hash varchar(40) not null; -CREATE INDEX sp_idx_artifact_02 ON sp_artifact (tenant, sha1_hash); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_2__rollout_auto_start__H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_2__rollout_auto_start__H2.sql deleted file mode 100644 index e946026f3..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_2__rollout_auto_start__H2.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_rollout - ADD COLUMN start_at BIGINT; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_3__add_rollout_deleted_flag__H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_3__add_rollout_deleted_flag__H2.sql deleted file mode 100644 index cdfafc74f..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_10_3__add_rollout_deleted_flag__H2.sql +++ /dev/null @@ -1,26 +0,0 @@ -ALTER TABLE sp_rollout ADD COLUMN deleted BOOLEAN; - -UPDATE sp_rollout SET deleted = 0; - -ALTER TABLE sp_action ALTER target BIGINT NOT NULL; -ALTER TABLE sp_action ALTER distribution_set BIGINT NOT NULL; -ALTER TABLE sp_action ALTER status INTEGER NOT NULL; -ALTER TABLE sp_action_status ALTER status INTEGER NOT NULL; -ALTER TABLE sp_rollout ALTER status INTEGER NOT NULL; -ALTER TABLE sp_rollout ALTER distribution_set BIGINT NOT NULL; -ALTER TABLE sp_rolloutgroup ALTER rollout BIGINT NOT NULL; -ALTER TABLE sp_rolloutgroup ALTER status INTEGER NOT NULL; - -ALTER TABLE sp_ds_type_element DROP CONSTRAINT fk_ds_type_element_element; -ALTER TABLE sp_ds_type_element - ADD CONSTRAINT fk_ds_type_element_element - FOREIGN KEY (distribution_set_type) - REFERENCES sp_distribution_set_type (id) - ON DELETE CASCADE; - -ALTER TABLE sp_ds_type_element DROP CONSTRAINT fk_ds_type_element_smtype; -ALTER TABLE sp_ds_type_element - ADD CONSTRAINT fk_ds_type_element_smtype - FOREIGN KEY (software_module_type) - REFERENCES sp_software_module_type (id) - ON DELETE CASCADE; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_0__drop_target_info__H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_0__drop_target_info__H2.sql deleted file mode 100644 index beddebc02..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_0__drop_target_info__H2.sql +++ /dev/null @@ -1,31 +0,0 @@ -ALTER TABLE sp_target ADD COLUMN install_date bigint; -ALTER TABLE sp_target ADD COLUMN address varchar(512); -ALTER TABLE sp_target ADD COLUMN last_target_query bigint; -ALTER TABLE sp_target ADD COLUMN request_controller_attributes bit not null; -ALTER TABLE sp_target ADD COLUMN update_status varchar(16) not null; -ALTER TABLE sp_target ADD COLUMN installed_distribution_set bigint; - -UPDATE sp_target t SET install_date=(SELECT i.install_date FROM sp_target_info i WHERE t.id = i.target_id); -UPDATE sp_target t SET address=(SELECT i.address FROM sp_target_info i WHERE t.id = i.target_id); -UPDATE sp_target t SET last_target_query=(SELECT i.last_target_query FROM sp_target_info i WHERE t.id = i.target_id); -UPDATE sp_target t SET request_controller_attributes=(SELECT i.request_controller_attributes FROM sp_target_info i WHERE t.id = i.target_id); -UPDATE sp_target t SET update_status=(SELECT i.update_status FROM sp_target_info i WHERE t.id = i.target_id); -UPDATE sp_target t SET installed_distribution_set=(SELECT i.installed_distribution_set FROM sp_target_info i WHERE t.id = i.target_id); - -ALTER TABLE sp_target_attributes DROP CONSTRAINT fk_targ_attrib_target; -ALTER TABLE sp_target_attributes - ADD CONSTRAINT fk_targ_attrib_target - FOREIGN KEY (target_id) - REFERENCES sp_target (id) - ON DELETE cascade; - -ALTER TABLE sp_target_info DROP CONSTRAINT fk_target_inst_ds; -ALTER TABLE sp_target - ADD CONSTRAINT fk_target_inst_ds - FOREIGN KEY (installed_distribution_set) - REFERENCES sp_distribution_set (id); - -ALTER TABLE sp_target_info DROP CONSTRAINT fk_targ_stat_targ; -DROP INDEX sp_idx_target_info_02; - -DROP TABLE sp_target_info; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_1__target_filter_query_UQ___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_1__target_filter_query_UQ___H2.sql deleted file mode 100644 index f494313a8..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_1__target_filter_query_UQ___H2.sql +++ /dev/null @@ -1,2 +0,0 @@ - alter table sp_target_filter_query - add constraint uk_tenant_custom_filter_name unique (name, tenant); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_2__remove_unused_idexes___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_2__remove_unused_idexes___H2.sql deleted file mode 100644 index 5e9dd339d..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_2__remove_unused_idexes___H2.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP INDEX sp_idx_action_status_01; -DROP INDEX sp_idx_rollout_01; -DROP INDEX sp_idx_rolloutgroup_01; -DROP INDEX sp_idx_target_02; -DROP INDEX sp_idx_target_filter_query_01; -DROP INDEX sp_idx_distribution_set_01; -DROP INDEX sp_idx_distribution_set_02; -CREATE INDEX sp_idx_distribution_set_01 ON sp_distribution_set (tenant, deleted, complete); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_3__add_module_md_targetvis__H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_3__add_module_md_targetvis__H2.sql deleted file mode 100644 index 2d5dfc8c4..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_11_3__add_module_md_targetvis__H2.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE sp_sw_metadata ADD COLUMN target_visible boolean; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_0__action_performance___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_0__action_performance___H2.sql deleted file mode 100644 index 02b4199c9..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_0__action_performance___H2.sql +++ /dev/null @@ -1,25 +0,0 @@ -ALTER TABLE sp_action ADD COLUMN action_type_new integer not null; -UPDATE sp_action SET action_type_new = -CASE WHEN (action_type = 'SOFT') THEN 1 - WHEN (action_type = 'TIMEFORCED') THEN 2 - ELSE 0 END; -ALTER TABLE sp_action DROP COLUMN action_type; -ALTER TABLE sp_action ALTER COLUMN action_type_new RENAME TO action_type; - -ALTER TABLE sp_rollout ADD COLUMN action_type_new integer not null; -UPDATE sp_rollout SET action_type_new = -CASE WHEN (action_type = 'SOFT') THEN 1 - WHEN (action_type = 'TIMEFORCED') THEN 2 - ELSE 0 END; -ALTER TABLE sp_rollout DROP COLUMN action_type; -ALTER TABLE sp_rollout ALTER COLUMN action_type_new RENAME to action_type; - -ALTER TABLE sp_target ADD COLUMN update_status_new integer not null; -UPDATE sp_target SET update_status_new = -CASE WHEN (update_status = 'IN_SYNC') THEN 1 - WHEN (update_status = 'PENDING') THEN 2 - WHEN (update_status = 'ERROR') THEN 3 - WHEN (update_status = 'REGISTERED') THEN 4 - ELSE 0 END; -ALTER TABLE sp_target DROP COLUMN update_status; -ALTER TABLE sp_target ALTER COLUMN update_status_new RENAME TO update_status; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_10__change_length_of_target_attributes_key___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_10__change_length_of_target_attributes_key___H2.sql deleted file mode 100644 index 55f3eed5e..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_10__change_length_of_target_attributes_key___H2.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE sp_target_attributes ALTER COLUMN attribute_key VARCHAR(128); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_11__add_auto_assign_action_type___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_11__add_auto_assign_action_type___H2.sql deleted file mode 100644 index 16cb03ef2..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_11__add_auto_assign_action_type___H2.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE sp_target_filter_query ADD COLUMN auto_assign_action_type integer; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_12__change_length_of_controller_id_and_name___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_12__change_length_of_controller_id_and_name___H2.sql deleted file mode 100644 index b9b5e2a28..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_12__change_length_of_controller_id_and_name___H2.sql +++ /dev/null @@ -1,13 +0,0 @@ -ALTER TABLE sp_distribution_set ALTER COLUMN name VARCHAR(128); -ALTER TABLE sp_distribution_set_type ALTER COLUMN name VARCHAR(128); -ALTER TABLE sp_distributionset_tag ALTER COLUMN name VARCHAR(128); -ALTER TABLE sp_base_software_module ALTER COLUMN name VARCHAR(128); -ALTER TABLE sp_rollout ALTER COLUMN name VARCHAR(128); -ALTER TABLE sp_rolloutgroup ALTER COLUMN name VARCHAR(128); -ALTER TABLE sp_software_module_type ALTER COLUMN name VARCHAR(128); -ALTER TABLE sp_target ALTER COLUMN name VARCHAR(128); -ALTER TABLE sp_target_filter_query ALTER COLUMN name VARCHAR(128); -ALTER TABLE sp_target_tag ALTER COLUMN name VARCHAR(128); - - -ALTER TABLE sp_target ALTER COLUMN controller_id VARCHAR(256); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_13__add_action_external_id___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_13__add_action_external_id___H2.sql deleted file mode 100644 index 8dbda293f..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_13__add_action_external_id___H2.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE sp_action ADD COLUMN external_ref VARCHAR(512); -CREATE INDEX sp_idx_action_external_ref ON sp_action (external_ref); - - \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_14__add_sha256_hash___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_14__add_sha256_hash___H2.sql deleted file mode 100644 index ca7e53fce..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_14__add_sha256_hash___H2.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE sp_artifact ADD COLUMN sha256_hash CHAR(64); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_15__add_weight___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_15__add_weight___H2.sql deleted file mode 100644 index 9eaad20e1..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_15__add_weight___H2.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_action ADD weight INT; -ALTER TABLE sp_rollout ADD weight INT; -ALTER TABLE sp_target_filter_query ADD auto_assign_weight INT; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_16__add_action_initiated_by___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_16__add_action_initiated_by___H2.sql deleted file mode 100644 index d0b559b61..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_16__add_action_initiated_by___H2.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_action ADD COLUMN initiated_by VARCHAR(64) NOT NULL; -ALTER TABLE sp_target_filter_query ADD COLUMN auto_assign_initiated_by VARCHAR(64); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_17__add_index_target_modified___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_17__add_index_target_modified___H2.sql deleted file mode 100644 index ac70ee7f0..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_17__add_index_target_modified___H2.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX sp_idx_target_05 ON sp_target (tenant, last_modified_at); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_18__add_target_type___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_18__add_target_type___H2.sql deleted file mode 100644 index 023b8fd96..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_18__add_target_type___H2.sql +++ /dev/null @@ -1,50 +0,0 @@ -create table sp_target_type -( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(64), - last_modified_at bigint, - last_modified_by varchar(64), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - colour varchar(16), - primary key (id) -); - -create table sp_target_type_ds_type_relation -( - target_type bigint not null, - distribution_set_type bigint not null, - primary key (target_type, distribution_set_type) -); - -alter table sp_target_type - add constraint uk_target_type_name unique (name, tenant); - -create index sp_idx_target_type_prim on sp_target_type (tenant, id); - -alter table sp_target - add column target_type bigint; - -alter table sp_target - add constraint fk_target_relation_target_type - foreign key (target_type) - references sp_target_type - on delete set null; - -alter table sp_target_type_ds_type_relation - add constraint fk_target_type_relation_target_type - foreign key (target_type) - references sp_target_type - on delete cascade; - -alter table sp_target_type_ds_type_relation - add constraint fk_target_type_relation_ds_type - foreign key (distribution_set_type) - references sp_distribution_set_type - on delete cascade; - - - diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_19__add_valid_flag_to_ds___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_19__add_valid_flag_to_ds___H2.sql deleted file mode 100644 index 3ab0e7502..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_19__add_valid_flag_to_ds___H2.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_distribution_set ADD COLUMN valid BOOLEAN; - -UPDATE sp_distribution_set SET valid = 1; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_1__missing_non_null___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_1__missing_non_null___H2.sql deleted file mode 100644 index 91a3c26a4..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_1__missing_non_null___H2.sql +++ /dev/null @@ -1,12 +0,0 @@ -ALTER TABLE sp_action_status_messages ALTER detail_message varchar(512) not null; -ALTER TABLE sp_action ALTER distribution_set bigint not null; -ALTER TABLE sp_action ALTER target bigint not null; -ALTER TABLE sp_action ALTER status integer not null; -ALTER TABLE sp_action_status ALTER target_occurred_at bigint not null; -ALTER TABLE sp_action_status ALTER status integer not null; -ALTER TABLE sp_rollout ALTER distribution_set bigint not null; -ALTER TABLE sp_rollout ALTER status integer not null; -ALTER TABLE sp_rolloutgroup ALTER rollout bigint not null; -ALTER TABLE sp_rolloutgroup ALTER status integer not null; -ALTER TABLE sp_artifact ALTER sha1_hash varchar(40) not null; -ALTER TABLE sp_target ALTER controller_id varchar(64) not null; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_20__add_encryption_flag_to_sm___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_20__add_encryption_flag_to_sm___H2.sql deleted file mode 100644 index 9249d14a1..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_20__add_encryption_flag_to_sm___H2.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_base_software_module ADD COLUMN encrypted BOOLEAN; - -UPDATE sp_base_software_module SET encrypted = 0; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_21__add_rollouts_status_index___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_21__add_rollouts_status_index___H2.sql deleted file mode 100644 index 4d845ed84..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_21__add_rollouts_status_index___H2.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX sp_idx_rollout_status_tenant ON sp_rollout (tenant, status); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_22__change_target_type_name_length___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_22__change_target_type_name_length___H2.sql deleted file mode 100644 index 9e3559d80..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_22__change_target_type_name_length___H2.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE sp_target_type ALTER COLUMN name VARCHAR (128); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_23__add_action_status_code___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_23__add_action_status_code___H2.sql deleted file mode 100644 index 2e4caf07a..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_23__add_action_status_code___H2.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_action_status ADD column code integer; -CREATE INDEX sp_idx_action_status_03 ON sp_action_status (tenant, code); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_24__add_last_action_status_code___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_24__add_last_action_status_code___H2.sql deleted file mode 100644 index f92ba4675..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_24__add_last_action_status_code___H2.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE sp_action ADD column last_action_status_code integer; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_25__add_confirmation_flag___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_25__add_confirmation_flag___H2.sql deleted file mode 100644 index 8249c85d4..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_25__add_confirmation_flag___H2.sql +++ /dev/null @@ -1,22 +0,0 @@ -ALTER TABLE sp_rolloutgroup ADD column confirmation_required BOOLEAN; -UPDATE sp_rolloutgroup SET confirmation_required = 0; - -ALTER TABLE sp_target_filter_query ADD column confirmation_required BOOLEAN; -UPDATE sp_target_filter_query SET confirmation_required = 0; - -create table sp_target_conf_status -( - id bigint not null auto_increment, - target_id bigint not null, - initiator varchar(64), - remark VARCHAR(512), - created_at bigint, - created_by varchar(64), - last_modified_at bigint, - last_modified_by varchar(64), - optlock_revision bigint, - tenant varchar(40) not null, - primary key (id) -); -ALTER TABLE sp_target_conf_status - ADD CONSTRAINT fk_target_auto_conf FOREIGN KEY (target_id) REFERENCES sp_target (id) ON DELETE CASCADE; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_26__add_access_control_context___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_26__add_access_control_context___H2.sql deleted file mode 100644 index ccf16963e..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_26__add_access_control_context___H2.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_target_filter_query ADD COLUMN access_control_context VARCHAR(4096); -ALTER TABLE sp_rollout ADD COLUMN access_control_context VARCHAR(4096); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_27__target_type_inherit_type___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_27__target_type_inherit_type___H2.sql deleted file mode 100644 index 86e3350b8..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_27__target_type_inherit_type___H2.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_target_type ADD COLUMN type_key VARCHAR (64) NOT NULL DEFAULT ('_'); -UPDATE sp_target_type SET type_key = name; -ALTER TABLE sp_target_type ADD CONSTRAINT uk_target_type_key UNIQUE (type_key, tenant); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_28__add_dynamic_rollout___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_28__add_dynamic_rollout___H2.sql deleted file mode 100644 index f392ccd87..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_28__add_dynamic_rollout___H2.sql +++ /dev/null @@ -1,9 +0,0 @@ -ALTER TABLE sp_rollout ADD COLUMN is_dynamic BOOLEAN; -ALTER TABLE sp_rolloutgroup ADD COLUMN is_dynamic BOOLEAN NOT NULL DEFAULT false; - -UPDATE sp_rollout SET weight = 1000 WHERE weight IS NULL; -UPDATE sp_action SET weight = 1000 WHERE weight IS NULL; -UPDATE sp_target_filter_query SET auto_assign_weight = 1000 WHERE auto_assign_weight IS NULL; -ALTER TABLE sp_rollout ALTER COLUMN weight INT NOT NULL; -ALTER TABLE sp_action ALTER COLUMN weight INT NOT NULL; -ALTER TABLE sp_target_filter_query ALTER COLUMN auto_assign_weight INT NOT NULL; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_29__add_ds_sm_locked___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_29__add_ds_sm_locked___H2.sql deleted file mode 100644 index c5c0de6fb..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_29__add_ds_sm_locked___H2.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_base_software_module ADD COLUMN locked BOOLEAN NOT NULL DEFAULT true; -ALTER TABLE sp_distribution_set ADD COLUMN locked BOOLEAN NOT NULL DEFAULT true; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_2__missing_non_null_enum___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_2__missing_non_null_enum___H2.sql deleted file mode 100644 index 3c767e8c7..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_2__missing_non_null_enum___H2.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_target ALTER update_status integer not null; -ALTER TABLE sp_rollout ALTER action_type integer not null; -ALTER TABLE sp_action ALTER action_type integer not null; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_30__add_distrubuted_lock___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_30__add_distrubuted_lock___H2.sql deleted file mode 100644 index e5fc064a9..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_30__add_distrubuted_lock___H2.sql +++ /dev/null @@ -1,8 +0,0 @@ --- Table and fields in upper case as Spring queries it that way -CREATE TABLE SP_LOCK ( - LOCK_KEY CHAR(36) NOT NULL, - REGION VARCHAR(100) NOT NULL, - CLIENT_ID CHAR(36), - CREATED_DATE TIMESTAMP NOT NULL, - constraint SP_LOCK_PK primary key (LOCK_KEY, REGION) -); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_31__add_type_to_ds_index___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_31__add_type_to_ds_index___H2.sql deleted file mode 100644 index 0e602804e..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_31__add_type_to_ds_index___H2.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table sp_distribution_set drop constraint uk_distrib_set; -alter table sp_distribution_set add constraint uk_distrib_set unique (tenant, name, version, ds_id); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_32__refactoring_rename___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_32__refactoring_rename___H2.sql deleted file mode 100644 index 0f09c63f9..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_32__refactoring_rename___H2.sql +++ /dev/null @@ -1,73 +0,0 @@ --- rename tables -alter table sp_base_software_module rename to sp_software_module; -alter table sp_distributionset_tag rename to sp_distribution_set_tag; -alter table sp_ds_dstag rename to sp_ds_tag; -alter table sp_ds_module rename to sp_ds_sm; -alter table sp_rolloutgroup rename to sp_rollout_group; -alter table sp_rollouttargetgroup rename to sp_rollout_target_group; -alter table sp_sw_metadata rename to sp_sm_metadata; -alter table sp_target_type_ds_type_relation rename to sp_target_type_ds_type; --- rename columns -alter table sp_action rename column rolloutgroup to rollout_group; -alter table sp_action_status_messages rename column action_status_id to action_status; -alter table sp_distribution_set rename column ds_id to ds_type; -alter table sp_ds_sm rename column module_id to sm_id; -alter table sp_ds_metadata rename column ds_id to ds; -alter table sp_ds_tag rename column TAG to tag; -alter table sp_rollout_group rename column parent_id to parent; -alter table sp_rollout_target_group rename column target_id to target; -alter table sp_rollout_target_group rename column rolloutgroup_id to rollout_group; -alter table sp_sm_metadata rename column sw_id to sm; -alter table sp_software_module rename column module_type to sm_type; -alter table sp_target_attributes rename column target_id to target; -alter table sp_target_conf_status rename column target_id to target; -alter table sp_target_metadata rename column target_id to target; --- rename constraints -alter table sp_action rename constraint fk_action_ds to fk_action_distribution_set; -alter table sp_action rename constraint fk_action_rolloutgroup to fk_action_rollout_group; -alter table sp_action rename constraint fk_targ_act_hist_targ to fk_action_target; -alter table sp_action_status rename constraint fk_act_stat_action to fk_action_status_action; -alter table sp_action_status_messages rename constraint fk_stat_msg_act_stat to fk_action_status_messages_action_status; -alter table sp_artifact rename constraint fk_assigned_sm to fk_artifact_software_module; -alter table sp_distribution_set rename constraint uk_distrib_set to uk_distribution_set; -alter table sp_distribution_set rename constraint fk_ds_dstype_ds to fk_distribution_set_ds_type; -alter table sp_distribution_set_tag rename constraint uk_ds_tag to uk_distribution_set_tag; -alter table sp_distribution_set_type rename constraint uk_dst_key to uk_distribution_set_type_type_key; -alter table sp_distribution_set_type rename constraint uk_dst_name to uk_distribution_set_type_name; -alter table sp_ds_metadata rename constraint fk_metadata_ds to fk_ds_metadata_ds; -alter table sp_ds_sm rename constraint fk_ds_module_ds to fk_ds_sm_ds_id; -alter table sp_ds_sm rename constraint fk_ds_module_module to fk_ds_sm_sm_id; -alter table sp_ds_tag rename constraint fk_ds_dstag_ds to fk_ds_tag_ds; -alter table sp_ds_tag rename constraint fk_ds_dstag_tag to fk_ds_tag_tag; -alter table sp_ds_type_element rename constraint fk_ds_type_element_element to fk_ds_type_element_distribution_set_type; -alter table sp_ds_type_element rename constraint fk_ds_type_element_smtype to fk_ds_type_element_software_module_type; -alter table sp_rollout rename constraint fk_rollout_ds to fk_rollout_distribution_set; -alter table sp_rollout_group rename constraint uk_rolloutgroup to uk_rollout_group; -alter table sp_rollout_group rename constraint fk_rolloutgroup_rollout to fk_rollout_group_rollout; -alter table sp_rollout_target_group rename constraint fk_rollouttargetgroup_rolloutgroup to fk_rollout_target_group_rollout_group; -alter table sp_sm_metadata rename constraint fk_metadata_sw to fk_sm_metadata_sm; -alter table sp_software_module rename constraint uk_base_sw_mod to uk_software_module; -alter table sp_software_module rename constraint fk_module_type to fk_software_module_sm_type; -alter table sp_software_module_type rename constraint uk_smt_type_key to uk_software_module_type_type_key; -alter table sp_software_module_type rename constraint uk_smt_name to uk_software_module_type_name; -alter table sp_rollout_target_group rename constraint fk_rollouttargetgroup_target to fk_rollout_target_group_target; -alter table sp_target rename constraint uk_tenant_controller_id to uk_target_controller_id; -alter table sp_target_attributes rename constraint fk_targ_attrib_target to fk_target_attributes_target; -alter table sp_target_conf_status rename constraint fk_target_auto_conf to fk_target_conf_status_target; -alter table sp_target_filter_query rename constraint uk_tenant_custom_filter_name to uk_target_filter_query; -alter table sp_target_filter_query rename constraint fk_filter_auto_assign_ds to fk_target_filter_query_auto_assign_distribution_set; -alter table sp_target_metadata rename constraint fk_metadata_target to fk_target_metadata_target; -alter table sp_target_tag rename constraint uk_targ_tag to uk_target_tag; -alter table sp_target_target_tag rename constraint fk_targ_targtag_target to fk_target_target_tag_target; -alter table sp_target_target_tag rename constraint fk_targ_targtag_tag to fk_target_target_tag_tag; -alter table sp_target_type rename constraint uk_target_type_name to uk_target_name; -alter table sp_target_type_ds_type rename constraint fk_target_type_relation_target_type to fk_target_type_ds_type_target_type; -alter table sp_target_type_ds_type rename constraint fk_target_type_relation_ds_type to fk_target_type_ds_type_distribution_set_type; -alter table sp_tenant rename constraint uk_tenantmd_tenant to uk_tenant; -alter table sp_tenant rename constraint fk_tenant_md_default_ds_type to fk_sp_tenant_default_ds_type; -alter table sp_tenant_configuration rename constraint uk_tenant_key to uk_tenant_configuration; --- rename indexes -alter index sp_idx_action_status_msgs_01 rename to fk_action_status_messages_action_status; -alter index sp_idx_base_sw_module_prim rename to sp_idx_software_module_prim; -alter index sp_idx_base_sw_module_01 rename to sp_idx_software_module_01; -alter index sp_idx_base_sw_module_02 rename to sp_idx_software_module_02; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_33__add_group_to_target__H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_33__add_group_to_target__H2.sql deleted file mode 100644 index 6c776ac98..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_33__add_group_to_target__H2.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_target ADD COLUMN target_group VARCHAR(256); -CREATE INDEX sp_idx_target_group ON sp_target (tenant, target_group); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_34__sm_type_min_artifacts__H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_34__sm_type_min_artifacts__H2.sql deleted file mode 100644 index cb4664375..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_34__sm_type_min_artifacts__H2.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE sp_software_module_type ADD COLUMN min_artifacts integer default 0 NOT NULL; -DROP INDEX sp_idx_distribution_set_01; -CREATE INDEX sp_idx_distribution_set_01 ON sp_distribution_set (tenant, deleted); -ALTER TABLE sp_distribution_set DROP COLUMN complete; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_35__cleanup_prop_changes__H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_35__cleanup_prop_changes__H2.sql deleted file mode 100644 index 37995ea60..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_35__cleanup_prop_changes__H2.sql +++ /dev/null @@ -1,4 +0,0 @@ -DELETE FROM sp_tenant_configuration WHERE conf_key='action.cleanup.enabled'; -UPDATE sp_tenant_configuration SET conf_key='action.cleanup.auto.expiry' WHERE conf_key='action.cleanup.actionExpiry'; -UPDATE sp_tenant_configuration SET conf_key='action.cleanup.auto.status' WHERE conf_key='action.cleanup.actionStatus'; -UPDATE sp_tenant_configuration SET conf_key='actions.cleanup.onQuotaHit.percent' WHERE conf_key='action.cleanup.onQuotaHit.percent'; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_37__unify__H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_37__unify__H2.sql deleted file mode 100644 index 6ec2c760c..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_37__unify__H2.sql +++ /dev/null @@ -1,8 +0,0 @@ --- remove unnecessary / faulty default for a tenant's scope unique key -ALTER TABLE sp_target_type ALTER COLUMN type_key DROP DEFAULT; - --- remove unused column -ALTER TABLE sp_rollout DROP COLUMN group_theshold; - --- rename index -ALTER TABLE sp_tenant RENAME CONSTRAINT fk_sp_tenant_default_ds_type TO fk_tenant_default_ds_type; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_38__varchar_to_clob___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_38__varchar_to_clob___H2.sql deleted file mode 100644 index d509bc8a6..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_38__varchar_to_clob___H2.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_tenant_configuration ALTER COLUMN conf_value CLOB NOT NULL; -ALTER TABLE sp_target_filter_query ALTER COLUMN access_control_context CLOB; -ALTER TABLE sp_rollout ALTER COLUMN access_control_context CLOB; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_39__add_rollout_group_parent_index___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_39__add_rollout_group_parent_index___H2.sql deleted file mode 100644 index acbdfe909..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_39__add_rollout_group_parent_index___H2.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX sp_idx_rollout_group_parent ON sp_rollout_group (parent); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_3__cascade_delete___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_3__cascade_delete___H2.sql deleted file mode 100644 index 9c92242e5..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_3__cascade_delete___H2.sql +++ /dev/null @@ -1 +0,0 @@ -alter table sp_rolloutgroup drop constraint fk_rolloutgroup_rolloutgroup; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_4__add_maintenance_window___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_4__add_maintenance_window___H2.sql deleted file mode 100644 index 6c546cede..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_4__add_maintenance_window___H2.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_action ADD column maintenance_cron_schedule VARCHAR(40); -ALTER TABLE sp_action ADD column maintenance_duration VARCHAR(40); -ALTER TABLE sp_action ADD column maintenance_time_zone VARCHAR(40); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_6__add_index___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_6__add_index___H2.sql deleted file mode 100644 index d7d7d6cc7..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_6__add_index___H2.sql +++ /dev/null @@ -1,2 +0,0 @@ -CREATE INDEX sp_idx_target_tag_01 ON sp_target_tag (tenant, name); -CREATE INDEX sp_idx_distribution_set_tag_01 ON sp_distributionset_tag (tenant, name); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_7__add_rollout_approval_fields___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_7__add_rollout_approval_fields___H2.sql deleted file mode 100644 index 8438d909e..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_7__add_rollout_approval_fields___H2.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_rollout ADD column approval_decided_by varchar(40); -ALTER TABLE sp_rollout ADD column approval_remark varchar(255); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_8__change_length_of_created_last_modified_by___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_8__change_length_of_created_last_modified_by___H2.sql deleted file mode 100644 index a89ece18d..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_8__change_length_of_created_last_modified_by___H2.sql +++ /dev/null @@ -1,45 +0,0 @@ -ALTER TABLE sp_action ALTER COLUMN created_by VARCHAR(64); -ALTER TABLE sp_action ALTER COLUMN last_modified_by VARCHAR(64); - -ALTER TABLE sp_action_status ALTER COLUMN created_by VARCHAR(64); -ALTER TABLE sp_action_status ALTER COLUMN last_modified_by VARCHAR(64); - -ALTER TABLE sp_artifact ALTER COLUMN created_by VARCHAR(64); -ALTER TABLE sp_artifact ALTER COLUMN last_modified_by VARCHAR(64); - -ALTER TABLE sp_base_software_module ALTER COLUMN created_by VARCHAR(64); -ALTER TABLE sp_base_software_module ALTER COLUMN last_modified_by VARCHAR(64); - -ALTER TABLE sp_distributionset_tag ALTER COLUMN created_by VARCHAR(64); -ALTER TABLE sp_distributionset_tag ALTER COLUMN last_modified_by VARCHAR(64); - -ALTER TABLE sp_distribution_set ALTER COLUMN created_by VARCHAR(64); -ALTER TABLE sp_distribution_set ALTER COLUMN last_modified_by VARCHAR(64); - -ALTER TABLE sp_distribution_set_type ALTER COLUMN created_by VARCHAR(64); -ALTER TABLE sp_distribution_set_type ALTER COLUMN last_modified_by VARCHAR(64); - -ALTER TABLE sp_rollout ALTER COLUMN created_by VARCHAR(64); -ALTER TABLE sp_rollout ALTER COLUMN last_modified_by VARCHAR(64); -ALTER TABLE sp_rollout ALTER COLUMN approval_decided_by VARCHAR(64); - -ALTER TABLE sp_rolloutgroup ALTER COLUMN created_by VARCHAR(64); -ALTER TABLE sp_rolloutgroup ALTER COLUMN last_modified_by VARCHAR(64); - -ALTER TABLE sp_software_module_type ALTER COLUMN created_by VARCHAR(64); -ALTER TABLE sp_software_module_type ALTER COLUMN last_modified_by VARCHAR(64); - -ALTER TABLE sp_target ALTER COLUMN created_by VARCHAR(64); -ALTER TABLE sp_target ALTER COLUMN last_modified_by VARCHAR(64); - -ALTER TABLE sp_target_filter_query ALTER COLUMN created_by VARCHAR(64); -ALTER TABLE sp_target_filter_query ALTER COLUMN last_modified_by VARCHAR(64); - -ALTER TABLE sp_target_tag ALTER COLUMN created_by VARCHAR(64); -ALTER TABLE sp_target_tag ALTER COLUMN last_modified_by VARCHAR(64); - -ALTER TABLE sp_tenant ALTER COLUMN created_by VARCHAR(64); -ALTER TABLE sp_tenant ALTER COLUMN last_modified_by VARCHAR(64); - -ALTER TABLE sp_tenant_configuration ALTER COLUMN created_by VARCHAR(64); -ALTER TABLE sp_tenant_configuration ALTER COLUMN last_modified_by VARCHAR(64); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_9__add_target_metadata___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_9__add_target_metadata___H2.sql deleted file mode 100644 index de70b7519..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_9__add_target_metadata___H2.sql +++ /dev/null @@ -1,12 +0,0 @@ -create table sp_target_metadata ( - meta_key varchar(128) not null, - meta_value varchar(4000), - target_id bigint not null, - primary key (target_id, meta_key) -); - -alter table sp_target_metadata - add constraint fk_metadata_target - foreign key (target_id) - references sp_target - on delete cascade; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_2_0__update_target_info_for_message___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_2_0__update_target_info_for_message___H2.sql deleted file mode 100644 index 5bf96e631..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_2_0__update_target_info_for_message___H2.sql +++ /dev/null @@ -1,13 +0,0 @@ -DROP INDEX sp_idx_target_info_01; - -ALTER TABLE sp_target_info ALTER COLUMN ip_address RENAME TO address; -ALTER TABLE sp_target_info ALTER COLUMN address VARCHAR(512); - -UPDATE sp_target_info -SET address = CONCAT('http://',(SELECT address - FROM sp_target_info i - WHERE sp_target_info.target_id = i.target_id)) -WHERE EXISTS(SELECT target_id - FROM sp_target_info i - WHERE sp_target_info.target_id = i.target_id) -AND address != null; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_4_0__cascade_delete___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_4_0__cascade_delete___H2.sql deleted file mode 100644 index 7ed5e8d58..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_4_0__cascade_delete___H2.sql +++ /dev/null @@ -1,69 +0,0 @@ -alter table sp_target_info drop constraint fk_targ_stat_targ; -alter table sp_target_info - add constraint fk_targ_stat_targ - foreign key (target_id) - references sp_target - on delete cascade; - -alter table sp_action drop constraint fk_targ_act_hist_targ; -alter table sp_action - add constraint fk_targ_act_hist_targ - foreign key (target) - references sp_target - on delete cascade; - -alter table sp_action_status drop constraint fk_act_stat_action; -alter table sp_action_status - add constraint fk_act_stat_action - foreign key (action) - references sp_action - on delete cascade; - -alter table sp_sw_metadata drop constraint fk_metadata_sw; -alter table sp_sw_metadata - add constraint fk_metadata_sw - foreign key (sw_id) - references sp_base_software_module - on delete cascade; - -alter table sp_ds_metadata drop constraint fk_metadata_ds; -alter table sp_ds_metadata - add constraint fk_metadata_ds - foreign key (ds_id) - references sp_distribution_set - on delete cascade; - -alter table sp_action_status_messages drop constraint fk_stat_msg_act_stat; -alter table sp_action_status_messages - add constraint fk_stat_msg_act_stat - foreign key (action_status_id) - references sp_action_status - on delete cascade; - -alter table sp_ds_dstag drop constraint fk_ds_dstag_tag; -alter table sp_ds_dstag - add constraint fk_ds_dstag_tag - foreign key (TAG) - references sp_distributionset_tag - on delete cascade; - -alter table sp_ds_dstag drop constraint fk_ds_dstag_ds; -alter table sp_ds_dstag - add constraint fk_ds_dstag_ds - foreign key (ds) - references sp_distribution_set - on delete cascade; - -alter table sp_target_target_tag drop constraint fk_targ_targtag_tag; -alter table sp_target_target_tag - add constraint fk_targ_targtag_tag - foreign key (tag) - references sp_target_tag - on delete cascade; - -alter table sp_target_target_tag drop constraint fk_targ_targtag_target; -alter table sp_target_target_tag - add constraint fk_targ_targtag_target - foreign key (target) - references sp_target - on delete cascade; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_4_1__cascade_delete___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_4_1__cascade_delete___H2.sql deleted file mode 100644 index 915dac153..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_4_1__cascade_delete___H2.sql +++ /dev/null @@ -1,6 +0,0 @@ -alter table sp_target_attributes drop constraint fk_targ_attrib_target; -alter table sp_target_attributes - add constraint fk_targ_attrib_target - foreign key (target_id) - references sp_target_info - on delete cascade; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_5_0__target_filter_query___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_5_0__target_filter_query___H2.sql deleted file mode 100644 index 0cbc3744a..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_5_0__target_filter_query___H2.sql +++ /dev/null @@ -1,14 +0,0 @@ - create table sp_target_filter_query ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - name varchar(64) not null, - query varchar(1024) not null, - primary key (id) -); - -create index sp_idx_target_filter_query_01 on sp_target_filter_query (tenant, name); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_6_0__rollout_management___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_6_0__rollout_management___H2.sql deleted file mode 100644 index 490400161..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_6_0__rollout_management___H2.sql +++ /dev/null @@ -1,103 +0,0 @@ - create table sp_rolloutgroup ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - error_condition integer, - error_condition_exp varchar(512), - error_action integer, - error_action_exp varchar(512), - success_condition integer not null, - success_condition_exp varchar(512) not null, - success_action integer not null, - success_action_exp varchar(512), - status integer, - parent_id bigint, - rollout bigint, - total_targets bigint, - primary key (id) - ); - - create table sp_rollout ( - id bigint generated by default as identity, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - last_check bigint, - group_theshold float, - status integer, - distribution_set bigint, - target_filter varchar(1024), - action_type varchar(255) not null, - forced_time bigint, - total_targets bigint, - primary key (id) - ); - - create table sp_rollouttargetgroup ( - target_Id bigint not null, - rolloutGroup_Id bigint not null, - primary key (rolloutGroup_Id, target_Id) - ); - - create index sp_idx_rollout_01 on sp_rollout (tenant, name); - - create index sp_idx_rolloutgroup_01 on sp_rolloutgroup (tenant, name); - - ALTER TABLE sp_action ADD COLUMN rollout bigint; - ALTER TABLE sp_action ADD COLUMN rolloutgroup bigint; - - alter table sp_rollout - add constraint uk_rollout unique (name, tenant); - - alter table sp_rolloutgroup - add constraint uk_rolloutgroup unique (name, rollout, tenant); - - alter table sp_action - add constraint fk_action_rollout - foreign key (rollout) - references sp_rollout; - - alter table sp_action - add constraint fk_action_rolloutgroup - foreign key (rolloutgroup) - references sp_rolloutgroup; - - alter table sp_rollout - add constraint fk_rollout_ds - foreign key (distribution_set) - references sp_distribution_set; - - alter table sp_rolloutgroup - add constraint fk_rolloutgroup_rollout - foreign key (rollout) - references sp_rollout - on delete cascade; - - alter table sp_rolloutgroup - add constraint fk_rolloutgroup_rolloutgroup - foreign key (parent_id) - references sp_rolloutgroup - on delete cascade; - - alter table sp_rollouttargetgroup - add constraint fk_rollouttargetgroup_target - foreign key (target_id) - references sp_target - on delete cascade; - - alter table sp_rollouttargetgroup - add constraint fk_rollouttargetgroup_rolloutgroup - foreign key (rolloutgroup_id) - references sp_rolloutgroup - on delete cascade; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_7_0__swmType_maxAssignment_greater_0__H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_7_0__swmType_maxAssignment_greater_0__H2.sql deleted file mode 100644 index f79c9375c..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_7_0__swmType_maxAssignment_greater_0__H2.sql +++ /dev/null @@ -1 +0,0 @@ -Update sp_software_module_type set max_ds_assignments = 1 where max_ds_assignments < 1; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_7_1__reduce_length_enums___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_7_1__reduce_length_enums___H2.sql deleted file mode 100644 index dfa5a7d94..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_7_1__reduce_length_enums___H2.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE sp_target_info ALTER update_status VARCHAR(16) not null; -ALTER TABLE sp_action ALTER action_type VARCHAR(16) not null; -ALTER TABLE sp_rollout ALTER action_type VARCHAR(16) not null; -ALTER TABLE sp_tenant_configuration ALTER conf_key VARCHAR(128) not null; -ALTER TABLE sp_tenant_configuration ALTER conf_value VARCHAR(512) not null; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_8_0__auto_assign_ds_filter__H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_8_0__auto_assign_ds_filter__H2.sql deleted file mode 100644 index 2d56f27f2..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_8_0__auto_assign_ds_filter__H2.sql +++ /dev/null @@ -1,8 +0,0 @@ -ALTER TABLE sp_target_filter_query - ADD column auto_assign_distribution_set BIGINT; - -ALTER TABLE sp_target_filter_query - ADD CONSTRAINT fk_filter_auto_assign_ds -FOREIGN KEY (auto_assign_distribution_set) -REFERENCES sp_distribution_set -ON DELETE SET NULL; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_8_1__cascade_delete___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_8_1__cascade_delete___H2.sql deleted file mode 100644 index 0c6225fae..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_8_1__cascade_delete___H2.sql +++ /dev/null @@ -1,27 +0,0 @@ -alter table sp_ds_module drop constraint fk_ds_module_ds; -alter table sp_ds_module - add constraint fk_ds_module_ds - foreign key (ds_id) - references sp_distribution_set (id) - on delete cascade; - -alter table sp_ds_module drop constraint fk_ds_module_module; -alter table sp_ds_module - add constraint fk_ds_module_module - foreign key (module_id) - references sp_base_software_module (id) - on delete cascade; - -alter table sp_external_artifact drop constraint fk_external_assigned_sm; -alter table sp_external_artifact - add constraint fk_external_assigned_sm - foreign key (software_module) - references sp_base_software_module (id) - on delete cascade; - -alter table sp_artifact drop constraint fk_assigned_sm; -alter table sp_artifact - add constraint fk_assigned_sm - foreign key (software_module) - references sp_base_software_module (id) - on delete cascade; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_8_2__remove_external_artifact___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_8_2__remove_external_artifact___H2.sql deleted file mode 100644 index f806edd8d..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_8_2__remove_external_artifact___H2.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE sp_external_artifact; -DROP TABLE sp_external_provider; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_9_0__add_rollout_groups_created___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_9_0__add_rollout_groups_created___H2.sql deleted file mode 100644 index 64518f762..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_9_0__add_rollout_groups_created___H2.sql +++ /dev/null @@ -1,2 +0,0 @@ - ALTER TABLE sp_rollout ADD column rollout_groups_created BIGINT; - \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_0_1__init___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_0_1__init___MYSQL.sql deleted file mode 100644 index ec243a68b..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_0_1__init___MYSQL.sql +++ /dev/null @@ -1,494 +0,0 @@ - - create table sp_action ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - action_type varchar(255) not null, - active bit, - forced_time bigint, - status integer, - distribution_set bigint, - target bigint, - primary key (id) - ); - - create table sp_action_status ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - target_occurred_at bigint, - status integer, - action bigint not null, - primary key (id) - ); - - create table sp_action_status_messages ( - action_status_id bigint not null, - detail_message varchar(512) - ); - - create table sp_artifact ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - md5_hash varchar(32), - sha1_hash varchar(40), - file_size bigint, - provided_file_name varchar(256), - gridfs_file_name varchar(40), - software_module bigint not null, - primary key (id) - ); - - create table sp_base_software_module ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - version varchar(64) not null, - deleted bit, - vendor varchar(256), - module_type bigint not null, - primary key (id) - ); - - create table sp_distribution_set ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - version varchar(64) not null, - complete bit, - deleted bit, - required_migration_step bit, - ds_id bigint not null, - primary key (id) - ); - - create table sp_distribution_set_type ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - colour varchar(16), - deleted bit, - type_key varchar(64) not null, - primary key (id) - ); - - create table sp_distributionset_tag ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - colour varchar(16), - primary key (id) - ); - - create table sp_ds_dstag ( - ds bigint not null, - TAG bigint not null, - primary key (ds, TAG) - ); - - create table sp_ds_metadata ( - meta_key varchar(128) not null, - meta_value varchar(4000), - ds_id bigint not null, - primary key (ds_id, meta_key) - ); - - create table sp_ds_module ( - ds_id bigint not null, - module_id bigint not null, - primary key (ds_id, module_id) - ); - - create table sp_ds_type_element ( - mandatory bit, - distribution_set_type bigint not null, - software_module_type bigint not null, - primary key (distribution_set_type, software_module_type) - ); - - create table sp_external_artifact ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - md5_hash varchar(32), - sha1_hash varchar(40), - file_size bigint, - url_suffix varchar(512), - provider bigint not null, - software_module bigint not null, - primary key (id) - ); - - create table sp_external_provider ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - base_url varchar(512) not null, - default_url_suffix varchar(512), - primary key (id) - ); - - create table sp_software_module_type ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - colour varchar(16), - deleted bit, - type_key varchar(64) not null, - max_ds_assignments integer not null, - primary key (id) - ); - - create table sp_sw_metadata ( - meta_key varchar(128) not null, - meta_value varchar(4000), - sw_id bigint not null, - primary key (meta_key, sw_id) - ); - - create table sp_target ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - controller_id varchar(64), - sec_token varchar(128) not null, - assigned_distribution_set bigint, - primary key (id) - ); - - create table sp_target_attributes ( - target_id bigint not null, - attribute_value varchar(128), - attribute_key varchar(32) not null, - primary key (target_id, attribute_key) - ); - - create table sp_target_info ( - target_id bigint not null, - install_date bigint, - ip_address varchar(46), - last_target_query bigint, - request_controller_attributes bit not null, - update_status varchar(255) not null, - installed_distribution_set bigint, - primary key (target_id) - ); - - create table sp_target_tag ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - colour varchar(16), - primary key (id) - ); - - create table sp_target_target_tag ( - target bigint not null, - tag bigint not null, - primary key (target, tag) - ); - - create table sp_tenant ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - default_ds_type bigint not null, - primary key (id) - ); - - create table sp_tenant_configuration ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - conf_key varchar(128), - conf_value varchar(512), - primary key (id) - ); - - create index sp_idx_action_01 on sp_action (tenant, distribution_set); - - create index sp_idx_action_02 on sp_action (tenant, target, active); - - create index sp_idx_action_prim on sp_action (tenant, id); - - create index sp_idx_action_status_01 on sp_action_status (tenant, action); - - create index sp_idx_action_status_02 on sp_action_status (tenant, action, status); - - create index sp_idx_action_status_prim on sp_action_status (tenant, id); - - create index sp_idx_action_status_msgs_01 on sp_action_status_messages (action_status_id); - - create index sp_idx_artifact_01 on sp_artifact (tenant, software_module); - - create index sp_idx_artifact_prim on sp_artifact (tenant, id); - - alter table sp_base_software_module - add constraint uk_base_sw_mod unique (module_type, name, version, tenant); - - create index sp_idx_base_sw_module_01 on sp_base_software_module (tenant, deleted, name, version); - - create index sp_idx_base_sw_module_02 on sp_base_software_module (tenant, deleted, module_type); - - create index sp_idx_base_sw_module_prim on sp_base_software_module (tenant, id); - - alter table sp_distribution_set - add constraint uk_distrib_set unique (name, version, tenant); - - create index sp_idx_distribution_set_01 on sp_distribution_set (tenant, deleted, name, complete); - - create index sp_idx_distribution_set_02 on sp_distribution_set (tenant, required_migration_step); - - create index sp_idx_distribution_set_prim on sp_distribution_set (tenant, id); - - alter table sp_distribution_set_type - add constraint uk_dst_name unique (name, tenant); - - alter table sp_distribution_set_type - add constraint uk_dst_key unique (type_key, tenant); - - create index sp_idx_distribution_set_type_01 on sp_distribution_set_type (tenant, deleted); - - create index sp_idx_distribution_set_type_prim on sp_distribution_set_type (tenant, id); - - alter table sp_distributionset_tag - add constraint uk_ds_tag unique (name, tenant); - - create index sp_idx_distribution_set_tag_prim on sp_distributionset_tag (tenant, id); - - create index sp_idx_external_artifact_prim on sp_external_artifact (id, tenant); - - create index sp_idx_external_provider_prim on sp_external_provider (tenant, id); - - alter table sp_software_module_type - add constraint uk_smt_type_key unique (type_key, tenant); - - alter table sp_software_module_type - add constraint uk_smt_name unique (name, tenant); - - create index sp_idx_software_module_type_01 on sp_software_module_type (tenant, deleted); - - create index sp_idx_software_module_type_prim on sp_software_module_type (tenant, id); - - alter table sp_target - add constraint uk_tenant_controller_id unique (controller_id, tenant); - - create index sp_idx_target_01 on sp_target (tenant, name, assigned_distribution_set); - - create index sp_idx_target_02 on sp_target (tenant, name); - - create index sp_idx_target_03 on sp_target (tenant, controller_id, assigned_distribution_set); - - create index sp_idx_target_04 on sp_target (tenant, created_at); - - create index sp_idx_target_prim on sp_target (tenant, id); - - create index sp_idx_target_info_01 on sp_target_info (ip_address); - - create index sp_idx_target_info_02 on sp_target_info (target_id, update_status); - - alter table sp_target_tag - add constraint uk_targ_tag unique (name, tenant); - - create index sp_idx_target_tag_prim on sp_target_tag (tenant, id); - - alter table sp_tenant - add constraint uk_tenantmd_tenant unique (tenant); - - create index sp_idx_tenant_prim on sp_tenant (tenant, id); - - alter table sp_tenant_configuration - add constraint uk_tenant_key unique (conf_key, tenant); - - alter table sp_action - add constraint fk_action_ds - foreign key (distribution_set) - references sp_distribution_set (id); - - alter table sp_action - add constraint fk_targ_act_hist_targ - foreign key (target) - references sp_target (id); - - alter table sp_action_status - add constraint fk_act_stat_action - foreign key (action) - references sp_action (id); - - alter table sp_action_status_messages - add constraint fk_stat_msg_act_stat - foreign key (action_status_id) - references sp_action_status (id); - - alter table sp_artifact - add constraint fk_assigned_sm - foreign key (software_module) - references sp_base_software_module (id); - - alter table sp_base_software_module - add constraint fk_module_type - foreign key (module_type) - references sp_software_module_type (id); - - alter table sp_distribution_set - add constraint fk_ds_dstype_ds - foreign key (ds_id) - references sp_distribution_set_type (id); - - alter table sp_ds_dstag - add constraint fk_ds_dstag_tag - foreign key (TAG) - references sp_distributionset_tag (id); - - alter table sp_ds_dstag - add constraint fk_ds_dstag_ds - foreign key (ds) - references sp_distribution_set (id); - - alter table sp_ds_metadata - add constraint fk_metadata_ds - foreign key (ds_id) - references sp_distribution_set (id); - - alter table sp_ds_module - add constraint fk_ds_module_module - foreign key (module_id) - references sp_base_software_module (id); - - alter table sp_ds_module - add constraint fk_ds_module_ds - foreign key (ds_id) - references sp_distribution_set (id); - - alter table sp_ds_type_element - add constraint fk_ds_type_element_element - foreign key (distribution_set_type) - references sp_distribution_set_type (id); - - alter table sp_ds_type_element - add constraint fk_ds_type_element_smtype - foreign key (software_module_type) - references sp_software_module_type (id); - - alter table sp_external_artifact - add constraint fk_art_to_ext_provider - foreign key (provider) - references sp_external_provider (id); - - alter table sp_external_artifact - add constraint fk_external_assigned_sm - foreign key (software_module) - references sp_base_software_module (id); - - alter table sp_sw_metadata - add constraint fk_metadata_sw - foreign key (sw_id) - references sp_base_software_module (id); - - alter table sp_target - add constraint fk_target_assign_ds - foreign key (assigned_distribution_set) - references sp_distribution_set (id); - - alter table sp_target_attributes - add constraint fk_targ_attrib_target - foreign key (target_id) - references sp_target_info (target_id); - - alter table sp_target_info - add constraint fk_target_inst_ds - foreign key (installed_distribution_set) - references sp_distribution_set (id); - - alter table sp_target_info - add constraint fk_targ_stat_targ - foreign key (target_id) - references sp_target (id); - - alter table sp_target_target_tag - add constraint fk_targ_targtag_tag - foreign key (tag) - references sp_target_tag (id); - - alter table sp_target_target_tag - add constraint fk_targ_targtag_target - foreign key (target) - references sp_target (id); - - alter table sp_tenant - add constraint fk_tenant_md_default_ds_type - foreign key (default_ds_type) - references sp_distribution_set_type (id); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_0__advanced_rolloutgroup__MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_0__advanced_rolloutgroup__MYSQL.sql deleted file mode 100644 index 7c4954ad8..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_0__advanced_rolloutgroup__MYSQL.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE sp_rolloutgroup - ADD COLUMN target_percentage FLOAT; -ALTER TABLE sp_rolloutgroup - ADD COLUMN target_filter VARCHAR (1024); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_1__consolidate_artifact_sha1__MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_1__consolidate_artifact_sha1__MYSQL.sql deleted file mode 100644 index 05b34fd5f..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_1__consolidate_artifact_sha1__MYSQL.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_artifact DROP COLUMN sha1_hash; -ALTER TABLE sp_artifact CHANGE gridfs_file_name sha1_hash varchar(40) not null; -CREATE INDEX sp_idx_artifact_02 ON sp_artifact (tenant, sha1_hash); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_2__rollout_auto_start__MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_2__rollout_auto_start__MYSQL.sql deleted file mode 100644 index e946026f3..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_2__rollout_auto_start__MYSQL.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_rollout - ADD COLUMN start_at BIGINT; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_3__add_rollout_deleted_flag__MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_3__add_rollout_deleted_flag__MYSQL.sql deleted file mode 100644 index ed184162e..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_10_3__add_rollout_deleted_flag__MYSQL.sql +++ /dev/null @@ -1,26 +0,0 @@ -ALTER TABLE sp_rollout ADD COLUMN deleted BOOLEAN; - -UPDATE sp_rollout SET deleted = 0; - -ALTER TABLE sp_action MODIFY target BIGINT NOT NULL; -ALTER TABLE sp_action MODIFY distribution_set BIGINT NOT NULL; -ALTER TABLE sp_action MODIFY status INTEGER NOT NULL; -ALTER TABLE sp_action_status MODIFY status INTEGER NOT NULL; -ALTER TABLE sp_rollout MODIFY status INTEGER NOT NULL; -ALTER TABLE sp_rollout MODIFY distribution_set BIGINT NOT NULL; -ALTER TABLE sp_rolloutgroup MODIFY rollout BIGINT NOT NULL; -ALTER TABLE sp_rolloutgroup MODIFY status INTEGER NOT NULL; - -ALTER TABLE sp_ds_type_element DROP FOREIGN KEY fk_ds_type_element_element; -ALTER TABLE sp_ds_type_element - ADD CONSTRAINT fk_ds_type_element_element - FOREIGN KEY (distribution_set_type) - REFERENCES sp_distribution_set_type (id) - ON DELETE CASCADE; - -ALTER TABLE sp_ds_type_element DROP FOREIGN KEY fk_ds_type_element_smtype; -ALTER TABLE sp_ds_type_element - ADD CONSTRAINT fk_ds_type_element_smtype - FOREIGN KEY (software_module_type) - REFERENCES sp_software_module_type (id) - ON DELETE CASCADE; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_0__drop_target_info__MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_0__drop_target_info__MYSQL.sql deleted file mode 100644 index f170e0f22..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_0__drop_target_info__MYSQL.sql +++ /dev/null @@ -1,31 +0,0 @@ -ALTER TABLE sp_target ADD COLUMN install_date bigint; -ALTER TABLE sp_target ADD COLUMN address varchar(512); -ALTER TABLE sp_target ADD COLUMN last_target_query bigint; -ALTER TABLE sp_target ADD COLUMN request_controller_attributes bit not null; -ALTER TABLE sp_target ADD COLUMN update_status varchar(16) not null; -ALTER TABLE sp_target ADD COLUMN installed_distribution_set bigint; - -UPDATE sp_target AS t INNER JOIN sp_target_info AS i - ON t.id = i.target_id -SET t.install_date = i.install_date, t.address = i.address,t.last_target_query = i.last_target_query, - t.request_controller_attributes = i.request_controller_attributes,t.update_status = i.update_status, - t.installed_distribution_set = i.installed_distribution_set; - -ALTER TABLE sp_target_info DROP INDEX sp_idx_target_info_02; - -ALTER TABLE sp_target_attributes DROP FOREIGN KEY fk_targ_attrib_target; -ALTER TABLE sp_target_attributes - ADD CONSTRAINT fk_targ_attrib_target - FOREIGN KEY (target_id) - REFERENCES sp_target (id) - ON DELETE cascade; - -ALTER TABLE sp_target_info DROP FOREIGN KEY fk_target_inst_ds; -ALTER TABLE sp_target - ADD CONSTRAINT fk_target_inst_ds - FOREIGN KEY (installed_distribution_set) - REFERENCES sp_distribution_set (id); - -ALTER TABLE sp_target_info DROP FOREIGN KEY fk_targ_stat_targ; - -DROP TABLE sp_target_info; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_1__target_filter_query_UQ___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_1__target_filter_query_UQ___MYSQL.sql deleted file mode 100644 index f494313a8..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_1__target_filter_query_UQ___MYSQL.sql +++ /dev/null @@ -1,2 +0,0 @@ - alter table sp_target_filter_query - add constraint uk_tenant_custom_filter_name unique (name, tenant); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_2__remove_unused_idexes___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_2__remove_unused_idexes___MYSQL.sql deleted file mode 100644 index 190250dfa..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_2__remove_unused_idexes___MYSQL.sql +++ /dev/null @@ -1,8 +0,0 @@ -ALTER TABLE sp_action_status DROP INDEX sp_idx_action_status_01; -ALTER TABLE sp_rollout DROP INDEX sp_idx_rollout_01; -ALTER TABLE sp_rolloutgroup DROP INDEX sp_idx_rolloutgroup_01; -ALTER TABLE sp_target DROP INDEX sp_idx_target_02; -ALTER TABLE sp_target_filter_query DROP INDEX sp_idx_target_filter_query_01; -ALTER TABLE sp_distribution_set DROP INDEX sp_idx_distribution_set_01; -ALTER TABLE sp_distribution_set DROP INDEX sp_idx_distribution_set_02; -CREATE INDEX sp_idx_distribution_set_01 ON sp_distribution_set (tenant, deleted, complete); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_3__add_module_md_targetvis__MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_3__add_module_md_targetvis__MYSQL.sql deleted file mode 100644 index 4165f7ed1..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_11_3__add_module_md_targetvis__MYSQL.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE sp_sw_metadata ADD COLUMN target_visible bit; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_0__action_performance___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_0__action_performance___MYSQL.sql deleted file mode 100644 index 1dff4e13a..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_0__action_performance___MYSQL.sql +++ /dev/null @@ -1,25 +0,0 @@ -ALTER TABLE sp_action ADD COLUMN action_type_new integer not null; -UPDATE sp_action SET action_type_new = -CASE WHEN (action_type = 'SOFT') THEN 1 - WHEN (action_type = 'TIMEFORCED') THEN 2 - ELSE 0 END; -ALTER TABLE sp_action DROP COLUMN action_type; -ALTER TABLE sp_action CHANGE COLUMN action_type_new action_type integer; - -ALTER TABLE sp_rollout ADD COLUMN action_type_new integer not null; -UPDATE sp_rollout SET action_type_new = -CASE WHEN (action_type = 'SOFT') THEN 1 - WHEN (action_type = 'TIMEFORCED') THEN 2 - ELSE 0 END; -ALTER TABLE sp_rollout DROP COLUMN action_type; -ALTER TABLE sp_rollout CHANGE COLUMN action_type_new action_type integer; - -ALTER TABLE sp_target ADD COLUMN update_status_new integer not null; -UPDATE sp_target SET update_status_new = -CASE WHEN (update_status = 'IN_SYNC') THEN 1 - WHEN (update_status = 'PENDING') THEN 2 - WHEN (update_status = 'ERROR') THEN 3 - WHEN (update_status = 'REGISTERED') THEN 4 - ELSE 0 END; -ALTER TABLE sp_target DROP COLUMN update_status; -ALTER TABLE sp_target CHANGE COLUMN update_status_new update_status integer; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_10__change_length_of_target_attributes_key___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_10__change_length_of_target_attributes_key___MYSQL.sql deleted file mode 100644 index aeec222c2..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_10__change_length_of_target_attributes_key___MYSQL.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE sp_target_attributes MODIFY attribute_key VARCHAR(128); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_11__add_auto_assign_action_type___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_11__add_auto_assign_action_type___MYSQL.sql deleted file mode 100644 index 16cb03ef2..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_11__add_auto_assign_action_type___MYSQL.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE sp_target_filter_query ADD COLUMN auto_assign_action_type integer; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_12__change_length_of_controller_id_and_name___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_12__change_length_of_controller_id_and_name___MYSQL.sql deleted file mode 100644 index 32b39dd59..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_12__change_length_of_controller_id_and_name___MYSQL.sql +++ /dev/null @@ -1,13 +0,0 @@ -ALTER TABLE sp_distribution_set MODIFY name VARCHAR(128); -ALTER TABLE sp_distribution_set_type MODIFY name VARCHAR(128); -ALTER TABLE sp_distributionset_tag MODIFY name VARCHAR(128); -ALTER TABLE sp_base_software_module MODIFY name VARCHAR(128); -ALTER TABLE sp_rollout MODIFY name VARCHAR(128); -ALTER TABLE sp_rolloutgroup MODIFY name VARCHAR(128); -ALTER TABLE sp_software_module_type MODIFY name VARCHAR(128); -ALTER TABLE sp_target MODIFY name VARCHAR(128); -ALTER TABLE sp_target_filter_query MODIFY name VARCHAR(128); -ALTER TABLE sp_target_tag MODIFY name VARCHAR(128); - - -ALTER TABLE sp_target MODIFY controller_id VARCHAR(256); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_13__add_action_external_id___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_13__add_action_external_id___MYSQL.sql deleted file mode 100644 index 8dbda293f..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_13__add_action_external_id___MYSQL.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE sp_action ADD COLUMN external_ref VARCHAR(512); -CREATE INDEX sp_idx_action_external_ref ON sp_action (external_ref); - - \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_14__add_sha256_hash___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_14__add_sha256_hash___MYSQL.sql deleted file mode 100644 index ca7e53fce..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_14__add_sha256_hash___MYSQL.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE sp_artifact ADD COLUMN sha256_hash CHAR(64); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_15__add_weight___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_15__add_weight___MYSQL.sql deleted file mode 100644 index 9eaad20e1..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_15__add_weight___MYSQL.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_action ADD weight INT; -ALTER TABLE sp_rollout ADD weight INT; -ALTER TABLE sp_target_filter_query ADD auto_assign_weight INT; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_16__add_action_initiated_by___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_16__add_action_initiated_by___MYSQL.sql deleted file mode 100644 index d0b559b61..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_16__add_action_initiated_by___MYSQL.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_action ADD COLUMN initiated_by VARCHAR(64) NOT NULL; -ALTER TABLE sp_target_filter_query ADD COLUMN auto_assign_initiated_by VARCHAR(64); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_17__add_index_target_modified___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_17__add_index_target_modified___MYSQL.sql deleted file mode 100644 index ac70ee7f0..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_17__add_index_target_modified___MYSQL.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX sp_idx_target_05 ON sp_target (tenant, last_modified_at); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_18__add_target_type___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_18__add_target_type___MYSQL.sql deleted file mode 100644 index c6435a63d..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_18__add_target_type___MYSQL.sql +++ /dev/null @@ -1,47 +0,0 @@ -create table sp_target_type -( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(64), - last_modified_at bigint, - last_modified_by varchar(64), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - colour varchar(16), - primary key (id) -); - -create table sp_target_type_ds_type_relation -( - target_type bigint not null, - distribution_set_type bigint not null, - primary key (target_type, distribution_set_type) -); - -alter table sp_target_type - add constraint uk_target_type_name unique (name, tenant); - -create index sp_idx_target_type_prim on sp_target_type (tenant, id); - -alter table sp_target - add column target_type bigint; - -alter table sp_target - add constraint fk_target_relation_target_type - foreign key (target_type) - references sp_target_type (id) - on delete set null; - -alter table sp_target_type_ds_type_relation - add constraint fk_target_type_relation_target_type - foreign key (target_type) - references sp_target_type (id) - on delete cascade; - -alter table sp_target_type_ds_type_relation - add constraint fk_target_type_relation_ds_type - foreign key (distribution_set_type) - references sp_distribution_set_type (id) - on delete cascade; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_19__add_valid_flag_to_ds___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_19__add_valid_flag_to_ds___MYSQL.sql deleted file mode 100644 index 3ab0e7502..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_19__add_valid_flag_to_ds___MYSQL.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_distribution_set ADD COLUMN valid BOOLEAN; - -UPDATE sp_distribution_set SET valid = 1; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_1__missing_non_null___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_1__missing_non_null___MYSQL.sql deleted file mode 100644 index deb2ab79d..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_1__missing_non_null___MYSQL.sql +++ /dev/null @@ -1,12 +0,0 @@ -ALTER TABLE sp_action_status_messages CHANGE COLUMN detail_message detail_message varchar(512) not null; -ALTER TABLE sp_action CHANGE COLUMN distribution_set distribution_set bigint not null; -ALTER TABLE sp_action CHANGE COLUMN target target bigint not null; -ALTER TABLE sp_action CHANGE COLUMN status status integer not null; -ALTER TABLE sp_action_status CHANGE COLUMN target_occurred_at target_occurred_at bigint not null; -ALTER TABLE sp_action_status CHANGE COLUMN status status integer not null; -ALTER TABLE sp_rollout CHANGE COLUMN distribution_set distribution_set bigint not null; -ALTER TABLE sp_rollout CHANGE COLUMN status status integer not null; -ALTER TABLE sp_rolloutgroup CHANGE COLUMN rollout rollout bigint not null; -ALTER TABLE sp_rolloutgroup CHANGE COLUMN status status integer not null; -ALTER TABLE sp_artifact CHANGE COLUMN sha1_hash sha1_hash varchar(40) not null; -ALTER TABLE sp_target CHANGE COLUMN controller_id controller_id varchar(64) not null; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_20__add_encryption_flag_to_sm___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_20__add_encryption_flag_to_sm___MYSQL.sql deleted file mode 100644 index 9249d14a1..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_20__add_encryption_flag_to_sm___MYSQL.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_base_software_module ADD COLUMN encrypted BOOLEAN; - -UPDATE sp_base_software_module SET encrypted = 0; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_21__add_rollouts_status_index___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_21__add_rollouts_status_index___MYSQL.sql deleted file mode 100644 index 4d845ed84..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_21__add_rollouts_status_index___MYSQL.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX sp_idx_rollout_status_tenant ON sp_rollout (tenant, status); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_22__change_target_type_name_length___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_22__change_target_type_name_length___MYSQL.sql deleted file mode 100644 index 39c4c5965..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_22__change_target_type_name_length___MYSQL.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE sp_target_type MODIFY name VARCHAR(128); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_23__add_action_status_code___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_23__add_action_status_code___MYSQL.sql deleted file mode 100644 index b5640ddec..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_23__add_action_status_code___MYSQL.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_action_status ADD COLUMN code integer; -CREATE INDEX sp_idx_action_status_03 ON sp_action_status (tenant, code); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_24__add_last_action_status_code___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_24__add_last_action_status_code___MYSQL.sql deleted file mode 100644 index 03539efb3..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_24__add_last_action_status_code___MYSQL.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE sp_action ADD COLUMN last_action_status_code integer; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_25__add_confirmation_flag___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_25__add_confirmation_flag___MYSQL.sql deleted file mode 100644 index e8a7594c7..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_25__add_confirmation_flag___MYSQL.sql +++ /dev/null @@ -1,22 +0,0 @@ -ALTER TABLE sp_rolloutgroup ADD column confirmation_required BOOLEAN; -UPDATE sp_rolloutgroup SET confirmation_required = 0; - -ALTER TABLE sp_target_filter_query ADD column confirmation_required BOOLEAN; -UPDATE sp_target_filter_query SET confirmation_required = 0; - -create table sp_target_conf_status -( - id bigint not null auto_increment, - target_id bigint not null, - initiator varchar(64), - remark varchar(512), - created_at bigint, - created_by varchar(64), - last_modified_at bigint, - last_modified_by varchar(64), - optlock_revision bigint, - tenant varchar(40) not null, - primary key (id) -); -ALTER TABLE sp_target_conf_status - ADD CONSTRAINT fk_target_auto_conf FOREIGN KEY (target_id) REFERENCES sp_target (id) ON DELETE CASCADE; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_26__add_access_control_context___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_26__add_access_control_context___MYSQL.sql deleted file mode 100644 index ccf16963e..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_26__add_access_control_context___MYSQL.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_target_filter_query ADD COLUMN access_control_context VARCHAR(4096); -ALTER TABLE sp_rollout ADD COLUMN access_control_context VARCHAR(4096); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_27__target_type_inherit_type___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_27__target_type_inherit_type___MYSQL.sql deleted file mode 100644 index 86e3350b8..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_27__target_type_inherit_type___MYSQL.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_target_type ADD COLUMN type_key VARCHAR (64) NOT NULL DEFAULT ('_'); -UPDATE sp_target_type SET type_key = name; -ALTER TABLE sp_target_type ADD CONSTRAINT uk_target_type_key UNIQUE (type_key, tenant); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_28__add_dynamic_rollout___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_28__add_dynamic_rollout___MYSQL.sql deleted file mode 100644 index 030727a57..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_28__add_dynamic_rollout___MYSQL.sql +++ /dev/null @@ -1,9 +0,0 @@ -ALTER TABLE sp_rollout ADD COLUMN is_dynamic BOOLEAN; -ALTER TABLE sp_rolloutgroup ADD COLUMN is_dynamic BOOLEAN NOT NULL DEFAULT false; - -UPDATE sp_rollout SET weight = 1000 WHERE weight IS NULL; -UPDATE sp_action SET weight = 1000 WHERE weight IS NULL; -UPDATE sp_target_filter_query SET auto_assign_weight = 1000 WHERE auto_assign_weight IS NULL; -ALTER TABLE sp_rollout MODIFY COLUMN weight INT NOT NULL; -ALTER TABLE sp_action MODIFY COLUMN weight INT NOT NULL; -ALTER TABLE sp_target_filter_query MODIFY COLUMN auto_assign_weight INT NOT NULL; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_29__add_ds_sm_locked___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_29__add_ds_sm_locked___MYSQL.sql deleted file mode 100644 index c5c0de6fb..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_29__add_ds_sm_locked___MYSQL.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_base_software_module ADD COLUMN locked BOOLEAN NOT NULL DEFAULT true; -ALTER TABLE sp_distribution_set ADD COLUMN locked BOOLEAN NOT NULL DEFAULT true; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_2__missing_non_null_enum___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_2__missing_non_null_enum___MYSQL.sql deleted file mode 100644 index 5a7755373..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_2__missing_non_null_enum___MYSQL.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_target CHANGE COLUMN update_status update_status integer not null; -ALTER TABLE sp_rollout CHANGE COLUMN action_type action_type integer not null; -ALTER TABLE sp_action CHANGE COLUMN action_type action_type integer not null; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_30__add_distrubuted_lock___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_30__add_distrubuted_lock___MYSQL.sql deleted file mode 100644 index ed8f9c835..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_30__add_distrubuted_lock___MYSQL.sql +++ /dev/null @@ -1,8 +0,0 @@ --- Table and fields in upper case as Spring queries it that way -CREATE TABLE SP_LOCK ( - LOCK_KEY CHAR(36) NOT NULL, - REGION VARCHAR(100) NOT NULL, - CLIENT_ID CHAR(36), - CREATED_DATE DATETIME(6) NOT NULL, - constraint SP_LOCK_PK primary key (LOCK_KEY, REGION) -); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_31__add_type_to_ds_index___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_31__add_type_to_ds_index___MYSQL.sql deleted file mode 100644 index 0e602804e..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_31__add_type_to_ds_index___MYSQL.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table sp_distribution_set drop constraint uk_distrib_set; -alter table sp_distribution_set add constraint uk_distrib_set unique (tenant, name, version, ds_id); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_32__refactoring_rename____MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_32__refactoring_rename____MYSQL.sql deleted file mode 100644 index f397d403d..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_32__refactoring_rename____MYSQL.sql +++ /dev/null @@ -1,63 +0,0 @@ --- rename tables -alter table sp_base_software_module rename to sp_software_module; -alter table sp_distributionset_tag rename to sp_distribution_set_tag; -alter table sp_ds_dstag rename to sp_ds_tag; -alter table sp_ds_module rename to sp_ds_sm; -alter table sp_rolloutgroup rename to sp_rollout_group; -alter table sp_rollouttargetgroup rename to sp_rollout_target_group; -alter table sp_sw_metadata rename to sp_sm_metadata; -alter table sp_target_type_ds_type_relation rename to sp_target_type_ds_type; --- rename columns -alter table sp_action rename column rolloutgroup to rollout_group; -alter table sp_action_status_messages rename column action_status_id to action_status; -alter table sp_distribution_set rename column ds_id to ds_type; -alter table sp_ds_sm rename column module_id to sm_id; -alter table sp_ds_metadata rename column ds_id to ds; -alter table sp_ds_tag rename column TAG to tag; -alter table sp_rollout_group rename column parent_id to parent; -alter table sp_rollout_target_group rename column target_id to target; -alter table sp_rollout_target_group rename column rolloutgroup_id to rollout_group; -alter table sp_sm_metadata rename column sw_id to sm; -alter table sp_software_module rename column module_type to sm_type; -alter table sp_target_attributes rename column target_id to target; -alter table sp_target_conf_status rename column target_id to target; -alter table sp_target_metadata rename column target_id to target; --- rename constraints --- rename indexes -alter table sp_action rename index fk_action_ds to fk_action_distribution_set; -alter table sp_action rename index fk_action_rolloutgroup to fk_action_rollout_group; -alter table sp_action rename index fk_targ_act_hist_targ to fk_action_target; -alter table sp_action_status rename index fk_act_stat_action to fk_action_status_action; -alter table sp_action_status_messages rename index sp_idx_action_status_msgs_01 to fk_action_status_messages_action_status; -alter table sp_artifact rename index fk_assigned_sm to fk_artifact_software_module; -alter table sp_distribution_set rename index uk_distrib_set to uk_distribution_set; -alter table sp_distribution_set rename index fk_ds_dstype_ds to fk_distribution_set_ds_type; -alter table sp_distribution_set_tag rename index uk_ds_tag to uk_distribution_set_tag; -alter table sp_distribution_set_type rename index uk_dst_key to uk_distribution_set_type_type_key; -alter table sp_distribution_set_type rename index uk_dst_name to uk_distribution_set_type_name; -alter table sp_ds_sm rename index fk_ds_module_module to fk_ds_sm_sm_id; -alter table sp_ds_tag rename index fk_ds_dstag_tag to fk_ds_tag_tag; -alter table sp_ds_type_element rename index fk_ds_type_element_smtype to fk_ds_type_element_software_module_type; -alter table sp_rollout rename index fk_rollout_ds to fk_rollout_distribution_set; -alter table sp_rollout_group rename index uk_rolloutgroup to uk_rollout_group; -alter table sp_rollout_group rename index fk_rolloutgroup_rollout to fk_rollout_group_rollout; -alter table sp_rollout_group rename index fk_rolloutgroup_rolloutgroup to sp_idx_rollout_group_parent; -alter table sp_rollout_target_group rename index fk_rollouttargetgroup_target to fk_rollout_target_group_target; -alter table sp_sm_metadata rename index fk_metadata_sw to fk_sm_metadata_sm; -alter table sp_software_module rename index uk_base_sw_mod to uk_software_module; -alter table sp_software_module_type rename index uk_smt_type_key to uk_software_module_type_type_key; -alter table sp_software_module_type rename index uk_smt_name to uk_software_module_type_name; -alter table sp_software_module rename index sp_idx_base_sw_module_prim to sp_idx_software_module_prim; -alter table sp_software_module rename index sp_idx_base_sw_module_01 to sp_idx_software_module_01; -alter table sp_software_module rename index sp_idx_base_sw_module_02 to sp_idx_software_module_02; -alter table sp_target rename index uk_tenant_controller_id to uk_target_controller_id; -alter table sp_target_conf_status rename index fk_target_auto_conf to fk_target_conf_status_target; -alter table sp_target_filter_query rename index uk_tenant_custom_filter_name to uk_target_filter_query; -alter table sp_target_filter_query rename index fk_filter_auto_assign_ds to fk_target_filter_query_auto_assign_distribution_set; -alter table sp_target_tag rename index uk_targ_tag to uk_target_tag; -alter table sp_target_target_tag rename index fk_targ_targtag_tag to fk_target_target_tag_tag; -alter table sp_target_type rename index uk_target_type_name to uk_target_name; -alter table sp_target_type_ds_type rename index fk_target_type_relation_ds_type to fk_target_type_ds_type_distribution_set_type; -alter table sp_tenant rename index uk_tenantmd_tenant to uk_tenant; -alter table sp_tenant rename index fk_tenant_md_default_ds_type to fk_tenant_default_ds_type; -alter table sp_tenant_configuration rename index uk_tenant_key to uk_tenant_configuration; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_33__add_group_to_target__MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_33__add_group_to_target__MYSQL.sql deleted file mode 100644 index 6c776ac98..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_33__add_group_to_target__MYSQL.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_target ADD COLUMN target_group VARCHAR(256); -CREATE INDEX sp_idx_target_group ON sp_target (tenant, target_group); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_34__sm_type_min_artifacts__MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_34__sm_type_min_artifacts__MYSQL.sql deleted file mode 100644 index d3e5aafed..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_34__sm_type_min_artifacts__MYSQL.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE sp_software_module_type ADD COLUMN min_artifacts integer default 0 NOT NULL; -ALTER TABLE sp_distribution_set DROP INDEX sp_idx_distribution_set_01; -CREATE INDEX sp_idx_distribution_set_01 ON sp_distribution_set (tenant, deleted); -ALTER TABLE sp_distribution_set DROP COLUMN complete; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_35__cleanup_prop_changes__MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_35__cleanup_prop_changes__MYSQL.sql deleted file mode 100644 index 37995ea60..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_35__cleanup_prop_changes__MYSQL.sql +++ /dev/null @@ -1,4 +0,0 @@ -DELETE FROM sp_tenant_configuration WHERE conf_key='action.cleanup.enabled'; -UPDATE sp_tenant_configuration SET conf_key='action.cleanup.auto.expiry' WHERE conf_key='action.cleanup.actionExpiry'; -UPDATE sp_tenant_configuration SET conf_key='action.cleanup.auto.status' WHERE conf_key='action.cleanup.actionStatus'; -UPDATE sp_tenant_configuration SET conf_key='actions.cleanup.onQuotaHit.percent' WHERE conf_key='action.cleanup.onQuotaHit.percent'; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_37__unify__MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_37__unify__MYSQL.sql deleted file mode 100644 index cf5763b92..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_37__unify__MYSQL.sql +++ /dev/null @@ -1,198 +0,0 @@ -UPDATE sp_software_module SET name = '' WHERE name IS NULL; -UPDATE sp_software_module_type SET name = '' WHERE name IS NULL; -UPDATE sp_distribution_set SET name = '' WHERE name IS NULL; -UPDATE sp_distribution_set_type SET name = '' WHERE name IS NULL; -UPDATE sp_distribution_set_tag SET name = '' WHERE name IS NULL; -UPDATE sp_target SET name = '' WHERE name IS NULL; -UPDATE sp_target_type SET name = '' WHERE name IS NULL; -UPDATE sp_target_tag SET name = '' WHERE name IS NULL; -UPDATE sp_target_filter_query SET name = '' WHERE name IS NULL; -UPDATE sp_rollout SET name = '' WHERE name IS NULL; -UPDATE sp_rollout_group SET name = '' WHERE name IS NULL; -UPDATE sp_target SET controller_id = '' WHERE controller_id IS NULL; - -ALTER TABLE sp_action - MODIFY active TINYINT(1); - -ALTER TABLE sp_distribution_set - MODIFY name VARCHAR(128) NOT NULL, - MODIFY deleted TINYINT(1), - MODIFY required_migration_step TINYINT(1); - -ALTER TABLE sp_distribution_set_type - MODIFY name VARCHAR(128) NOT NULL, - MODIFY deleted TINYINT(1); - -ALTER TABLE sp_distribution_set_tag - MODIFY name VARCHAR(128) NOT NULL; - -ALTER TABLE sp_ds_type_element - MODIFY mandatory TINYINT(1); - -ALTER TABLE sp_sm_metadata - MODIFY target_visible TINYINT(1); - -ALTER TABLE sp_software_module - MODIFY name VARCHAR(128) NOT NULL, - MODIFY deleted TINYINT(1); - -ALTER TABLE sp_software_module_type - MODIFY name VARCHAR(128) NOT NULL, - MODIFY deleted TINYINT(1); - -ALTER TABLE sp_target - MODIFY name VARCHAR(128) NOT NULL, - MODIFY controller_id VARCHAR(256) NOT NULL, - MODIFY request_controller_attributes TINYINT(1) NOT NULL; - -ALTER TABLE sp_target_type - MODIFY name VARCHAR(128) NOT NULL, - ALTER COLUMN type_key DROP DEFAULT; - -ALTER TABLE sp_target_tag - MODIFY name VARCHAR(128) NOT NULL; - -ALTER TABLE sp_target_filter_query - MODIFY name VARCHAR(128) NOT NULL; - -ALTER TABLE sp_rollout - MODIFY name VARCHAR(128) NOT NULL, - DROP COLUMN group_theshold; - -ALTER TABLE sp_rollout_group - MODIFY name VARCHAR(128) NOT NULL, - DROP INDEX sp_idx_rollout_group_parent; - - -SET FOREIGN_KEY_CHECKS=0; - -ALTER TABLE sp_action - DROP FOREIGN KEY fk_action_ds, - ADD CONSTRAINT fk_action_distribution_set - FOREIGN KEY (distribution_set) REFERENCES sp_distribution_set (id), - DROP FOREIGN KEY fk_action_rolloutgroup, - ADD CONSTRAINT fk_action_rollout_group - FOREIGN KEY (rollout_group) REFERENCES sp_rollout_group (id), - DROP FOREIGN KEY fk_targ_act_hist_targ, - ADD CONSTRAINT fk_action_target - FOREIGN KEY (target) REFERENCES sp_target (id) ON DELETE CASCADE; - -ALTER TABLE sp_action_status - DROP FOREIGN KEY fk_act_stat_action, - ADD CONSTRAINT fk_action_status_action - FOREIGN KEY (action) REFERENCES sp_action (id) ON DELETE CASCADE; - -ALTER TABLE sp_action_status_messages - DROP FOREIGN KEY fk_stat_msg_act_stat, - ADD CONSTRAINT fk_action_status_messages_action_status - FOREIGN KEY (action_status) REFERENCES sp_action_status (id) ON DELETE CASCADE; - -ALTER TABLE sp_artifact - DROP FOREIGN KEY fk_assigned_sm, - ADD CONSTRAINT fk_artifact_software_module - FOREIGN KEY (software_module) REFERENCES sp_software_module (id) ON DELETE CASCADE; - -ALTER TABLE sp_distribution_set - DROP FOREIGN KEY fk_ds_dstype_ds, - ADD CONSTRAINT fk_distribution_set_ds_type - FOREIGN KEY (ds_type) REFERENCES sp_distribution_set_type (id); - -ALTER TABLE sp_ds_metadata - DROP FOREIGN KEY fk_metadata_ds, - ADD CONSTRAINT fk_ds_metadata_ds - FOREIGN KEY (ds) REFERENCES sp_distribution_set (id) ON DELETE CASCADE; - -ALTER TABLE sp_ds_sm - DROP FOREIGN KEY fk_ds_module_ds, - ADD CONSTRAINT fk_ds_sm_ds_id - FOREIGN KEY (ds_id) REFERENCES sp_distribution_set (id) ON DELETE CASCADE, - DROP FOREIGN KEY fk_ds_module_module, - ADD CONSTRAINT fk_ds_sm_sm_id - FOREIGN KEY (sm_id) REFERENCES sp_software_module (id) ON DELETE CASCADE; - -ALTER TABLE sp_ds_tag - DROP FOREIGN KEY fk_ds_dstag_ds, - ADD CONSTRAINT fk_ds_tag_ds - FOREIGN KEY (ds) REFERENCES sp_distribution_set (id) ON DELETE CASCADE, - DROP FOREIGN KEY fk_ds_dstag_tag, - ADD CONSTRAINT fk_ds_tag_tag - FOREIGN KEY (tag) REFERENCES sp_distribution_set_tag (id) ON DELETE CASCADE; - -ALTER TABLE sp_ds_type_element - DROP FOREIGN KEY fk_ds_type_element_element, - ADD CONSTRAINT fk_ds_type_element_distribution_set_type - FOREIGN KEY (distribution_set_type) REFERENCES sp_distribution_set_type (id) ON DELETE CASCADE, - DROP FOREIGN KEY fk_ds_type_element_smtype, - ADD CONSTRAINT fk_ds_type_element_software_module_type - FOREIGN KEY (software_module_type) REFERENCES sp_software_module_type (id) ON DELETE CASCADE; - -ALTER TABLE sp_rollout - DROP FOREIGN KEY fk_rollout_ds, - ADD CONSTRAINT fk_rollout_distribution_set - FOREIGN KEY (distribution_set) REFERENCES sp_distribution_set (id); - -ALTER TABLE sp_rollout_group - DROP FOREIGN KEY fk_rolloutgroup_rollout, - ADD CONSTRAINT fk_rollout_group_rollout - FOREIGN KEY (rollout) REFERENCES sp_rollout (id) ON DELETE CASCADE; - -ALTER TABLE sp_rollout_target_group - DROP FOREIGN KEY fk_rollouttargetgroup_rolloutgroup, - ADD CONSTRAINT fk_rollout_target_group_rollout_group - FOREIGN KEY (rollout_group) REFERENCES sp_rollout_group (id) ON DELETE CASCADE, - DROP FOREIGN KEY fk_rollouttargetgroup_target, - ADD CONSTRAINT fk_rollout_target_group_target - FOREIGN KEY (target) REFERENCES sp_target (id) ON DELETE CASCADE; - -ALTER TABLE sp_sm_metadata - DROP FOREIGN KEY fk_metadata_sw, - ADD CONSTRAINT fk_sm_metadata_sm - FOREIGN KEY (sm) REFERENCES sp_software_module (id) ON DELETE CASCADE; - -ALTER TABLE sp_software_module - DROP FOREIGN KEY fk_module_type, - ADD CONSTRAINT fk_software_module_sm_type - FOREIGN KEY (sm_type) REFERENCES sp_software_module_type (id); - -ALTER TABLE sp_target_attributes - DROP FOREIGN KEY fk_targ_attrib_target, - ADD CONSTRAINT fk_target_attributes_target - FOREIGN KEY (target) REFERENCES sp_target (id) ON DELETE CASCADE; - -ALTER TABLE sp_target_conf_status - DROP FOREIGN KEY fk_target_auto_conf, - ADD CONSTRAINT fk_target_conf_status_target - FOREIGN KEY (target) REFERENCES sp_target (id) ON DELETE CASCADE; - -ALTER TABLE sp_target_filter_query - DROP FOREIGN KEY fk_filter_auto_assign_ds, - ADD CONSTRAINT fk_target_filter_query_auto_assign_distribution_set - FOREIGN KEY (auto_assign_distribution_set) REFERENCES sp_distribution_set (id) ON DELETE SET NULL; - -ALTER TABLE sp_target_metadata - DROP FOREIGN KEY fk_metadata_target, - ADD CONSTRAINT fk_target_metadata_target - FOREIGN KEY (target) REFERENCES sp_target (id) ON DELETE CASCADE; - -ALTER TABLE sp_target_target_tag - DROP FOREIGN KEY fk_targ_targtag_tag, - ADD CONSTRAINT fk_target_target_tag_tag - FOREIGN KEY (tag) REFERENCES sp_target_tag (id) ON DELETE CASCADE, - DROP FOREIGN KEY fk_targ_targtag_target, - ADD CONSTRAINT fk_target_target_tag_target - FOREIGN KEY (target) REFERENCES sp_target (id) ON DELETE CASCADE; - -ALTER TABLE sp_target_type_ds_type - DROP FOREIGN KEY fk_target_type_relation_ds_type, - ADD CONSTRAINT fk_target_type_ds_type_distribution_set_type - FOREIGN KEY (distribution_set_type) REFERENCES sp_distribution_set_type (id) ON DELETE CASCADE, - DROP FOREIGN KEY fk_target_type_relation_target_type, - ADD CONSTRAINT fk_target_type_ds_type_target_type - FOREIGN KEY (target_type) REFERENCES sp_target_type (id) ON DELETE CASCADE; - -ALTER TABLE sp_tenant - DROP FOREIGN KEY fk_tenant_md_default_ds_type, - ADD CONSTRAINT fk_tenant_default_ds_type - FOREIGN KEY (default_ds_type) REFERENCES sp_distribution_set_type (id); - -SET FOREIGN_KEY_CHECKS=1; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_38__varchar_to_text___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_38__varchar_to_text___MYSQL.sql deleted file mode 100644 index ed4b8d440..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_38__varchar_to_text___MYSQL.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_tenant_configuration MODIFY conf_value TEXT NOT NULL; -ALTER TABLE sp_target_filter_query MODIFY access_control_context TEXT; -ALTER TABLE sp_rollout MODIFY access_control_context TEXT; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_39__add_rollout_group_parent_index___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_39__add_rollout_group_parent_index___MYSQL.sql deleted file mode 100644 index acbdfe909..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_39__add_rollout_group_parent_index___MYSQL.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX sp_idx_rollout_group_parent ON sp_rollout_group (parent); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_3__cascade_delete___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_3__cascade_delete___MYSQL.sql deleted file mode 100644 index 56986b6b9..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_3__cascade_delete___MYSQL.sql +++ /dev/null @@ -1 +0,0 @@ -alter table sp_rolloutgroup drop FOREIGN KEY fk_rolloutgroup_rolloutgroup; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_4__add_maintenance_window___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_4__add_maintenance_window___MYSQL.sql deleted file mode 100644 index 6c546cede..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_4__add_maintenance_window___MYSQL.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_action ADD column maintenance_cron_schedule VARCHAR(40); -ALTER TABLE sp_action ADD column maintenance_duration VARCHAR(40); -ALTER TABLE sp_action ADD column maintenance_time_zone VARCHAR(40); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_6__add_index___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_6__add_index___MYSQL.sql deleted file mode 100644 index d7d7d6cc7..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_6__add_index___MYSQL.sql +++ /dev/null @@ -1,2 +0,0 @@ -CREATE INDEX sp_idx_target_tag_01 ON sp_target_tag (tenant, name); -CREATE INDEX sp_idx_distribution_set_tag_01 ON sp_distributionset_tag (tenant, name); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_7__add_rollout_approval_fields___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_7__add_rollout_approval_fields___MYSQL.sql deleted file mode 100644 index 8438d909e..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_7__add_rollout_approval_fields___MYSQL.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_rollout ADD column approval_decided_by varchar(40); -ALTER TABLE sp_rollout ADD column approval_remark varchar(255); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_8__change_length_of_created_last_modified_by___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_8__change_length_of_created_last_modified_by___MYSQL.sql deleted file mode 100644 index 283fdf2c9..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_8__change_length_of_created_last_modified_by___MYSQL.sql +++ /dev/null @@ -1,29 +0,0 @@ -ALTER TABLE sp_action MODIFY created_by VARCHAR(64), MODIFY last_modified_by VARCHAR(64); - -ALTER TABLE sp_action_status MODIFY created_by VARCHAR(64), MODIFY last_modified_by VARCHAR(64); - -ALTER TABLE sp_artifact MODIFY created_by VARCHAR(64), MODIFY last_modified_by VARCHAR(64); - -ALTER TABLE sp_base_software_module MODIFY created_by VARCHAR(64), MODIFY last_modified_by VARCHAR(64); - -ALTER TABLE sp_distributionset_tag MODIFY created_by VARCHAR(64), MODIFY last_modified_by VARCHAR(64); - -ALTER TABLE sp_distribution_set MODIFY created_by VARCHAR(64), MODIFY last_modified_by VARCHAR(64); - -ALTER TABLE sp_distribution_set_type MODIFY created_by VARCHAR(64), MODIFY last_modified_by VARCHAR(64); - -ALTER TABLE sp_rollout MODIFY created_by VARCHAR(64), MODIFY last_modified_by VARCHAR(64), MODIFY approval_decided_by VARCHAR(64); - -ALTER TABLE sp_rolloutgroup MODIFY created_by VARCHAR(64), MODIFY last_modified_by VARCHAR(64); - -ALTER TABLE sp_software_module_type MODIFY created_by VARCHAR(64), MODIFY last_modified_by VARCHAR(64); - -ALTER TABLE sp_target MODIFY created_by VARCHAR(64), MODIFY last_modified_by VARCHAR(64); - -ALTER TABLE sp_target_filter_query MODIFY created_by VARCHAR(64), MODIFY last_modified_by VARCHAR(64); - -ALTER TABLE sp_target_tag MODIFY created_by VARCHAR(64), MODIFY last_modified_by VARCHAR(64); - -ALTER TABLE sp_tenant MODIFY created_by VARCHAR(64), MODIFY last_modified_by VARCHAR(64); - -ALTER TABLE sp_tenant_configuration MODIFY created_by VARCHAR(64), MODIFY last_modified_by VARCHAR(64); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_9__add_target_metadata___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_9__add_target_metadata___MYSQL.sql deleted file mode 100644 index 3b1be5e4b..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_9__add_target_metadata___MYSQL.sql +++ /dev/null @@ -1,12 +0,0 @@ -create table sp_target_metadata ( - meta_key varchar(128) not null, - meta_value varchar(4000), - target_id bigint not null, - primary key (target_id, meta_key) -); - -alter table sp_target_metadata - add constraint fk_metadata_target - foreign key (target_id) - references sp_target (id) - on delete cascade; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_2_0__update_target_info_for_message___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_2_0__update_target_info_for_message___MYSQL.sql deleted file mode 100644 index 84f37aed8..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_2_0__update_target_info_for_message___MYSQL.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP INDEX sp_idx_target_info_01 ON sp_target_info; - -ALTER TABLE sp_target_info -CHANGE ip_address address VARCHAR(512); - -UPDATE sp_target_info t1, sp_target_info t2 -SET t1.address = CONCAT('http://',t2.address) -WHERE t1.target_id = t2.target_id AND t2.address is not null \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_4_0__cascade_delete___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_4_0__cascade_delete___MYSQL.sql deleted file mode 100644 index a96f76dcb..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_4_0__cascade_delete___MYSQL.sql +++ /dev/null @@ -1,73 +0,0 @@ -alter table sp_target_info drop FOREIGN KEY fk_targ_stat_targ; -alter table sp_target_info - add constraint fk_targ_stat_targ - foreign key (target_id) - references sp_target (id) - on delete cascade; - -alter table sp_action drop FOREIGN KEY fk_targ_act_hist_targ; -alter table sp_action drop index fk_targ_act_hist_targ; -alter table sp_action - add constraint fk_targ_act_hist_targ - foreign key (target) - references sp_target (id) - on delete cascade; - -alter table sp_action_status drop FOREIGN KEY fk_act_stat_action; -alter table sp_action_status drop index fk_act_stat_action; -alter table sp_action_status - add constraint fk_act_stat_action - foreign key (action) - references sp_action (id) - on delete cascade; - -alter table sp_sw_metadata drop FOREIGN KEY fk_metadata_sw; -alter table sp_sw_metadata drop index fk_metadata_sw; -alter table sp_sw_metadata - add constraint fk_metadata_sw - foreign key (sw_id) - references sp_base_software_module (id) - on delete cascade; - -alter table sp_ds_metadata drop FOREIGN KEY fk_metadata_ds; -alter table sp_ds_metadata - add constraint fk_metadata_ds - foreign key (ds_id) - references sp_distribution_set (id) - on delete cascade; - -alter table sp_action_status_messages drop FOREIGN KEY fk_stat_msg_act_stat; -alter table sp_action_status_messages - add constraint fk_stat_msg_act_stat - foreign key (action_status_id) - references sp_action_status (id) - on delete cascade; - -alter table sp_ds_dstag drop FOREIGN KEY fk_ds_dstag_tag; -alter table sp_ds_dstag drop index fk_ds_dstag_tag; -alter table sp_ds_dstag - add constraint fk_ds_dstag_tag - foreign key (TAG) - references sp_distributionset_tag (id) - on delete cascade; - -alter table sp_ds_dstag drop FOREIGN KEY fk_ds_dstag_ds; -alter table sp_ds_dstag - add constraint fk_ds_dstag_ds - foreign key (ds) - references sp_distribution_set (id) - on delete cascade; - -alter table sp_target_target_tag drop FOREIGN KEY fk_targ_targtag_tag; -alter table sp_target_target_tag - add constraint fk_targ_targtag_tag - foreign key (tag) - references sp_target_tag (id) - on delete cascade; - -alter table sp_target_target_tag drop FOREIGN KEY fk_targ_targtag_target; -alter table sp_target_target_tag - add constraint fk_targ_targtag_target - foreign key (target) - references sp_target (id) - on delete cascade; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_4_1__cascade_delete___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_4_1__cascade_delete___MYSQL.sql deleted file mode 100644 index e1ba9ec74..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_4_1__cascade_delete___MYSQL.sql +++ /dev/null @@ -1,6 +0,0 @@ -alter table sp_target_attributes drop FOREIGN KEY fk_targ_attrib_target; -alter table sp_target_attributes - add constraint fk_targ_attrib_target - foreign key (target_id) - references sp_target_info (target_id) - on delete cascade; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_5_0__target_filter_query___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_5_0__target_filter_query___MYSQL.sql deleted file mode 100644 index 590329345..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_5_0__target_filter_query___MYSQL.sql +++ /dev/null @@ -1,15 +0,0 @@ - create table sp_target_filter_query ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - name varchar(64) not null, - query varchar(1024) not null, - primary key (id) - ); - - - create index sp_idx_target_filter_query_01 on sp_target_filter_query (tenant, name); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_6_0__rollout_management___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_6_0__rollout_management___MYSQL.sql deleted file mode 100644 index 4cd4c7ea4..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_6_0__rollout_management___MYSQL.sql +++ /dev/null @@ -1,103 +0,0 @@ - create table sp_rolloutgroup ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - error_condition integer, - error_condition_exp varchar(512), - error_action integer, - error_action_exp varchar(512), - success_condition integer not null, - success_condition_exp varchar(512) not null, - success_action integer not null, - success_action_exp varchar(512), - status integer, - parent_id bigint, - rollout bigint, - total_targets bigint, - primary key (id) - ); - - create table sp_rollout ( - id bigint not null auto_increment, - created_at bigint, - created_by varchar(40), - last_modified_at bigint, - last_modified_by varchar(40), - optlock_revision bigint, - tenant varchar(40) not null, - description varchar(512), - name varchar(64) not null, - last_check bigint, - group_theshold float, - status integer, - distribution_set bigint, - target_filter varchar(1024), - action_type varchar(255) not null, - forced_time bigint, - total_targets bigint, - primary key (id) - ); - - create table sp_rollouttargetgroup ( - target_Id bigint not null, - rolloutGroup_Id bigint not null, - primary key (rolloutGroup_Id, target_Id) - ); - - create index sp_idx_rollout_01 on sp_rollout (tenant, name); - - create index sp_idx_rolloutgroup_01 on sp_rolloutgroup (tenant, name); - - ALTER TABLE sp_action ADD COLUMN rollout bigint; - ALTER TABLE sp_action ADD COLUMN rolloutgroup bigint; - - alter table sp_rollout - add constraint uk_rollout unique (name, tenant); - - alter table sp_rolloutgroup - add constraint uk_rolloutgroup unique (name, rollout, tenant); - - alter table sp_action - add constraint fk_action_rollout - foreign key (rollout) - references sp_rollout (id); - - alter table sp_action - add constraint fk_action_rolloutgroup - foreign key (rolloutgroup) - references sp_rolloutgroup (id); - - alter table sp_rollout - add constraint fk_rollout_ds - foreign key (distribution_set) - references sp_distribution_set (id); - - alter table sp_rolloutgroup - add constraint fk_rolloutgroup_rollout - foreign key (rollout) - references sp_rollout (id) - on delete cascade; - - alter table sp_rolloutgroup - add constraint fk_rolloutgroup_rolloutgroup - foreign key (parent_id) - references sp_rolloutgroup (id) - on delete cascade; - - alter table sp_rollouttargetgroup - add constraint fk_rollouttargetgroup_target - foreign key (target_id) - references sp_target (id) - on delete cascade; - - alter table sp_rollouttargetgroup - add constraint fk_rollouttargetgroup_rolloutgroup - foreign key (rolloutgroup_id) - references sp_rolloutgroup (id) - on delete cascade; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_7_0__swmType_maxAssignment_greater_0__MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_7_0__swmType_maxAssignment_greater_0__MYSQL.sql deleted file mode 100644 index f79c9375c..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_7_0__swmType_maxAssignment_greater_0__MYSQL.sql +++ /dev/null @@ -1 +0,0 @@ -Update sp_software_module_type set max_ds_assignments = 1 where max_ds_assignments < 1; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_7_1__reduce_length_enums___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_7_1__reduce_length_enums___MYSQL.sql deleted file mode 100644 index ae9eef28e..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_7_1__reduce_length_enums___MYSQL.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE sp_target_info MODIFY update_status VARCHAR(16) not null; -ALTER TABLE sp_action MODIFY action_type VARCHAR(16) not null; -ALTER TABLE sp_rollout MODIFY action_type VARCHAR(16) not null; -ALTER TABLE sp_tenant_configuration MODIFY conf_key VARCHAR(128) not null; -ALTER TABLE sp_tenant_configuration MODIFY conf_value VARCHAR(512) not null; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_8_0__auto_assign_ds_filter__MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_8_0__auto_assign_ds_filter__MYSQL.sql deleted file mode 100644 index e56a6d242..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_8_0__auto_assign_ds_filter__MYSQL.sql +++ /dev/null @@ -1,8 +0,0 @@ -ALTER TABLE sp_target_filter_query - ADD COLUMN auto_assign_distribution_set BIGINT; - -ALTER TABLE sp_target_filter_query - ADD CONSTRAINT fk_filter_auto_assign_ds -FOREIGN KEY (auto_assign_distribution_set) -REFERENCES sp_distribution_set (id) -ON DELETE SET NULL; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_8_1__cascade_delete___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_8_1__cascade_delete___MYSQL.sql deleted file mode 100644 index 9cc12b375..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_8_1__cascade_delete___MYSQL.sql +++ /dev/null @@ -1,27 +0,0 @@ -alter table sp_ds_module drop FOREIGN KEY fk_ds_module_ds; -alter table sp_ds_module - add constraint fk_ds_module_ds - foreign key (ds_id) - references sp_distribution_set (id) - on delete cascade; - -alter table sp_ds_module drop FOREIGN KEY fk_ds_module_module; -alter table sp_ds_module - add constraint fk_ds_module_module - foreign key (module_id) - references sp_base_software_module (id) - on delete cascade; - -alter table sp_external_artifact drop FOREIGN KEY fk_external_assigned_sm; -alter table sp_external_artifact - add constraint fk_external_assigned_sm - foreign key (software_module) - references sp_base_software_module (id) - on delete cascade; - -alter table sp_artifact drop FOREIGN KEY fk_assigned_sm; -alter table sp_artifact - add constraint fk_assigned_sm - foreign key (software_module) - references sp_base_software_module (id) - on delete cascade; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_8_2__remove_external_artifact___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_8_2__remove_external_artifact___MYSQL.sql deleted file mode 100644 index f806edd8d..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_8_2__remove_external_artifact___MYSQL.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE sp_external_artifact; -DROP TABLE sp_external_provider; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_9_0__add_rollout_groups_created___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_9_0__add_rollout_groups_created___MYSQL.sql deleted file mode 100644 index 64518f762..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_9_0__add_rollout_groups_created___MYSQL.sql +++ /dev/null @@ -1,2 +0,0 @@ - ALTER TABLE sp_rollout ADD column rollout_groups_created BIGINT; - \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_15__baseline___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_15__baseline___POSTGRESQL.sql deleted file mode 100644 index ba8b988d6..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_15__baseline___POSTGRESQL.sql +++ /dev/null @@ -1,872 +0,0 @@ --- ------------ Write CREATE-SEQUENCE-stage scripts ----------- - -CREATE SEQUENCE IF NOT EXISTS sp_action_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - -CREATE SEQUENCE IF NOT EXISTS sp_action_status_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - -CREATE SEQUENCE IF NOT EXISTS sp_artifact_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - -CREATE SEQUENCE IF NOT EXISTS sp_base_software_module_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - -CREATE SEQUENCE IF NOT EXISTS sp_distribution_set_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - -CREATE SEQUENCE IF NOT EXISTS sp_distribution_set_type_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - -CREATE SEQUENCE IF NOT EXISTS sp_distributionset_tag_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - -CREATE SEQUENCE IF NOT EXISTS sp_rollout_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - -CREATE SEQUENCE IF NOT EXISTS sp_rolloutgroup_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - -CREATE SEQUENCE IF NOT EXISTS sp_software_module_type_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - -CREATE SEQUENCE IF NOT EXISTS sp_target_filter_query_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - -CREATE SEQUENCE IF NOT EXISTS sp_target_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - -CREATE SEQUENCE IF NOT EXISTS sp_target_tag_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - -CREATE SEQUENCE IF NOT EXISTS sp_tenant_configuration_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - -CREATE SEQUENCE IF NOT EXISTS sp_tenant_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - --- ------------ Write CREATE-TABLE-stage scripts ----------- - -CREATE TABLE sp_action( - id BIGINT NOT NULL DEFAULT nextval('sp_action_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - active BOOLEAN, - forced_time BIGINT, - status INTEGER NOT NULL, - distribution_set BIGINT NOT NULL, - target BIGINT NOT NULL, - rollout BIGINT, - rolloutgroup BIGINT, - action_type INTEGER NOT NULL, - maintenance_cron_schedule VARCHAR(40), - maintenance_duration VARCHAR(40), - maintenance_time_zone VARCHAR(40), - external_ref VARCHAR(512), - weight INTEGER -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_action_status( - id BIGINT NOT NULL DEFAULT nextval('sp_action_status_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - target_occurred_at BIGINT NOT NULL, - status INTEGER NOT NULL, - action BIGINT NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_action_status_messages( - action_status_id BIGINT NOT NULL, - detail_message VARCHAR(512) NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_artifact( - id BIGINT NOT NULL DEFAULT nextval('sp_artifact_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - md5_hash VARCHAR(32), - file_size BIGINT, - provided_file_name VARCHAR(256), - sha1_hash VARCHAR(40) NOT NULL, - software_module BIGINT NOT NULL, - sha256_hash CHAR(64) -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_base_software_module( - id BIGINT NOT NULL DEFAULT nextval('sp_base_software_module_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - description VARCHAR(512), - name VARCHAR(128), - version VARCHAR(64) NOT NULL, - deleted BOOLEAN, - vendor VARCHAR(256), - module_type BIGINT NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_distribution_set( - id BIGINT NOT NULL DEFAULT nextval('sp_distribution_set_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - description VARCHAR(512), - name VARCHAR(128), - version VARCHAR(64) NOT NULL, - complete BOOLEAN, - deleted BOOLEAN, - required_migration_step BOOLEAN, - ds_id BIGINT NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_distribution_set_type( - id BIGINT NOT NULL DEFAULT nextval('sp_distribution_set_type_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - description VARCHAR(512), - name VARCHAR(128), - colour VARCHAR(16), - deleted BOOLEAN, - type_key VARCHAR(64) NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_distributionset_tag( - id BIGINT NOT NULL DEFAULT nextval('sp_distributionset_tag_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - description VARCHAR(512), - name VARCHAR(128), - colour VARCHAR(16) -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_ds_dstag( - ds BIGINT NOT NULL, - tag BIGINT NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_ds_metadata( - meta_key VARCHAR(128) NOT NULL, - meta_value VARCHAR(4000), - ds_id BIGINT NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_ds_module( - ds_id BIGINT NOT NULL, - module_id BIGINT NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_ds_type_element( - mandatory BOOLEAN, - distribution_set_type BIGINT NOT NULL, - software_module_type BIGINT NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_rollout( - id BIGINT NOT NULL DEFAULT nextval('sp_rollout_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - description VARCHAR(512), - name VARCHAR(128), - last_check BIGINT, - group_theshold REAL, - status INTEGER NOT NULL, - distribution_set BIGINT NOT NULL, - target_filter VARCHAR(1024), - forced_time BIGINT, - total_targets BIGINT, - rollout_groups_created BIGINT, - start_at BIGINT, - deleted BOOLEAN, - action_type INTEGER NOT NULL, - approval_decided_by VARCHAR(64), - approval_remark VARCHAR(255), - weight INTEGER -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_rolloutgroup( - id BIGINT NOT NULL DEFAULT nextval('sp_rolloutgroup_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - description VARCHAR(512), - name VARCHAR(128), - error_condition INTEGER, - error_condition_exp VARCHAR(512), - error_action INTEGER, - error_action_exp VARCHAR(512), - success_condition INTEGER NOT NULL, - success_condition_exp VARCHAR(512) NOT NULL, - success_action INTEGER NOT NULL, - success_action_exp VARCHAR(512), - status INTEGER NOT NULL, - parent_id BIGINT, - rollout BIGINT NOT NULL, - total_targets BIGINT, - target_percentage REAL, - target_filter VARCHAR(1024) -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_rollouttargetgroup( - target_id BIGINT NOT NULL, - rolloutgroup_id BIGINT NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_software_module_type( - id BIGINT NOT NULL DEFAULT nextval('sp_software_module_type_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - description VARCHAR(512), - name VARCHAR(128), - colour VARCHAR(16), - deleted BOOLEAN, - type_key VARCHAR(64) NOT NULL, - max_ds_assignments INTEGER NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_sw_metadata( - meta_key VARCHAR(128) NOT NULL, - meta_value VARCHAR(4000), - sw_id BIGINT NOT NULL, - target_visible BOOLEAN -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_target( - id BIGINT NOT NULL DEFAULT nextval('sp_target_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - description VARCHAR(512), - name VARCHAR(128), - controller_id VARCHAR(256), - sec_token VARCHAR(128) NOT NULL, - assigned_distribution_set BIGINT, - install_date BIGINT, - address VARCHAR(512), - last_target_query BIGINT, - request_controller_attributes BOOLEAN NOT NULL, - installed_distribution_set BIGINT, - update_status INTEGER NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_target_attributes( - target_id BIGINT NOT NULL, - attribute_value VARCHAR(128), - attribute_key VARCHAR(128) NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_target_filter_query( - id BIGINT NOT NULL DEFAULT nextval('sp_target_filter_query_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - name VARCHAR(128), - query VARCHAR(1024) NOT NULL, - auto_assign_distribution_set BIGINT, - auto_assign_action_type INTEGER, - auto_assign_weight INTEGER -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_target_metadata( - meta_key VARCHAR(128) NOT NULL, - meta_value VARCHAR(4000), - target_id BIGINT NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_target_tag( - id BIGINT NOT NULL DEFAULT nextval('sp_target_tag_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - description VARCHAR(512), - name VARCHAR(128), - colour VARCHAR(16) -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_target_target_tag( - target BIGINT NOT NULL, - tag BIGINT NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_tenant( - id BIGINT NOT NULL DEFAULT nextval('sp_tenant_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - default_ds_type BIGINT NOT NULL -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_tenant_configuration( - id BIGINT NOT NULL DEFAULT nextval('sp_tenant_configuration_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - conf_key VARCHAR(128) NOT NULL, - conf_value VARCHAR(512) NOT NULL -) - WITH ( - OIDS=FALSE - ); - --- ------------ Write CREATE-INDEX-stage scripts ----------- - -CREATE INDEX sp_idx_action_01_sp_action -ON sp_action -USING BTREE (tenant, distribution_set); - -CREATE INDEX sp_idx_action_02_sp_action -ON sp_action -USING BTREE (tenant, target, active); - -CREATE INDEX sp_idx_action_external_ref_sp_action -ON sp_action -USING BTREE (external_ref); - -CREATE INDEX sp_idx_action_prim_sp_action -ON sp_action -USING BTREE (tenant, id); - -CREATE INDEX sp_idx_action_status_02_sp_action_status -ON sp_action_status -USING BTREE (tenant, action, status); - -CREATE INDEX sp_idx_action_status_prim_sp_action_status -ON sp_action_status -USING BTREE (tenant, id); - -CREATE INDEX sp_idx_action_status_msgs_01_sp_action_status_messages -ON sp_action_status_messages -USING BTREE (action_status_id); - -CREATE INDEX sp_idx_artifact_01_sp_artifact -ON sp_artifact -USING BTREE (tenant, software_module); - -CREATE INDEX sp_idx_artifact_02_sp_artifact -ON sp_artifact -USING BTREE (tenant, sha1_hash); - -CREATE INDEX sp_idx_artifact_prim_sp_artifact -ON sp_artifact -USING BTREE (tenant, id); - -CREATE INDEX sp_idx_base_sw_module_01_sp_base_software_module -ON sp_base_software_module -USING BTREE (tenant, deleted, name, version); - -CREATE INDEX sp_idx_base_sw_module_02_sp_base_software_module -ON sp_base_software_module -USING BTREE (tenant, deleted, module_type); - -CREATE INDEX sp_idx_base_sw_module_prim_sp_base_software_module -ON sp_base_software_module -USING BTREE (tenant, id); - -CREATE INDEX sp_idx_distribution_set_01_sp_distribution_set -ON sp_distribution_set -USING BTREE (tenant, deleted, complete); - -CREATE INDEX sp_idx_distribution_set_prim_sp_distribution_set -ON sp_distribution_set -USING BTREE (tenant, id); - -CREATE INDEX sp_idx_distribution_set_type_01_sp_distribution_set_type -ON sp_distribution_set_type -USING BTREE (tenant, deleted); - -CREATE INDEX sp_idx_distribution_set_type_prim_sp_distribution_set_type -ON sp_distribution_set_type -USING BTREE (tenant, id); - -CREATE INDEX sp_idx_distribution_set_tag_01_sp_distributionset_tag -ON sp_distributionset_tag -USING BTREE (tenant, name); - -CREATE INDEX sp_idx_distribution_set_tag_prim_sp_distributionset_tag -ON sp_distributionset_tag -USING BTREE (tenant, id); - -CREATE INDEX fk_rolloutgroup_rolloutgroup_sp_rolloutgroup -ON sp_rolloutgroup -USING BTREE (parent_id); - -CREATE INDEX sp_idx_software_module_type_01_sp_software_module_type -ON sp_software_module_type -USING BTREE (tenant, deleted); - -CREATE INDEX sp_idx_software_module_type_prim_sp_software_module_type -ON sp_software_module_type -USING BTREE (tenant, id); - -CREATE INDEX sp_idx_target_01_sp_target -ON sp_target -USING BTREE (tenant, name, assigned_distribution_set); - -CREATE INDEX sp_idx_target_03_sp_target -ON sp_target -USING BTREE (tenant, controller_id, assigned_distribution_set); - -CREATE INDEX sp_idx_target_04_sp_target -ON sp_target -USING BTREE (tenant, created_at); - -CREATE INDEX sp_idx_target_prim_sp_target -ON sp_target -USING BTREE (tenant, id); - -CREATE INDEX sp_idx_target_tag_01_sp_target_tag -ON sp_target_tag -USING BTREE (tenant, name); - -CREATE INDEX sp_idx_target_tag_prim_sp_target_tag -ON sp_target_tag -USING BTREE (tenant, id); - -CREATE INDEX sp_idx_tenant_prim_sp_tenant -ON sp_tenant -USING BTREE (tenant, id); - --- ------------ Write CREATE-CONSTRAINT-stage scripts ----------- - -ALTER TABLE sp_action -ADD CONSTRAINT pk_sp_action PRIMARY KEY (id); - -ALTER TABLE sp_action_status -ADD CONSTRAINT pk_sp_action_status PRIMARY KEY (id); - -ALTER TABLE sp_artifact -ADD CONSTRAINT pk_sp_artifact PRIMARY KEY (id); - -ALTER TABLE sp_base_software_module -ADD CONSTRAINT pk_sp_base_software_module PRIMARY KEY (id); - -ALTER TABLE sp_base_software_module -ADD CONSTRAINT uk_base_sw_mod_sp_base_software_module UNIQUE (module_type, name, version, tenant); - -ALTER TABLE sp_distribution_set -ADD CONSTRAINT pk_sp_distribution_set PRIMARY KEY (id); - -ALTER TABLE sp_distribution_set -ADD CONSTRAINT uk_distrib_set_sp_distribution_set UNIQUE (name, version, tenant); - -ALTER TABLE sp_distribution_set_type -ADD CONSTRAINT pk_sp_distribution_set_type PRIMARY KEY (id); - -ALTER TABLE sp_distribution_set_type -ADD CONSTRAINT uk_dst_key_sp_distribution_set_type UNIQUE (type_key, tenant); - -ALTER TABLE sp_distribution_set_type -ADD CONSTRAINT uk_dst_name_sp_distribution_set_type UNIQUE (name, tenant); - -ALTER TABLE sp_distributionset_tag -ADD CONSTRAINT pk_sp_distributionset_tag PRIMARY KEY (id); - -ALTER TABLE sp_distributionset_tag -ADD CONSTRAINT uk_ds_tag_sp_distributionset_tag UNIQUE (name, tenant); - -ALTER TABLE sp_ds_dstag -ADD CONSTRAINT pk_sp_ds_dstag PRIMARY KEY (ds, tag); - -ALTER TABLE sp_ds_metadata -ADD CONSTRAINT pk_sp_ds_metadata PRIMARY KEY (ds_id, meta_key); - -ALTER TABLE sp_ds_module -ADD CONSTRAINT pk_sp_ds_module PRIMARY KEY (ds_id, module_id); - -ALTER TABLE sp_ds_type_element -ADD CONSTRAINT pk_sp_ds_type_element PRIMARY KEY (distribution_set_type, software_module_type); - -ALTER TABLE sp_rollout -ADD CONSTRAINT pk_sp_rollout PRIMARY KEY (id); - -ALTER TABLE sp_rollout -ADD CONSTRAINT uk_rollout_sp_rollout UNIQUE (name, tenant); - -ALTER TABLE sp_rolloutgroup -ADD CONSTRAINT pk_sp_rolloutgroup PRIMARY KEY (id); - -ALTER TABLE sp_rolloutgroup -ADD CONSTRAINT uk_rolloutgroup_sp_rolloutgroup UNIQUE (name, rollout, tenant); - -ALTER TABLE sp_rollouttargetgroup -ADD CONSTRAINT pk_sp_rollouttargetgroup PRIMARY KEY (rolloutgroup_id, target_id); - -ALTER TABLE sp_software_module_type -ADD CONSTRAINT pk_sp_software_module_type PRIMARY KEY (id); - -ALTER TABLE sp_software_module_type -ADD CONSTRAINT uk_smt_name_sp_software_module_type UNIQUE (name, tenant); - -ALTER TABLE sp_software_module_type -ADD CONSTRAINT uk_smt_type_key_sp_software_module_type UNIQUE (type_key, tenant); - -ALTER TABLE sp_sw_metadata -ADD CONSTRAINT pk_sp_sw_metadata PRIMARY KEY (meta_key, sw_id); - -ALTER TABLE sp_target -ADD CONSTRAINT pk_sp_target PRIMARY KEY (id); - -ALTER TABLE sp_target -ADD CONSTRAINT uk_tenant_controller_id_sp_target UNIQUE (controller_id, tenant); - -ALTER TABLE sp_target_attributes -ADD CONSTRAINT pk_sp_target_attributes PRIMARY KEY (target_id, attribute_key); - -ALTER TABLE sp_target_filter_query -ADD CONSTRAINT pk_sp_target_filter_query PRIMARY KEY (id); - -ALTER TABLE sp_target_filter_query -ADD CONSTRAINT uk_tenant_custom_filter_name_sp_target_filter_query UNIQUE (name, tenant); - -ALTER TABLE sp_target_metadata -ADD CONSTRAINT pk_sp_target_metadata PRIMARY KEY (target_id, meta_key); - -ALTER TABLE sp_target_tag -ADD CONSTRAINT pk_sp_target_tag PRIMARY KEY (id); - -ALTER TABLE sp_target_tag -ADD CONSTRAINT uk_targ_tag_sp_target_tag UNIQUE (name, tenant); - -ALTER TABLE sp_target_target_tag -ADD CONSTRAINT pk_sp_target_target_tag PRIMARY KEY (target, tag); - -ALTER TABLE sp_tenant -ADD CONSTRAINT pk_sp_tenant PRIMARY KEY (id); - -ALTER TABLE sp_tenant -ADD CONSTRAINT uk_tenantmd_tenant_sp_tenant UNIQUE (tenant); - -ALTER TABLE sp_tenant_configuration -ADD CONSTRAINT pk_sp_tenant_configuration PRIMARY KEY (id); - -ALTER TABLE sp_tenant_configuration -ADD CONSTRAINT uk_tenant_key_sp_tenant_configuration UNIQUE (conf_key, tenant); - --- ------------ Write CREATE-FOREIGN-KEY-CONSTRAINT-stage scripts ----------- - -ALTER TABLE sp_action -ADD CONSTRAINT fk_action_ds FOREIGN KEY (distribution_set) -REFERENCES sp_distribution_set (id) -ON UPDATE RESTRICT -ON DELETE RESTRICT; - -ALTER TABLE sp_action -ADD CONSTRAINT fk_action_rollout FOREIGN KEY (rollout) -REFERENCES sp_rollout (id) -ON UPDATE RESTRICT -ON DELETE RESTRICT; - -ALTER TABLE sp_action -ADD CONSTRAINT fk_action_rolloutgroup FOREIGN KEY (rolloutgroup) -REFERENCES sp_rolloutgroup (id) -ON UPDATE RESTRICT -ON DELETE RESTRICT; - -ALTER TABLE sp_action -ADD CONSTRAINT fk_targ_act_hist_targ FOREIGN KEY (target) -REFERENCES sp_target (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_action_status -ADD CONSTRAINT fk_act_stat_action FOREIGN KEY (action) -REFERENCES sp_action (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_action_status_messages -ADD CONSTRAINT fk_stat_msg_act_stat FOREIGN KEY (action_status_id) -REFERENCES sp_action_status (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_artifact -ADD CONSTRAINT fk_assigned_sm FOREIGN KEY (software_module) -REFERENCES sp_base_software_module (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_base_software_module -ADD CONSTRAINT fk_module_type FOREIGN KEY (module_type) -REFERENCES sp_software_module_type (id) -ON UPDATE RESTRICT -ON DELETE RESTRICT; - -ALTER TABLE sp_distribution_set -ADD CONSTRAINT fk_ds_dstype_ds FOREIGN KEY (ds_id) -REFERENCES sp_distribution_set_type (id) -ON UPDATE RESTRICT -ON DELETE RESTRICT; - -ALTER TABLE sp_ds_dstag -ADD CONSTRAINT fk_ds_dstag_ds FOREIGN KEY (ds) -REFERENCES sp_distribution_set (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_ds_dstag -ADD CONSTRAINT fk_ds_dstag_tag FOREIGN KEY (tag) -REFERENCES sp_distributionset_tag (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_ds_metadata -ADD CONSTRAINT fk_metadata_ds FOREIGN KEY (ds_id) -REFERENCES sp_distribution_set (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_ds_module -ADD CONSTRAINT fk_ds_module_ds FOREIGN KEY (ds_id) -REFERENCES sp_distribution_set (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_ds_module -ADD CONSTRAINT fk_ds_module_module FOREIGN KEY (module_id) -REFERENCES sp_base_software_module (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_ds_type_element -ADD CONSTRAINT fk_ds_type_element_element FOREIGN KEY (distribution_set_type) -REFERENCES sp_distribution_set_type (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_ds_type_element -ADD CONSTRAINT fk_ds_type_element_smtype FOREIGN KEY (software_module_type) -REFERENCES sp_software_module_type (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_rollout -ADD CONSTRAINT fk_rollout_ds FOREIGN KEY (distribution_set) -REFERENCES sp_distribution_set (id) -ON UPDATE RESTRICT -ON DELETE RESTRICT; - -ALTER TABLE sp_rolloutgroup -ADD CONSTRAINT fk_rolloutgroup_rollout FOREIGN KEY (rollout) -REFERENCES sp_rollout (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_rollouttargetgroup -ADD CONSTRAINT fk_rollouttargetgroup_rolloutgroup FOREIGN KEY (rolloutgroup_id) -REFERENCES sp_rolloutgroup (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_rollouttargetgroup -ADD CONSTRAINT fk_rollouttargetgroup_target FOREIGN KEY (target_id) -REFERENCES sp_target (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_sw_metadata -ADD CONSTRAINT fk_metadata_sw FOREIGN KEY (sw_id) -REFERENCES sp_base_software_module (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_target -ADD CONSTRAINT fk_target_assign_ds FOREIGN KEY (assigned_distribution_set) -REFERENCES sp_distribution_set (id) -ON UPDATE RESTRICT -ON DELETE RESTRICT; - -ALTER TABLE sp_target -ADD CONSTRAINT fk_target_inst_ds FOREIGN KEY (installed_distribution_set) -REFERENCES sp_distribution_set (id) -ON UPDATE RESTRICT -ON DELETE RESTRICT; - -ALTER TABLE sp_target_attributes -ADD CONSTRAINT fk_targ_attrib_target FOREIGN KEY (target_id) -REFERENCES sp_target (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_target_filter_query -ADD CONSTRAINT fk_filter_auto_assign_ds FOREIGN KEY (auto_assign_distribution_set) -REFERENCES sp_distribution_set (id) -ON UPDATE RESTRICT -ON DELETE SET NULL; - -ALTER TABLE sp_target_metadata -ADD CONSTRAINT fk_metadata_target FOREIGN KEY (target_id) -REFERENCES sp_target (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_target_target_tag -ADD CONSTRAINT fk_targ_targtag_tag FOREIGN KEY (tag) -REFERENCES sp_target_tag (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_target_target_tag -ADD CONSTRAINT fk_targ_targtag_target FOREIGN KEY (target) -REFERENCES sp_target (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_tenant -ADD CONSTRAINT fk_tenant_md_default_ds_type FOREIGN KEY (default_ds_type) -REFERENCES sp_distribution_set_type (id) -ON UPDATE RESTRICT -ON DELETE RESTRICT; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_16__add_action_initiated_by___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_16__add_action_initiated_by___POSTGRESQL.sql deleted file mode 100644 index 14a68bfd3..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_16__add_action_initiated_by___POSTGRESQL.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE sp_action -ADD COLUMN initiated_by VARCHAR (64) NOT NULL DEFAULT ''; -ALTER TABLE sp_action -ALTER COLUMN initiated_by DROP DEFAULT; - -ALTER TABLE sp_target_filter_query -ADD COLUMN auto_assign_initiated_by VARCHAR (64); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_17__add_index_target_modified___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_17__add_index_target_modified___POSTGRESQL.sql deleted file mode 100644 index e509359e4..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_17__add_index_target_modified___POSTGRESQL.sql +++ /dev/null @@ -1,3 +0,0 @@ -CREATE INDEX sp_idx_target_05 -ON sp_target -USING BTREE (tenant, last_modified_at); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_18__add_target_type___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_18__add_target_type___POSTGRESQL.sql deleted file mode 100644 index 8acd8038d..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_18__add_target_type___POSTGRESQL.sql +++ /dev/null @@ -1,65 +0,0 @@ --- ------------ Write CREATE-SEQUENCE-stage scripts ----------- - -CREATE SEQUENCE IF NOT EXISTS sp_target_type_seq -INCREMENT BY 1 -START WITH 1 -NO CYCLE; - --- ------------ Write CREATE-TABLE-stage scripts ----------- - -CREATE TABLE sp_target_type( - id BIGINT NOT NULL DEFAULT nextval('sp_target_type_seq'), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - description VARCHAR(512), - name VARCHAR(64), - colour VARCHAR(16) -) - WITH ( - OIDS=FALSE - ); - -CREATE TABLE sp_target_type_ds_type_relation( - target_type BIGINT NOT NULL, - distribution_set_type BIGINT NOT NULL -) - WITH ( - OIDS=FALSE - ); - --- ------------ Alter Table and Write INDEX scripts ----------- - -ALTER TABLE sp_target_type -ADD CONSTRAINT pk_sp_target_type PRIMARY KEY (id); - -ALTER TABLE sp_target_type -ADD CONSTRAINT uk_target_type_name UNIQUE (name, tenant); - -CREATE INDEX sp_idx_target_type_prim -ON sp_target_type -USING BTREE (tenant, id); - -ALTER TABLE sp_target -ADD COLUMN target_type BIGINT; - -ALTER TABLE sp_target -ADD CONSTRAINT fk_target_relation_target_type FOREIGN KEY (target_type) -REFERENCES sp_target_type (id) -ON UPDATE RESTRICT -ON DELETE SET NULL; - -ALTER TABLE sp_target_type_ds_type_relation -ADD CONSTRAINT fk_target_type_relation_target_type FOREIGN KEY (target_type) -REFERENCES sp_target_type (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; - -ALTER TABLE sp_target_type_ds_type_relation -ADD CONSTRAINT fk_target_type_relation_ds_type FOREIGN KEY (distribution_set_type) -REFERENCES sp_distribution_set_type (id) -ON UPDATE RESTRICT -ON DELETE CASCADE; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_19__add_valid_flag_to_ds___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_19__add_valid_flag_to_ds___POSTGRESQL.sql deleted file mode 100644 index 6d2f70e74..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_19__add_valid_flag_to_ds___POSTGRESQL.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_distribution_set ADD COLUMN valid BOOLEAN; - -UPDATE sp_distribution_set SET valid = TRUE; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_20__add_encryption_flag_to_sm___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_20__add_encryption_flag_to_sm___POSTGRESQL.sql deleted file mode 100644 index 00ae94f2d..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_20__add_encryption_flag_to_sm___POSTGRESQL.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_base_software_module ADD COLUMN encrypted BOOLEAN; - -UPDATE sp_base_software_module SET encrypted = FALSE; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_21__add_rollouts_status_index___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_21__add_rollouts_status_index___POSTGRESQL.sql deleted file mode 100644 index 0d4783710..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_21__add_rollouts_status_index___POSTGRESQL.sql +++ /dev/null @@ -1,3 +0,0 @@ -CREATE INDEX sp_idx_rollout_status_tenant -ON sp_rollout -USING BTREE (tenant, status); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_22__change_target_type_name_length___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_22__change_target_type_name_length___POSTGRESQL.sql deleted file mode 100644 index c43d99f1f..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_22__change_target_type_name_length___POSTGRESQL.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE sp_target_type ALTER COLUMN name TYPE VARCHAR (128); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_23__add_action_status_code___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_23__add_action_status_code___POSTGRESQL.sql deleted file mode 100644 index 623bc3141..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_23__add_action_status_code___POSTGRESQL.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE sp_action_status ADD COLUMN code INTEGER; -CREATE INDEX sp_idx_action_status_03 - ON sp_action_status - USING BTREE (tenant, code); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_24__add_last_action_status_code___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_24__add_last_action_status_code___POSTGRESQL.sql deleted file mode 100644 index d5a4cc232..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_24__add_last_action_status_code___POSTGRESQL.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE sp_action ADD last_action_status_code INTEGER; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_25__add_confirmation_flag___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_25__add_confirmation_flag___POSTGRESQL.sql deleted file mode 100644 index 265771afe..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_25__add_confirmation_flag___POSTGRESQL.sql +++ /dev/null @@ -1,26 +0,0 @@ -ALTER TABLE sp_rolloutgroup - ADD COLUMN confirmation_required BOOLEAN; -ALTER TABLE sp_target_filter_query - ADD COLUMN confirmation_required BOOLEAN; - -UPDATE sp_rolloutgroup SET confirmation_required = FALSE; -UPDATE sp_target_filter_query SET confirmation_required = FALSE; - -CREATE TABLE sp_target_conf_status -( - id BIGSERIAL, - target_id BIGINT NOT NULL, - initiator VARCHAR(64), - remark VARCHAR(512), - tenant VARCHAR(40) NOT NULL, - created_at BIGINT NOT NULL, - created_by VARCHAR(64) NOT NULL, - last_modified_at BIGINT NOT NULL, - last_modified_by VARCHAR(64) NOT NULL, - optlock_revision BIGINT NULL -); - - -ALTER TABLE sp_target_conf_status - ADD CONSTRAINT pk_sp_target_conf_status PRIMARY KEY (id); - diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_26__add_access_control_context___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_26__add_access_control_context___POSTGRESQL.sql deleted file mode 100644 index ccf16963e..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_26__add_access_control_context___POSTGRESQL.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_target_filter_query ADD COLUMN access_control_context VARCHAR(4096); -ALTER TABLE sp_rollout ADD COLUMN access_control_context VARCHAR(4096); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_27__target_type_inherit_type___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_27__target_type_inherit_type___POSTGRESQL.sql deleted file mode 100644 index 86e3350b8..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_27__target_type_inherit_type___POSTGRESQL.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE sp_target_type ADD COLUMN type_key VARCHAR (64) NOT NULL DEFAULT ('_'); -UPDATE sp_target_type SET type_key = name; -ALTER TABLE sp_target_type ADD CONSTRAINT uk_target_type_key UNIQUE (type_key, tenant); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_28__add_dynamic_rollout___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_28__add_dynamic_rollout___POSTGRESQL.sql deleted file mode 100644 index de6a6f14f..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_28__add_dynamic_rollout___POSTGRESQL.sql +++ /dev/null @@ -1,9 +0,0 @@ -ALTER TABLE sp_rollout ADD COLUMN is_dynamic BOOLEAN; -ALTER TABLE sp_rolloutgroup ADD COLUMN is_dynamic BOOLEAN NOT NULL DEFAULT false; - -UPDATE sp_rollout SET weight = 1000 WHERE weight IS NULL; -UPDATE sp_action SET weight = 1000 WHERE weight IS NULL; -UPDATE sp_target_filter_query SET auto_assign_weight = 1000 WHERE auto_assign_weight IS NULL; -ALTER TABLE sp_rollout ALTER COLUMN weight SET NOT NULL; -ALTER TABLE sp_action ALTER COLUMN weight SET NOT NULL; -ALTER TABLE sp_target_filter_query ALTER COLUMN auto_assign_weight SET NOT NULL; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_29__add_ds_sm_locked___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_29__add_ds_sm_locked___POSTGRESQL.sql deleted file mode 100644 index c5c0de6fb..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_29__add_ds_sm_locked___POSTGRESQL.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_base_software_module ADD COLUMN locked BOOLEAN NOT NULL DEFAULT true; -ALTER TABLE sp_distribution_set ADD COLUMN locked BOOLEAN NOT NULL DEFAULT true; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_30__add_indexes___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_30__add_indexes___POSTGRESQL.sql deleted file mode 100644 index 980e02fba..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_30__add_indexes___POSTGRESQL.sql +++ /dev/null @@ -1,11 +0,0 @@ -CREATE INDEX sp_idx_rollouttargetgroup_target_id - ON sp_rollouttargetgroup - USING BTREE (target_id); - -CREATE INDEX sp_idx_target_attributes_target_id - ON sp_target_attributes - USING BTREE (target_id); - -CREATE INDEX sp_idx_action_target - ON sp_action - USING BTREE (target); diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_31__add_distrubuted_lock___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_31__add_distrubuted_lock___POSTGRESQL.sql deleted file mode 100644 index e5fc064a9..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_31__add_distrubuted_lock___POSTGRESQL.sql +++ /dev/null @@ -1,8 +0,0 @@ --- Table and fields in upper case as Spring queries it that way -CREATE TABLE SP_LOCK ( - LOCK_KEY CHAR(36) NOT NULL, - REGION VARCHAR(100) NOT NULL, - CLIENT_ID CHAR(36), - CREATED_DATE TIMESTAMP NOT NULL, - constraint SP_LOCK_PK primary key (LOCK_KEY, REGION) -); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_32__add_type_to_ds_index___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_32__add_type_to_ds_index___POSTGRESQL.sql deleted file mode 100644 index e329b14a5..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_32__add_type_to_ds_index___POSTGRESQL.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table sp_distribution_set drop constraint uk_distrib_set_sp_distribution_set; -alter table sp_distribution_set add constraint uk_distrib_set_sp_distribution_set unique (tenant, name, version, ds_id); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_33__refactoring_rename___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_33__refactoring_rename___POSTGRESQL.sql deleted file mode 100644 index 234a9b63c..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_33__refactoring_rename___POSTGRESQL.sql +++ /dev/null @@ -1,98 +0,0 @@ --- rename tables -alter table sp_base_software_module rename to sp_software_module; -alter table sp_distributionset_tag rename to sp_distribution_set_tag; -alter table sp_ds_dstag rename to sp_ds_tag; -alter table sp_ds_module rename to sp_ds_sm; -alter table sp_rolloutgroup rename to sp_rollout_group; -alter table sp_rollouttargetgroup rename to sp_rollout_target_group; -alter table sp_sw_metadata rename to sp_sm_metadata; -alter table sp_target_type_ds_type_relation rename to sp_target_type_ds_type; --- rename columns -alter table sp_action rename column rolloutgroup to rollout_group; -alter table sp_action_status_messages rename column action_status_id to action_status; -alter table sp_distribution_set rename column ds_id to ds_type; -alter table sp_ds_sm rename column module_id to sm_id; -alter table sp_ds_metadata rename column ds_id to ds; -alter table sp_rollout_group rename column parent_id to parent; -alter table sp_rollout_target_group rename column target_id to target; -alter table sp_rollout_target_group rename column rolloutgroup_id to rollout_group; -alter table sp_sm_metadata rename column sw_id to sm; -alter table sp_software_module rename column module_type to sm_type; -alter table sp_target_attributes rename column target_id to target; -alter table sp_target_conf_status rename column target_id to target; -alter table sp_target_metadata rename column target_id to target; --- rename constraints -alter table sp_action rename constraint fk_action_ds to fk_action_distribution_set; -alter table sp_action rename constraint fk_action_rolloutgroup to fk_action_rollout_group; -alter table sp_action rename constraint fk_targ_act_hist_targ to fk_action_target; -alter table sp_action_status rename constraint fk_act_stat_action to fk_action_status_action; -alter table sp_action_status_messages rename constraint fk_stat_msg_act_stat to fk_action_status_messages_action_status; -alter table sp_artifact rename constraint fk_assigned_sm to fk_artifact_software_module; -alter table sp_distribution_set rename constraint uk_distrib_set_sp_distribution_set to uk_distribution_set; -alter table sp_distribution_set rename constraint fk_ds_dstype_ds to fk_distribution_set_ds_type; -alter table sp_distribution_set_tag rename constraint uk_ds_tag_sp_distributionset_tag to uk_distribution_set_tag; -alter table sp_distribution_set_type rename constraint uk_dst_key_sp_distribution_set_type to uk_distribution_set_type_type_key; -alter table sp_distribution_set_type rename constraint uk_dst_name_sp_distribution_set_type to uk_distribution_set_type_name; -alter table sp_ds_metadata rename constraint fk_metadata_ds to fk_ds_metadata_ds; -alter table sp_ds_sm rename constraint fk_ds_module_ds to fk_ds_sm_ds_id; -alter table sp_ds_sm rename constraint fk_ds_module_module to fk_ds_sm_sm_id; -alter table sp_ds_tag rename constraint fk_ds_dstag_ds to fk_ds_tag_ds; -alter table sp_ds_tag rename constraint fk_ds_dstag_tag to fk_ds_tag_tag; -alter table sp_ds_type_element rename constraint fk_ds_type_element_element to fk_ds_type_element_distribution_set_type; -alter table sp_ds_type_element rename constraint fk_ds_type_element_smtype to fk_ds_type_element_software_module_type; -alter table sp_rollout rename constraint fk_rollout_ds to fk_rollout_distribution_set; -alter table sp_rollout_group rename constraint uk_rolloutgroup_sp_rolloutgroup to uk_rollout_group; -alter table sp_rollout_group rename constraint fk_rolloutgroup_rollout to fk_rollout_group_rollout; -alter table sp_rollout_target_group rename constraint fk_rollouttargetgroup_rolloutgroup to fk_rollout_target_group_rollout_group; -alter table sp_rollout_target_group rename constraint fk_rollouttargetgroup_target to fk_rollout_target_group_target; -alter table sp_sm_metadata rename constraint fk_metadata_sw to fk_sm_metadata_sm; -alter table sp_software_module rename constraint uk_base_sw_mod_sp_base_software_module to uk_software_module; -alter table sp_software_module rename constraint fk_module_type to fk_software_module_sm_type; -alter table sp_software_module_type rename constraint uk_smt_type_key_sp_software_module_type to uk_software_module_type_type_key; -alter table sp_software_module_type rename constraint uk_smt_name_sp_software_module_type to uk_software_module_type_name; -alter table sp_target rename constraint uk_tenant_controller_id_sp_target to uk_target; -alter table sp_target_attributes rename constraint fk_targ_attrib_target to fk_target_attributes_target; -alter table sp_target_filter_query rename constraint uk_tenant_custom_filter_name_sp_target_filter_query to uk_target_filter_query; -alter table sp_target_filter_query rename constraint fk_filter_auto_assign_ds to fk_target_filter_query_auto_assign_distribution_set; -alter table sp_target_metadata rename constraint fk_metadata_target to fk_target_metadata_target; -alter table sp_target_tag rename constraint uk_targ_tag_sp_target_tag to uk_target_tag; -alter table sp_target_target_tag rename constraint fk_targ_targtag_target to fk_target_target_tag_target; -alter table sp_target_target_tag rename constraint fk_targ_targtag_tag to fk_target_target_tag_tag; -alter table sp_target_type rename constraint uk_target_type_name to uk_target_name; -alter table sp_target_type_ds_type rename constraint fk_target_type_relation_target_type to fk_target_type_ds_type_target_type; -alter table sp_target_type_ds_type rename constraint fk_target_type_relation_ds_type to fk_target_type_ds_type_distribution_set_type; -alter table sp_tenant rename constraint uk_tenantmd_tenant_sp_tenant to uk_tenant; -alter table sp_tenant rename constraint fk_tenant_md_default_ds_type to fk_sp_tenant_default_ds_type; -alter table sp_tenant_configuration rename constraint uk_tenant_key_sp_tenant_configuration to uk_tenant_configuration; --- rename primary keys -alter table sp_action rename constraint pk_sp_action to pk_action; -alter table sp_action_status rename constraint pk_sp_action_status to pk_action_status; -alter table sp_artifact rename constraint pk_sp_artifact to pk_artifact; -alter table sp_software_module rename constraint pk_sp_base_software_module to pk_software_module; -alter table sp_distribution_set rename constraint pk_sp_distribution_set to pk_distribution_set; -alter table sp_distribution_set_type rename constraint pk_sp_distribution_set_type to pk_distribution_set_type; -alter table sp_distribution_set_tag rename constraint pk_sp_distributionset_tag to pk_distribution_set_tag; -alter table sp_ds_tag rename constraint pk_sp_ds_dstag to pk_ds_tag; -alter table sp_ds_metadata rename constraint pk_sp_ds_metadata to pk_ds_metadata; -alter table sp_ds_sm rename constraint pk_sp_ds_module to pk_ds_sm; -alter table sp_ds_type_element rename constraint pk_sp_ds_type_element to pk_ds_type_element; -alter table sp_rollout rename constraint pk_sp_rollout to pk_rollout; -alter table sp_rollout_group rename constraint pk_sp_rolloutgroup to pk_rollout_group; -alter table sp_rollout_target_group rename constraint pk_sp_rollouttargetgroup to pk_rollout_target_group; -alter table sp_software_module_type rename constraint pk_sp_software_module_type to pk_software_module_type; -alter table sp_sm_metadata rename constraint pk_sp_sw_metadata to pk_sm_metadata; -alter table sp_target rename constraint pk_sp_target to pk_target; -alter table sp_target_attributes rename constraint pk_sp_target_attributes to pk_target_attributes; -alter table sp_target_filter_query rename constraint pk_sp_target_filter_query to pk_target_filter_query; -alter table sp_target_metadata rename constraint pk_sp_target_metadata to pk_target_metadata; -alter table sp_target_tag rename constraint pk_sp_target_tag to pk_target_tag; -alter table sp_target_target_tag rename constraint pk_sp_target_target_tag to pk_target_target_tag; -alter table sp_tenant rename constraint pk_sp_tenant to pk_tenant; -alter table sp_tenant_configuration rename constraint pk_sp_tenant_configuration to pk_tenant_configuration; --- rename indexes -alter index sp_idx_action_status_msgs_01_sp_action_status_messages rename to fk_action_status_messages_action_status; -alter index fk_rolloutgroup_rolloutgroup_sp_rolloutgroup rename to sp_idx_rollout_group_parent; -alter index sp_idx_rollouttargetgroup_target_id rename to sp_idx_rollout_target_group_target; -alter index sp_idx_base_sw_module_prim_sp_base_software_module rename to sp_idx_software_module_prim; -alter index sp_idx_base_sw_module_01_sp_base_software_module rename to sp_idx_software_module_01; -alter index sp_idx_base_sw_module_02_sp_base_software_module rename to sp_idx_software_module_02; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_34__add_group_to_target__POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_34__add_group_to_target__POSTGRESQL.sql deleted file mode 100644 index 6c776ac98..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_34__add_group_to_target__POSTGRESQL.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE sp_target ADD COLUMN target_group VARCHAR(256); -CREATE INDEX sp_idx_target_group ON sp_target (tenant, target_group); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_35__sm_type_min_artifacts__POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_35__sm_type_min_artifacts__POSTGRESQL.sql deleted file mode 100644 index 182c4bd11..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_35__sm_type_min_artifacts__POSTGRESQL.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE sp_software_module_type ADD COLUMN min_artifacts integer default 0 NOT NULL; -DROP INDEX sp_idx_distribution_set_01_sp_distribution_set; -CREATE INDEX sp_idx_distribution_set_01 ON sp_distribution_set USING BTREE (tenant, deleted); -ALTER TABLE sp_distribution_set DROP COLUMN complete; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_36__cleanup_prop_changes__POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_36__cleanup_prop_changes__POSTGRESQL.sql deleted file mode 100644 index 37995ea60..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_36__cleanup_prop_changes__POSTGRESQL.sql +++ /dev/null @@ -1,4 +0,0 @@ -DELETE FROM sp_tenant_configuration WHERE conf_key='action.cleanup.enabled'; -UPDATE sp_tenant_configuration SET conf_key='action.cleanup.auto.expiry' WHERE conf_key='action.cleanup.actionExpiry'; -UPDATE sp_tenant_configuration SET conf_key='action.cleanup.auto.status' WHERE conf_key='action.cleanup.actionStatus'; -UPDATE sp_tenant_configuration SET conf_key='actions.cleanup.onQuotaHit.percent' WHERE conf_key='action.cleanup.onQuotaHit.percent'; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_37__unify__POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_37__unify__POSTGRESQL.sql deleted file mode 100644 index 5ef428063..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_37__unify__POSTGRESQL.sql +++ /dev/null @@ -1,115 +0,0 @@ --- fix NOT NULL V1_12_15__baseline___POSTGRESQL.sql and V1_12_22__change_target_type_name_length___POSTGRESQL.sql -UPDATE sp_software_module SET name = '' WHERE name IS NULL; -ALTER TABLE sp_software_module ALTER COLUMN name SET NOT NULL; -UPDATE sp_software_module_type SET name = '' WHERE name IS NULL; -ALTER TABLE sp_software_module_type ALTER COLUMN name SET NOT NULL; - -UPDATE sp_distribution_set SET name = '' WHERE name IS NULL; -ALTER TABLE sp_distribution_set ALTER COLUMN name SET NOT NULL; -UPDATE sp_distribution_set_type SET name = '' WHERE name IS NULL; -ALTER TABLE sp_distribution_set_type ALTER COLUMN name SET NOT NULL; -UPDATE sp_distribution_set_tag SET name = '' WHERE name IS NULL; -ALTER TABLE sp_distribution_set_tag ALTER COLUMN name SET NOT NULL; - -UPDATE sp_target SET name = '' WHERE name IS NULL; -ALTER TABLE sp_target ALTER COLUMN name SET NOT NULL; -UPDATE sp_target_type SET name = '' WHERE name IS NULL; -ALTER TABLE sp_target_type ALTER COLUMN name SET NOT NULL; -UPDATE sp_target_tag SET name = '' WHERE name IS NULL; -ALTER TABLE sp_target_tag ALTER COLUMN name SET NOT NULL; -UPDATE sp_target_filter_query SET name = '' WHERE name IS NULL; -ALTER TABLE sp_target_filter_query ALTER COLUMN name SET NOT NULL; - -UPDATE sp_rollout SET name = '' WHERE name IS NULL; -ALTER TABLE sp_rollout ALTER COLUMN name SET NOT NULL; -UPDATE sp_rollout_group SET name = '' WHERE name IS NULL; -ALTER TABLE sp_rollout_group ALTER COLUMN name SET NOT NULL; - -UPDATE sp_target SET controller_id = '' WHERE controller_id IS NULL; -ALTER TABLE sp_target ALTER COLUMN controller_id SET NOT NULL; - --- fix sp_target_conf_status_new column order (to be MySQL and H2 schemes compatible) -BEGIN; - -CREATE TABLE sp_target_conf_status_new ( - id BIGINT GENERATED BY DEFAULT AS IDENTITY, - target BIGINT NOT NULL, - initiator VARCHAR(64), - remark VARCHAR(512), - created_at BIGINT, - created_by VARCHAR(64), - last_modified_at BIGINT, - last_modified_by VARCHAR(64), - optlock_revision BIGINT, - tenant VARCHAR(40) NOT NULL, - PRIMARY KEY (id) -); - -INSERT INTO sp_target_conf_status_new -SELECT id, target, initiator, remark, created_at, created_by, last_modified_at, last_modified_by, optlock_revision, tenant -FROM sp_target_conf_status; --- inserting with id hasn't / may haven't incremented the sequence -DO $$ -BEGIN - PERFORM setval('sp_target_conf_status_new_id_seq', (SELECT MAX(id) FROM sp_target_conf_status_new)); -END $$; - -DROP TABLE sp_target_conf_status; -ALTER TABLE sp_target_conf_status_new RENAME TO sp_target_conf_status; - -COMMIT; - -DROP INDEX sp_idx_rollout_group_parent; -ALTER TABLE sp_target_conf_status - ADD CONSTRAINT fk_target_conf_status_target FOREIGN KEY (target) REFERENCES sp_target (id) ON DELETE CASCADE; -ALTER TABLE sp_target_type_ds_type - ADD CONSTRAINT pk_sp_target_type_ds_type PRIMARY KEY (target_type, distribution_set_type); - --- remove unnecessary / faulty default for a tenant's scope unique key -ALTER TABLE sp_target_type ALTER COLUMN type_key DROP DEFAULT; - --- remove unused column -ALTER TABLE sp_rollout DROP COLUMN group_theshold; - --- -- unify index names -- --- sp_distribution_set_tag table indexes -ALTER INDEX sp_idx_distribution_set_tag_01_sp_distributionset_tag RENAME TO sp_idx_distribution_set_tag_01; -ALTER INDEX sp_idx_distribution_set_tag_prim_sp_distributionset_tag RENAME TO sp_idx_distribution_set_tag_prim; --- sp_distribution_set_type table indexes -ALTER INDEX sp_idx_distribution_set_type_prim_sp_distribution_set_type RENAME TO sp_idx_distribution_set_type_prim; -ALTER INDEX sp_idx_distribution_set_type_01_sp_distribution_set_type RENAME TO sp_idx_distribution_set_type_01; --- sp_software_module_type table indexes -ALTER INDEX sp_idx_software_module_type_prim_sp_software_module_type RENAME TO sp_idx_software_module_type_prim; -ALTER INDEX sp_idx_software_module_type_01_sp_software_module_type RENAME TO sp_idx_software_module_type_01; --- sp_target_tag table indexes -ALTER INDEX sp_idx_target_tag_prim_sp_target_tag RENAME TO sp_idx_target_tag_prim; -ALTER INDEX sp_idx_target_tag_01_sp_target_tag RENAME TO sp_idx_target_tag_01; --- sp_distribution_set table indexes -ALTER INDEX sp_idx_distribution_set_prim_sp_distribution_set RENAME TO sp_idx_distribution_set_prim; --- sp_tenant table indexes -ALTER INDEX sp_idx_tenant_prim_sp_tenant RENAME TO sp_idx_tenant_prim; --- sp_rollout table indexes -ALTER INDEX uk_rollout_sp_rollout RENAME TO uk_rollout; --- sp_target table indexes -ALTER INDEX uk_target RENAME TO uk_target_controller_id; -ALTER INDEX sp_idx_target_01_sp_target RENAME TO sp_idx_target_01; -ALTER INDEX sp_idx_target_03_sp_target RENAME TO sp_idx_target_03; -ALTER INDEX sp_idx_target_04_sp_target RENAME TO sp_idx_target_04; -ALTER INDEX sp_idx_target_prim_sp_target RENAME TO sp_idx_target_prim; --- sp_artifact table indexes -ALTER INDEX sp_idx_artifact_prim_sp_artifact RENAME TO sp_idx_artifact_prim; -ALTER INDEX sp_idx_artifact_01_sp_artifact RENAME TO sp_idx_artifact_01; -ALTER INDEX sp_idx_artifact_02_sp_artifact RENAME TO sp_idx_artifact_02; --- sp_action table indexes -ALTER INDEX sp_idx_action_prim_sp_action RENAME TO sp_idx_action_prim; -ALTER INDEX sp_idx_action_01_sp_action RENAME TO sp_idx_action_01; -ALTER INDEX sp_idx_action_02_sp_action RENAME TO sp_idx_action_02; -ALTER INDEX sp_idx_action_external_ref_sp_action RENAME TO sp_idx_action_external_ref; --- sp_action_status table indexes -ALTER INDEX sp_idx_action_status_prim_sp_action_status RENAME TO sp_idx_action_status_prim; -ALTER INDEX sp_idx_action_status_02_sp_action_status RENAME TO sp_idx_action_status_02; - --- rename index -ALTER TABLE sp_tenant RENAME CONSTRAINT fk_sp_tenant_default_ds_type TO fk_tenant_default_ds_type; - -ALTER TABLE sp_rollout_group ALTER COLUMN target_percentage TYPE FLOAT; \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_38__varchar_to_text___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_38__varchar_to_text___POSTGRESQL.sql deleted file mode 100644 index e2c93fc1e..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_38__varchar_to_text___POSTGRESQL.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE sp_tenant_configuration - ALTER COLUMN conf_value TYPE TEXT, - ALTER COLUMN conf_value SET NOT NULL; -ALTER TABLE sp_target_filter_query ALTER COLUMN access_control_context TYPE TEXT; -ALTER TABLE sp_rollout ALTER COLUMN access_control_context TYPE TEXT; diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_39__add_rollout_group_parent_index___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_39__add_rollout_group_parent_index___POSTGRESQL.sql deleted file mode 100644 index acbdfe909..000000000 --- a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_39__add_rollout_group_parent_index___POSTGRESQL.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX sp_idx_rollout_group_parent ON sp_rollout_group (parent);