Rollback migration SQL files, accidently formatted (#1956)
This leads to problems with flyway Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_target_attributes
|
||||
ALTER COLUMN attribute_key SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_target_attributes ALTER COLUMN attribute_key SET DATA TYPE VARCHAR(128);
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_target_filter_query
|
||||
ADD COLUMN auto_assign_action_type INTEGER;
|
||||
ALTER TABLE sp_target_filter_query ADD COLUMN auto_assign_action_type INTEGER;
|
||||
@@ -1,24 +1,13 @@
|
||||
ALTER TABLE sp_distribution_set
|
||||
ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_distribution_set_type
|
||||
ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_distributionset_tag
|
||||
ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_base_software_module
|
||||
ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_rollout
|
||||
ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_rolloutgroup
|
||||
ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_software_module_type
|
||||
ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_target
|
||||
ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_target_filter_query
|
||||
ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_target_tag
|
||||
ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_distribution_set ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_distribution_set_type ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_distributionset_tag ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_base_software_module ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_rollout ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_rolloutgroup ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_software_module_type ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_target ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_target_filter_query ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_target_tag ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
|
||||
|
||||
ALTER TABLE sp_target
|
||||
ALTER COLUMN controller_id SET DATA TYPE VARCHAR(256);
|
||||
ALTER TABLE sp_target ALTER COLUMN controller_id SET DATA TYPE VARCHAR(256);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
ALTER TABLE sp_action
|
||||
ADD COLUMN external_ref VARCHAR(512);
|
||||
ALTER TABLE sp_action ADD COLUMN external_ref VARCHAR(512);
|
||||
CREATE INDEX sp_idx_action_external_ref ON sp_action (external_ref);
|
||||
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_artifact
|
||||
ADD COLUMN sha256_hash CHAR(64);
|
||||
ALTER TABLE sp_artifact ADD COLUMN sha256_hash CHAR(64);
|
||||
@@ -1,6 +1,3 @@
|
||||
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;
|
||||
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;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
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);
|
||||
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);
|
||||
|
||||
@@ -23,15 +23,10 @@ CREATE TABLE sp_target_type_ds_type_relation
|
||||
PRIMARY KEY (target_type, distribution_set_type)
|
||||
);
|
||||
|
||||
ALTER TABLE sp_target_type
|
||||
ADD CONSTRAINT uk_target_type_name UNIQUE (name, tenant);
|
||||
ALTER TABLE sp_target_type ADD CONSTRAINT uk_target_type_name UNIQUE (name, tenant);
|
||||
|
||||
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 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;
|
||||
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;
|
||||
@@ -1,5 +1,3 @@
|
||||
ALTER TABLE sp_distribution_set
|
||||
ADD COLUMN valid BOOLEAN;
|
||||
ALTER TABLE sp_distribution_set ADD COLUMN valid BOOLEAN;
|
||||
|
||||
UPDATE sp_distribution_set
|
||||
SET valid = 1;
|
||||
UPDATE sp_distribution_set SET valid = 1;
|
||||
@@ -1,5 +1,3 @@
|
||||
ALTER TABLE sp_base_software_module
|
||||
ADD COLUMN encrypted BOOLEAN;
|
||||
ALTER TABLE sp_base_software_module ADD COLUMN encrypted BOOLEAN;
|
||||
|
||||
UPDATE sp_base_software_module
|
||||
SET encrypted = 0;
|
||||
UPDATE sp_base_software_module SET encrypted = 0;
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_target_type
|
||||
ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
ALTER TABLE sp_target_type ALTER COLUMN name SET DATA TYPE VARCHAR(128);
|
||||
@@ -1,3 +1,2 @@
|
||||
ALTER TABLE sp_action_status
|
||||
ADD COLUMN code INTEGER;
|
||||
ALTER TABLE sp_action_status ADD COLUMN code INTEGER;
|
||||
CREATE INDEX sp_idx_action_status_03 ON sp_action_status (tenant, code);
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_action
|
||||
ADD COLUMN last_action_status_code INTEGER;
|
||||
ALTER TABLE sp_action ADD COLUMN last_action_status_code INTEGER;
|
||||
@@ -1,12 +1,8 @@
|
||||
ALTER TABLE sp_rolloutgroup
|
||||
ADD COLUMN confirmation_required BOOLEAN;
|
||||
UPDATE sp_rolloutgroup
|
||||
SET confirmation_required = 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;
|
||||
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
|
||||
(
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
ALTER TABLE sp_target_filter_query
|
||||
ADD COLUMN access_control_context VARCHAR(4096);
|
||||
ALTER TABLE sp_rollout
|
||||
ADD COLUMN access_control_context VARCHAR(4096);
|
||||
ALTER TABLE sp_target_filter_query ADD COLUMN access_control_context VARCHAR(4096);
|
||||
ALTER TABLE sp_rollout ADD COLUMN access_control_context VARCHAR(4096);
|
||||
@@ -1,6 +1,3 @@
|
||||
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);
|
||||
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);
|
||||
@@ -1,20 +1,9 @@
|
||||
ALTER TABLE sp_rollout
|
||||
ADD COLUMN is_dynamic BOOLEAN;
|
||||
ALTER TABLE sp_rolloutgroup
|
||||
ADD COLUMN is_dynamic BOOLEAN NOT NULL DEFAULT false;
|
||||
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;
|
||||
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;
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
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;
|
||||
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;
|
||||
@@ -413,88 +413,46 @@ CREATE TABLE sp_target_target_tag
|
||||
PRIMARY KEY (target, tag)
|
||||
);
|
||||
|
||||
ALTER TABLE sp_distribution_set
|
||||
ADD CONSTRAINT uk_distrib_set UNIQUE (name, version, tenant);
|
||||
ALTER TABLE sp_distributionset_tag
|
||||
ADD CONSTRAINT uk_ds_tag UNIQUE (name, tenant);
|
||||
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);
|
||||
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_base_software_module
|
||||
ADD CONSTRAINT uk_base_sw_mod UNIQUE (module_type, name, version, tenant);
|
||||
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);
|
||||
ALTER TABLE sp_target
|
||||
ADD CONSTRAINT uk_tenant_controller_ UNIQUE (controller_id, tenant);
|
||||
ALTER TABLE sp_target_filter_query
|
||||
ADD CONSTRAINT uk_tenant_custom_filt UNIQUE (name, tenant);
|
||||
ALTER TABLE sp_target_tag
|
||||
ADD CONSTRAINT uk_targ_tag UNIQUE (name, tenant);
|
||||
ALTER TABLE sp_tenant_configuration
|
||||
ADD CONSTRAINT uk_tenant_key UNIQUE (conf_key, tenant);
|
||||
ALTER TABLE sp_tenant
|
||||
ADD CONSTRAINT uk_tenantmd_tenant UNIQUE (tenant);
|
||||
ALTER TABLE sp_distribution_set ADD CONSTRAINT uk_distrib_set UNIQUE (name, version, tenant);
|
||||
ALTER TABLE sp_distributionset_tag ADD CONSTRAINT uk_ds_tag UNIQUE (name, tenant);
|
||||
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);
|
||||
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_base_software_module ADD CONSTRAINT uk_base_sw_mod UNIQUE (module_type, name, version, tenant);
|
||||
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);
|
||||
ALTER TABLE sp_target ADD CONSTRAINT uk_tenant_controller_ UNIQUE (controller_id, tenant);
|
||||
ALTER TABLE sp_target_filter_query ADD CONSTRAINT uk_tenant_custom_filt UNIQUE (name, tenant);
|
||||
ALTER TABLE sp_target_tag ADD CONSTRAINT uk_targ_tag UNIQUE (name, tenant);
|
||||
ALTER TABLE sp_tenant_configuration ADD CONSTRAINT uk_tenant_key UNIQUE (conf_key, tenant);
|
||||
ALTER TABLE sp_tenant ADD CONSTRAINT uk_tenantmd_tenant UNIQUE (tenant);
|
||||
|
||||
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
|
||||
ADD CONSTRAINT fk_ds_type_element_smtype FOREIGN KEY (software_module_type) REFERENCES sp_software_module_type (id) ON DELETE CASCADE;
|
||||
ALTER TABLE sp_action
|
||||
ADD CONSTRAINT fk_action_rolloutgroup FOREIGN KEY (rolloutgroup) REFERENCES sp_rolloutgroup (id);
|
||||
ALTER TABLE sp_action
|
||||
ADD CONSTRAINT fk_action_rollout FOREIGN KEY (rolloutgroup) REFERENCES sp_rolloutgroup (id);
|
||||
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
|
||||
ADD CONSTRAINT fk_action_ds FOREIGN KEY (distribution_set) REFERENCES sp_distribution_set (id) ON DELETE CASCADE;
|
||||
ALTER TABLE sp_action_status
|
||||
ADD CONSTRAINT fk_act_stat_action FOREIGN KEY (action) REFERENCES sp_action (id) ON DELETE CASCADE;
|
||||
ALTER TABLE sp_artifact
|
||||
ADD CONSTRAINT fk_assigned_sm FOREIGN KEY (software_module) REFERENCES sp_base_software_module (id) ON DELETE CASCADE;
|
||||
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_metadata
|
||||
ADD CONSTRAINT fk_metadata_ds FOREIGN KEY (ds_id) REFERENCES sp_distribution_set (id) ON DELETE CASCADE;
|
||||
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_base_software_module
|
||||
ADD CONSTRAINT fk_module_type FOREIGN KEY (module_type) REFERENCES sp_software_module_type (id);
|
||||
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_target
|
||||
ADD CONSTRAINT fk_target_inst_ds FOREIGN KEY (installed_distribution_set) REFERENCES sp_distribution_set (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_filter_query
|
||||
ADD CONSTRAINT fk_filter_auto_assign_ds FOREIGN KEY (auto_assign_distribution_set) REFERENCES sp_distribution_set (id) ON DELETE SET NULL;
|
||||
ALTER TABLE sp_tenant
|
||||
ADD CONSTRAINT fk_tenant_md_default_ds_type FOREIGN KEY (default_ds_type) REFERENCES sp_distribution_set_type (id);
|
||||
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_group FOREIGN KEY (rolloutGroup_Id) REFERENCES sp_rolloutgroup (id) 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 DELETE CASCADE;
|
||||
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_ds_module
|
||||
ADD CONSTRAINT fk_ds_module_ds FOREIGN KEY (ds_id) REFERENCES sp_distribution_set (id) ON DELETE CASCADE;
|
||||
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
|
||||
ADD CONSTRAINT fk_ds_dstag_ds FOREIGN KEY (ds) REFERENCES sp_distribution_set (id) ON DELETE CASCADE;
|
||||
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_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
|
||||
ADD CONSTRAINT fk_targ_targtag_target FOREIGN KEY (target) REFERENCES sp_target (id) 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 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 DELETE CASCADE;
|
||||
ALTER TABLE sp_action ADD CONSTRAINT fk_action_rolloutgroup FOREIGN KEY (rolloutgroup) REFERENCES sp_rolloutgroup (id);
|
||||
ALTER TABLE sp_action ADD CONSTRAINT fk_action_rollout FOREIGN KEY (rolloutgroup) REFERENCES sp_rolloutgroup (id);
|
||||
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 ADD CONSTRAINT fk_action_ds FOREIGN KEY (distribution_set) REFERENCES sp_distribution_set (id) ON DELETE CASCADE;
|
||||
ALTER TABLE sp_action_status ADD CONSTRAINT fk_act_stat_action FOREIGN KEY (action) REFERENCES sp_action (id) ON DELETE CASCADE;
|
||||
ALTER TABLE sp_artifact ADD CONSTRAINT fk_assigned_sm FOREIGN KEY (software_module) REFERENCES sp_base_software_module (id) ON DELETE CASCADE;
|
||||
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_metadata ADD CONSTRAINT fk_metadata_ds FOREIGN KEY (ds_id) REFERENCES sp_distribution_set (id) ON DELETE CASCADE;
|
||||
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_base_software_module ADD CONSTRAINT fk_module_type FOREIGN KEY (module_type) REFERENCES sp_software_module_type (id);
|
||||
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_target ADD CONSTRAINT fk_target_inst_ds FOREIGN KEY (installed_distribution_set) REFERENCES sp_distribution_set (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_filter_query ADD CONSTRAINT fk_filter_auto_assign_ds FOREIGN KEY (auto_assign_distribution_set) REFERENCES sp_distribution_set (id) ON DELETE SET NULL;
|
||||
ALTER TABLE sp_tenant ADD CONSTRAINT fk_tenant_md_default_ds_type FOREIGN KEY (default_ds_type) REFERENCES sp_distribution_set_type (id);
|
||||
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_group FOREIGN KEY (rolloutGroup_Id) REFERENCES sp_rolloutgroup (id) 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 DELETE CASCADE;
|
||||
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_ds_module ADD CONSTRAINT fk_ds_module_ds FOREIGN KEY (ds_id) REFERENCES sp_distribution_set (id) ON DELETE CASCADE;
|
||||
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 ADD CONSTRAINT fk_ds_dstag_ds FOREIGN KEY (ds) REFERENCES sp_distribution_set (id) ON DELETE CASCADE;
|
||||
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_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 ADD CONSTRAINT fk_targ_targtag_target FOREIGN KEY (target) REFERENCES sp_target (id) ON DELETE CASCADE;
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
ALTER TABLE sp_rollout
|
||||
ADD COLUMN approval_decided_by varchar(40);
|
||||
ALTER TABLE sp_rollout
|
||||
ADD COLUMN approval_remark varchar(255);
|
||||
ALTER TABLE sp_rollout ADD COLUMN approval_decided_by varchar(40);
|
||||
ALTER TABLE sp_rollout ADD COLUMN approval_remark varchar(255);
|
||||
@@ -1,76 +1,45 @@
|
||||
ALTER TABLE sp_action
|
||||
ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_action
|
||||
ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_action ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_action ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
|
||||
ALTER TABLE sp_action_status
|
||||
ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_action_status
|
||||
ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_action_status ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_action_status ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
|
||||
ALTER TABLE sp_artifact
|
||||
ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_artifact
|
||||
ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_artifact ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_artifact ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
|
||||
ALTER TABLE sp_base_software_module
|
||||
ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_base_software_module
|
||||
ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_base_software_module ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_base_software_module ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
|
||||
ALTER TABLE sp_distributionset_tag
|
||||
ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_distributionset_tag
|
||||
ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_distributionset_tag ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_distributionset_tag ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
|
||||
ALTER TABLE sp_distribution_set
|
||||
ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_distribution_set
|
||||
ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_distribution_set ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_distribution_set ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
|
||||
ALTER TABLE sp_distribution_set_type
|
||||
ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_distribution_set_type
|
||||
ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_distribution_set_type ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_distribution_set_type ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
|
||||
ALTER TABLE sp_rollout
|
||||
ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_rollout
|
||||
ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_rollout
|
||||
ALTER COLUMN approval_decided_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_rollout ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_rollout ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_rollout ALTER COLUMN approval_decided_by SET DATA TYPE VARCHAR(64);
|
||||
|
||||
ALTER TABLE sp_rolloutgroup
|
||||
ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_rolloutgroup
|
||||
ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_rolloutgroup ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_rolloutgroup ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
|
||||
ALTER TABLE sp_software_module_type
|
||||
ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_software_module_type
|
||||
ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_software_module_type ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_software_module_type ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
|
||||
ALTER TABLE sp_target
|
||||
ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_target
|
||||
ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_target ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_target ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
|
||||
ALTER TABLE sp_target_filter_query
|
||||
ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_target_filter_query
|
||||
ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_target_filter_query ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_target_filter_query ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
|
||||
ALTER TABLE sp_target_tag
|
||||
ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_target_tag
|
||||
ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_target_tag ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_target_tag ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
|
||||
ALTER TABLE sp_tenant
|
||||
ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_tenant
|
||||
ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_tenant ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_tenant ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
|
||||
ALTER TABLE sp_tenant_configuration
|
||||
ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_tenant_configuration
|
||||
ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_tenant_configuration ALTER COLUMN created_by SET DATA TYPE VARCHAR(64);
|
||||
ALTER TABLE sp_tenant_configuration ALTER COLUMN last_modified_by SET DATA TYPE VARCHAR(64);
|
||||
@@ -6,5 +6,4 @@ CREATE TABLE sp_target_metadata
|
||||
PRIMARY KEY (meta_key, target_id)
|
||||
);
|
||||
|
||||
ALTER TABLE sp_target_metadata
|
||||
ADD CONSTRAINT fk_metadata_target FOREIGN KEY (target_id) REFERENCES sp_target (id) ON DELETE CASCADE;
|
||||
ALTER TABLE sp_target_metadata ADD CONSTRAINT fk_metadata_target FOREIGN KEY (target_id) REFERENCES sp_target (id) ON DELETE CASCADE;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
create table sp_action
|
||||
(
|
||||
|
||||
create table sp_action (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -16,8 +16,7 @@ create table sp_action
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_action_status
|
||||
(
|
||||
create table sp_action_status (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -31,14 +30,12 @@ create table sp_action_status
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_action_status_messages
|
||||
(
|
||||
create table sp_action_status_messages (
|
||||
action_status_id bigint not null,
|
||||
detail_message varchar(512)
|
||||
);
|
||||
|
||||
create table sp_artifact
|
||||
(
|
||||
create table sp_artifact (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -55,8 +52,7 @@ create table sp_artifact
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_base_software_module
|
||||
(
|
||||
create table sp_base_software_module (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -73,8 +69,7 @@ create table sp_base_software_module
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_distribution_set
|
||||
(
|
||||
create table sp_distribution_set (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -92,8 +87,7 @@ create table sp_distribution_set
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_distribution_set_type
|
||||
(
|
||||
create table sp_distribution_set_type (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -109,8 +103,7 @@ create table sp_distribution_set_type
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_distributionset_tag
|
||||
(
|
||||
create table sp_distributionset_tag (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -124,38 +117,33 @@ create table sp_distributionset_tag
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_ds_dstag
|
||||
(
|
||||
create table sp_ds_dstag (
|
||||
ds bigint not null,
|
||||
TAG bigint not null,
|
||||
primary key (ds, TAG)
|
||||
);
|
||||
|
||||
create table sp_ds_metadata
|
||||
(
|
||||
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
|
||||
(
|
||||
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
|
||||
(
|
||||
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
|
||||
(
|
||||
create table sp_external_artifact (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -172,8 +160,7 @@ create table sp_external_artifact
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_external_provider
|
||||
(
|
||||
create table sp_external_provider (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -188,8 +175,7 @@ create table sp_external_provider
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_software_module_type
|
||||
(
|
||||
create table sp_software_module_type (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -206,16 +192,14 @@ create table sp_software_module_type
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_sw_metadata
|
||||
(
|
||||
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
|
||||
(
|
||||
create table sp_target (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -231,16 +215,14 @@ create table sp_target
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_target_attributes
|
||||
(
|
||||
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
|
||||
(
|
||||
create table sp_target_info (
|
||||
target_id bigint not null,
|
||||
install_date bigint,
|
||||
ip_address varchar(46),
|
||||
@@ -251,8 +233,7 @@ create table sp_target_info
|
||||
primary key (target_id)
|
||||
);
|
||||
|
||||
create table sp_target_tag
|
||||
(
|
||||
create table sp_target_tag (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -266,15 +247,13 @@ create table sp_target_tag
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_target_target_tag
|
||||
(
|
||||
create table sp_target_target_tag (
|
||||
target bigint not null,
|
||||
tag bigint not null,
|
||||
primary key (target, tag)
|
||||
);
|
||||
|
||||
create table sp_tenant
|
||||
(
|
||||
create table sp_tenant (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -286,8 +265,7 @@ create table sp_tenant
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_tenant_configuration
|
||||
(
|
||||
create table sp_tenant_configuration (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
ALTER TABLE sp_rollout
|
||||
ADD COLUMN deleted BOOLEAN;
|
||||
ALTER TABLE sp_rollout ADD COLUMN deleted BOOLEAN;
|
||||
|
||||
UPDATE sp_rollout
|
||||
SET deleted = 0;
|
||||
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;
|
||||
|
||||
@@ -1,30 +1,16 @@
|
||||
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;
|
||||
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);
|
||||
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
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_sw_metadata
|
||||
ADD COLUMN target_visible boolean;
|
||||
ALTER TABLE sp_sw_metadata ADD COLUMN target_visible boolean;
|
||||
@@ -1,31 +1,22 @@
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_target_filter_query
|
||||
ADD COLUMN auto_assign_action_type integer;
|
||||
ALTER TABLE sp_target_filter_query ADD COLUMN auto_assign_action_type integer;
|
||||
@@ -1,5 +1,4 @@
|
||||
ALTER TABLE sp_action
|
||||
ADD COLUMN external_ref VARCHAR(512);
|
||||
ALTER TABLE sp_action ADD COLUMN external_ref VARCHAR(512);
|
||||
CREATE INDEX sp_idx_action_external_ref ON sp_action (external_ref);
|
||||
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_artifact
|
||||
ADD COLUMN sha256_hash CHAR(64);
|
||||
ALTER TABLE sp_artifact ADD COLUMN sha256_hash CHAR(64);
|
||||
@@ -1,6 +1,3 @@
|
||||
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;
|
||||
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;
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
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);
|
||||
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);
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
ALTER TABLE sp_distribution_set
|
||||
ADD COLUMN valid BOOLEAN;
|
||||
ALTER TABLE sp_distribution_set ADD COLUMN valid BOOLEAN;
|
||||
|
||||
UPDATE sp_distribution_set
|
||||
SET valid = 1;
|
||||
UPDATE sp_distribution_set SET valid = 1;
|
||||
@@ -1,5 +1,3 @@
|
||||
ALTER TABLE sp_base_software_module
|
||||
ADD COLUMN encrypted BOOLEAN;
|
||||
ALTER TABLE sp_base_software_module ADD COLUMN encrypted BOOLEAN;
|
||||
|
||||
UPDATE sp_base_software_module
|
||||
SET encrypted = 0;
|
||||
UPDATE sp_base_software_module SET encrypted = 0;
|
||||
@@ -1,3 +1,2 @@
|
||||
ALTER TABLE sp_action_status
|
||||
ADD column code integer;
|
||||
ALTER TABLE sp_action_status ADD column code integer;
|
||||
CREATE INDEX sp_idx_action_status_03 ON sp_action_status (tenant, code);
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_action
|
||||
ADD column last_action_status_code integer;
|
||||
ALTER TABLE sp_action ADD column last_action_status_code integer;
|
||||
@@ -1,12 +1,8 @@
|
||||
ALTER TABLE sp_rolloutgroup
|
||||
ADD column confirmation_required BOOLEAN;
|
||||
UPDATE sp_rolloutgroup
|
||||
SET confirmation_required = 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;
|
||||
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
|
||||
(
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
ALTER TABLE sp_target_filter_query
|
||||
ADD COLUMN access_control_context VARCHAR(4096);
|
||||
ALTER TABLE sp_rollout
|
||||
ADD COLUMN access_control_context VARCHAR(4096);
|
||||
ALTER TABLE sp_target_filter_query ADD COLUMN access_control_context VARCHAR(4096);
|
||||
ALTER TABLE sp_rollout ADD COLUMN access_control_context VARCHAR(4096);
|
||||
@@ -1,6 +1,3 @@
|
||||
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);
|
||||
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);
|
||||
@@ -1,17 +1,9 @@
|
||||
ALTER TABLE sp_rollout
|
||||
ADD COLUMN is_dynamic BOOLEAN;
|
||||
ALTER TABLE sp_rolloutgroup
|
||||
ADD COLUMN is_dynamic BOOLEAN NOT NULL DEFAULT false;
|
||||
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;
|
||||
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;
|
||||
@@ -1,4 +1,2 @@
|
||||
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;
|
||||
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;
|
||||
@@ -1,6 +1,3 @@
|
||||
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);
|
||||
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);
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
ALTER TABLE sp_rollout
|
||||
ADD column approval_decided_by varchar(40);
|
||||
ALTER TABLE sp_rollout
|
||||
ADD column approval_remark varchar(255);
|
||||
ALTER TABLE sp_rollout ADD column approval_decided_by varchar(40);
|
||||
ALTER TABLE sp_rollout ADD column approval_remark varchar(255);
|
||||
@@ -1,5 +1,4 @@
|
||||
create table sp_target_metadata
|
||||
(
|
||||
create table sp_target_metadata (
|
||||
meta_key varchar(128) not null,
|
||||
meta_value varchar(4000),
|
||||
target_id bigint not null,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
create table sp_target_filter_query
|
||||
(
|
||||
create table sp_target_filter_query (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
create table sp_rolloutgroup
|
||||
(
|
||||
create table sp_rolloutgroup (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -24,8 +23,7 @@ create table sp_rolloutgroup
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_rollout
|
||||
(
|
||||
create table sp_rollout (
|
||||
id bigint generated by default as identity,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -46,8 +44,7 @@ create table sp_rollout
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_rollouttargetgroup
|
||||
(
|
||||
create table sp_rollouttargetgroup (
|
||||
target_Id bigint not null,
|
||||
rolloutGroup_Id bigint not null,
|
||||
primary key (rolloutGroup_Id, target_Id)
|
||||
@@ -57,10 +54,8 @@ 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_action ADD COLUMN rollout bigint;
|
||||
ALTER TABLE sp_action ADD COLUMN rolloutgroup bigint;
|
||||
|
||||
alter table sp_rollout
|
||||
add constraint uk_rollout unique (name, tenant);
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
Update sp_software_module_type
|
||||
set max_ds_assignments = 1
|
||||
where max_ds_assignments < 1;
|
||||
Update sp_software_module_type set max_ds_assignments = 1 where max_ds_assignments < 1;
|
||||
@@ -1,3 +1,2 @@
|
||||
ALTER TABLE sp_rollout
|
||||
ADD column rollout_groups_created BIGINT;
|
||||
ALTER TABLE sp_rollout ADD column rollout_groups_created BIGINT;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
create table sp_action
|
||||
(
|
||||
|
||||
create table sp_action (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -16,8 +16,7 @@ create table sp_action
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_action_status
|
||||
(
|
||||
create table sp_action_status (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -31,14 +30,12 @@ create table sp_action_status
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_action_status_messages
|
||||
(
|
||||
create table sp_action_status_messages (
|
||||
action_status_id bigint not null,
|
||||
detail_message varchar(512)
|
||||
);
|
||||
|
||||
create table sp_artifact
|
||||
(
|
||||
create table sp_artifact (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -55,8 +52,7 @@ create table sp_artifact
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_base_software_module
|
||||
(
|
||||
create table sp_base_software_module (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -73,8 +69,7 @@ create table sp_base_software_module
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_distribution_set
|
||||
(
|
||||
create table sp_distribution_set (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -92,8 +87,7 @@ create table sp_distribution_set
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_distribution_set_type
|
||||
(
|
||||
create table sp_distribution_set_type (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -109,8 +103,7 @@ create table sp_distribution_set_type
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_distributionset_tag
|
||||
(
|
||||
create table sp_distributionset_tag (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -124,38 +117,33 @@ create table sp_distributionset_tag
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_ds_dstag
|
||||
(
|
||||
create table sp_ds_dstag (
|
||||
ds bigint not null,
|
||||
TAG bigint not null,
|
||||
primary key (ds, TAG)
|
||||
);
|
||||
|
||||
create table sp_ds_metadata
|
||||
(
|
||||
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
|
||||
(
|
||||
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
|
||||
(
|
||||
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
|
||||
(
|
||||
create table sp_external_artifact (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -172,8 +160,7 @@ create table sp_external_artifact
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_external_provider
|
||||
(
|
||||
create table sp_external_provider (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -188,8 +175,7 @@ create table sp_external_provider
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_software_module_type
|
||||
(
|
||||
create table sp_software_module_type (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -206,16 +192,14 @@ create table sp_software_module_type
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_sw_metadata
|
||||
(
|
||||
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
|
||||
(
|
||||
create table sp_target (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -231,16 +215,14 @@ create table sp_target
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_target_attributes
|
||||
(
|
||||
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
|
||||
(
|
||||
create table sp_target_info (
|
||||
target_id bigint not null,
|
||||
install_date bigint,
|
||||
ip_address varchar(46),
|
||||
@@ -251,8 +233,7 @@ create table sp_target_info
|
||||
primary key (target_id)
|
||||
);
|
||||
|
||||
create table sp_target_tag
|
||||
(
|
||||
create table sp_target_tag (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -266,15 +247,13 @@ create table sp_target_tag
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_target_target_tag
|
||||
(
|
||||
create table sp_target_target_tag (
|
||||
target bigint not null,
|
||||
tag bigint not null,
|
||||
primary key (target, tag)
|
||||
);
|
||||
|
||||
create table sp_tenant
|
||||
(
|
||||
create table sp_tenant (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -286,8 +265,7 @@ create table sp_tenant
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_tenant_configuration
|
||||
(
|
||||
create table sp_tenant_configuration (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
ALTER TABLE sp_rollout
|
||||
ADD COLUMN deleted BOOLEAN;
|
||||
ALTER TABLE sp_rollout ADD COLUMN deleted BOOLEAN;
|
||||
|
||||
UPDATE sp_rollout
|
||||
SET deleted = 0;
|
||||
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;
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_sw_metadata
|
||||
ADD COLUMN target_visible bit;
|
||||
ALTER TABLE sp_sw_metadata ADD COLUMN target_visible bit;
|
||||
@@ -1,31 +1,22 @@
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_target_filter_query
|
||||
ADD COLUMN auto_assign_action_type integer;
|
||||
ALTER TABLE sp_target_filter_query ADD COLUMN auto_assign_action_type integer;
|
||||
@@ -1,5 +1,4 @@
|
||||
ALTER TABLE sp_action
|
||||
ADD COLUMN external_ref VARCHAR(512);
|
||||
ALTER TABLE sp_action ADD COLUMN external_ref VARCHAR(512);
|
||||
CREATE INDEX sp_idx_action_external_ref ON sp_action (external_ref);
|
||||
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_artifact
|
||||
ADD COLUMN sha256_hash CHAR(64);
|
||||
ALTER TABLE sp_artifact ADD COLUMN sha256_hash CHAR(64);
|
||||
@@ -1,6 +1,3 @@
|
||||
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;
|
||||
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;
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
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);
|
||||
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);
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
ALTER TABLE sp_distribution_set
|
||||
ADD COLUMN valid BOOLEAN;
|
||||
ALTER TABLE sp_distribution_set ADD COLUMN valid BOOLEAN;
|
||||
|
||||
UPDATE sp_distribution_set
|
||||
SET valid = 1;
|
||||
UPDATE sp_distribution_set SET valid = 1;
|
||||
@@ -1,5 +1,3 @@
|
||||
ALTER TABLE sp_base_software_module
|
||||
ADD COLUMN encrypted BOOLEAN;
|
||||
ALTER TABLE sp_base_software_module ADD COLUMN encrypted BOOLEAN;
|
||||
|
||||
UPDATE sp_base_software_module
|
||||
SET encrypted = 0;
|
||||
UPDATE sp_base_software_module SET encrypted = 0;
|
||||
@@ -1,3 +1,2 @@
|
||||
ALTER TABLE sp_action_status
|
||||
ADD COLUMN code integer;
|
||||
ALTER TABLE sp_action_status ADD COLUMN code integer;
|
||||
CREATE INDEX sp_idx_action_status_03 ON sp_action_status (tenant, code);
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_action
|
||||
ADD COLUMN last_action_status_code integer;
|
||||
ALTER TABLE sp_action ADD COLUMN last_action_status_code integer;
|
||||
@@ -1,12 +1,8 @@
|
||||
ALTER TABLE sp_rolloutgroup
|
||||
ADD column confirmation_required BOOLEAN;
|
||||
UPDATE sp_rolloutgroup
|
||||
SET confirmation_required = 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;
|
||||
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
|
||||
(
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
ALTER TABLE sp_target_filter_query
|
||||
ADD COLUMN access_control_context VARCHAR(4096);
|
||||
ALTER TABLE sp_rollout
|
||||
ADD COLUMN access_control_context VARCHAR(4096);
|
||||
ALTER TABLE sp_target_filter_query ADD COLUMN access_control_context VARCHAR(4096);
|
||||
ALTER TABLE sp_rollout ADD COLUMN access_control_context VARCHAR(4096);
|
||||
@@ -1,6 +1,3 @@
|
||||
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);
|
||||
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);
|
||||
@@ -1,17 +1,9 @@
|
||||
ALTER TABLE sp_rollout
|
||||
ADD COLUMN is_dynamic BOOLEAN;
|
||||
ALTER TABLE sp_rolloutgroup
|
||||
ADD COLUMN is_dynamic BOOLEAN NOT NULL DEFAULT false;
|
||||
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;
|
||||
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;
|
||||
@@ -1,4 +1,2 @@
|
||||
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;
|
||||
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;
|
||||
@@ -1,6 +1,3 @@
|
||||
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);
|
||||
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);
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
ALTER TABLE sp_rollout
|
||||
ADD column approval_decided_by varchar(40);
|
||||
ALTER TABLE sp_rollout
|
||||
ADD column approval_remark varchar(255);
|
||||
ALTER TABLE sp_rollout ADD column approval_decided_by varchar(40);
|
||||
ALTER TABLE sp_rollout ADD column approval_remark varchar(255);
|
||||
@@ -1,5 +1,4 @@
|
||||
create table sp_target_metadata
|
||||
(
|
||||
create table sp_target_metadata (
|
||||
meta_key varchar(128) not null,
|
||||
meta_value varchar(4000),
|
||||
target_id bigint not null,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
create table sp_target_filter_query
|
||||
(
|
||||
create table sp_target_filter_query (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
create table sp_rolloutgroup
|
||||
(
|
||||
create table sp_rolloutgroup (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -24,8 +23,7 @@ create table sp_rolloutgroup
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_rollout
|
||||
(
|
||||
create table sp_rollout (
|
||||
id bigint not null auto_increment,
|
||||
created_at bigint,
|
||||
created_by varchar(40),
|
||||
@@ -46,8 +44,7 @@ create table sp_rollout
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table sp_rollouttargetgroup
|
||||
(
|
||||
create table sp_rollouttargetgroup (
|
||||
target_Id bigint not null,
|
||||
rolloutGroup_Id bigint not null,
|
||||
primary key (rolloutGroup_Id, target_Id)
|
||||
@@ -57,10 +54,8 @@ 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_action ADD COLUMN rollout bigint;
|
||||
ALTER TABLE sp_action ADD COLUMN rolloutgroup bigint;
|
||||
|
||||
alter table sp_rollout
|
||||
add constraint uk_rollout unique (name, tenant);
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
Update sp_software_module_type
|
||||
set max_ds_assignments = 1
|
||||
where max_ds_assignments < 1;
|
||||
Update sp_software_module_type set max_ds_assignments = 1 where max_ds_assignments < 1;
|
||||
@@ -1,3 +1,2 @@
|
||||
ALTER TABLE sp_rollout
|
||||
ADD column rollout_groups_created BIGINT;
|
||||
ALTER TABLE sp_rollout ADD column rollout_groups_created BIGINT;
|
||||
|
||||
@@ -77,8 +77,7 @@ NO CYCLE;
|
||||
|
||||
-- ------------ Write CREATE-TABLE-stage scripts -----------
|
||||
|
||||
CREATE TABLE sp_action
|
||||
(
|
||||
CREATE TABLE sp_action(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_action_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
@@ -104,8 +103,7 @@ CREATE TABLE sp_action
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_action_status
|
||||
(
|
||||
CREATE TABLE sp_action_status(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_action_status_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
@@ -121,8 +119,7 @@ CREATE TABLE sp_action_status
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_action_status_messages
|
||||
(
|
||||
CREATE TABLE sp_action_status_messages(
|
||||
action_status_id BIGINT NOT NULL,
|
||||
detail_message VARCHAR(512) NOT NULL
|
||||
)
|
||||
@@ -130,8 +127,7 @@ CREATE TABLE sp_action_status_messages
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_artifact
|
||||
(
|
||||
CREATE TABLE sp_artifact(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_artifact_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
@@ -150,8 +146,7 @@ CREATE TABLE sp_artifact
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_base_software_module
|
||||
(
|
||||
CREATE TABLE sp_base_software_module(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_base_software_module_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
@@ -170,8 +165,7 @@ CREATE TABLE sp_base_software_module
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_distribution_set
|
||||
(
|
||||
CREATE TABLE sp_distribution_set(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_distribution_set_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
@@ -191,8 +185,7 @@ CREATE TABLE sp_distribution_set
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_distribution_set_type
|
||||
(
|
||||
CREATE TABLE sp_distribution_set_type(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_distribution_set_type_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
@@ -210,8 +203,7 @@ CREATE TABLE sp_distribution_set_type
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_distributionset_tag
|
||||
(
|
||||
CREATE TABLE sp_distributionset_tag(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_distributionset_tag_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
@@ -227,8 +219,7 @@ CREATE TABLE sp_distributionset_tag
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_ds_dstag
|
||||
(
|
||||
CREATE TABLE sp_ds_dstag(
|
||||
ds BIGINT NOT NULL,
|
||||
tag BIGINT NOT NULL
|
||||
)
|
||||
@@ -236,8 +227,7 @@ CREATE TABLE sp_ds_dstag
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_ds_metadata
|
||||
(
|
||||
CREATE TABLE sp_ds_metadata(
|
||||
meta_key VARCHAR(128) NOT NULL,
|
||||
meta_value VARCHAR(4000),
|
||||
ds_id BIGINT NOT NULL
|
||||
@@ -246,8 +236,7 @@ CREATE TABLE sp_ds_metadata
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_ds_module
|
||||
(
|
||||
CREATE TABLE sp_ds_module(
|
||||
ds_id BIGINT NOT NULL,
|
||||
module_id BIGINT NOT NULL
|
||||
)
|
||||
@@ -255,8 +244,7 @@ CREATE TABLE sp_ds_module
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_ds_type_element
|
||||
(
|
||||
CREATE TABLE sp_ds_type_element(
|
||||
mandatory BOOLEAN,
|
||||
distribution_set_type BIGINT NOT NULL,
|
||||
software_module_type BIGINT NOT NULL
|
||||
@@ -265,8 +253,7 @@ CREATE TABLE sp_ds_type_element
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_rollout
|
||||
(
|
||||
CREATE TABLE sp_rollout(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_rollout_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
@@ -295,8 +282,7 @@ CREATE TABLE sp_rollout
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_rolloutgroup
|
||||
(
|
||||
CREATE TABLE sp_rolloutgroup(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_rolloutgroup_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
@@ -325,8 +311,7 @@ CREATE TABLE sp_rolloutgroup
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_rollouttargetgroup
|
||||
(
|
||||
CREATE TABLE sp_rollouttargetgroup(
|
||||
target_id BIGINT NOT NULL,
|
||||
rolloutgroup_id BIGINT NOT NULL
|
||||
)
|
||||
@@ -334,8 +319,7 @@ CREATE TABLE sp_rollouttargetgroup
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_software_module_type
|
||||
(
|
||||
CREATE TABLE sp_software_module_type(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_software_module_type_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
@@ -354,8 +338,7 @@ CREATE TABLE sp_software_module_type
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_sw_metadata
|
||||
(
|
||||
CREATE TABLE sp_sw_metadata(
|
||||
meta_key VARCHAR(128) NOT NULL,
|
||||
meta_value VARCHAR(4000),
|
||||
sw_id BIGINT NOT NULL,
|
||||
@@ -365,8 +348,7 @@ CREATE TABLE sp_sw_metadata
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_target
|
||||
(
|
||||
CREATE TABLE sp_target(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_target_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
@@ -390,8 +372,7 @@ CREATE TABLE sp_target
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_target_attributes
|
||||
(
|
||||
CREATE TABLE sp_target_attributes(
|
||||
target_id BIGINT NOT NULL,
|
||||
attribute_value VARCHAR(128),
|
||||
attribute_key VARCHAR(128) NOT NULL
|
||||
@@ -400,8 +381,7 @@ CREATE TABLE sp_target_attributes
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_target_filter_query
|
||||
(
|
||||
CREATE TABLE sp_target_filter_query(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_target_filter_query_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
@@ -419,8 +399,7 @@ CREATE TABLE sp_target_filter_query
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_target_metadata
|
||||
(
|
||||
CREATE TABLE sp_target_metadata(
|
||||
meta_key VARCHAR(128) NOT NULL,
|
||||
meta_value VARCHAR(4000),
|
||||
target_id BIGINT NOT NULL
|
||||
@@ -429,8 +408,7 @@ CREATE TABLE sp_target_metadata
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_target_tag
|
||||
(
|
||||
CREATE TABLE sp_target_tag(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_target_tag_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
@@ -446,8 +424,7 @@ CREATE TABLE sp_target_tag
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_target_target_tag
|
||||
(
|
||||
CREATE TABLE sp_target_target_tag(
|
||||
target BIGINT NOT NULL,
|
||||
tag BIGINT NOT NULL
|
||||
)
|
||||
@@ -455,8 +432,7 @@ CREATE TABLE sp_target_target_tag
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_tenant
|
||||
(
|
||||
CREATE TABLE sp_tenant(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_tenant_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
@@ -470,8 +446,7 @@ CREATE TABLE sp_tenant
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_tenant_configuration
|
||||
(
|
||||
CREATE TABLE sp_tenant_configuration(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_tenant_configuration_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
|
||||
@@ -7,8 +7,7 @@ NO CYCLE;
|
||||
|
||||
-- ------------ Write CREATE-TABLE-stage scripts -----------
|
||||
|
||||
CREATE TABLE sp_target_type
|
||||
(
|
||||
CREATE TABLE sp_target_type(
|
||||
id BIGINT NOT NULL DEFAULT nextval('sp_target_type_seq'),
|
||||
created_at BIGINT,
|
||||
created_by VARCHAR(64),
|
||||
@@ -24,8 +23,7 @@ CREATE TABLE sp_target_type
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
CREATE TABLE sp_target_type_ds_type_relation
|
||||
(
|
||||
CREATE TABLE sp_target_type_ds_type_relation(
|
||||
target_type BIGINT NOT NULL,
|
||||
distribution_set_type BIGINT NOT NULL
|
||||
)
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
ALTER TABLE sp_distribution_set
|
||||
ADD COLUMN valid BOOLEAN;
|
||||
ALTER TABLE sp_distribution_set ADD COLUMN valid BOOLEAN;
|
||||
|
||||
UPDATE sp_distribution_set
|
||||
SET valid = TRUE;
|
||||
UPDATE sp_distribution_set SET valid = TRUE;
|
||||
@@ -1,5 +1,3 @@
|
||||
ALTER TABLE sp_base_software_module
|
||||
ADD COLUMN encrypted BOOLEAN;
|
||||
ALTER TABLE sp_base_software_module ADD COLUMN encrypted BOOLEAN;
|
||||
|
||||
UPDATE sp_base_software_module
|
||||
SET encrypted = FALSE;
|
||||
UPDATE sp_base_software_module SET encrypted = FALSE;
|
||||
@@ -1,5 +1,4 @@
|
||||
ALTER TABLE sp_action_status
|
||||
ADD COLUMN code INTEGER;
|
||||
ALTER TABLE sp_action_status ADD COLUMN code INTEGER;
|
||||
CREATE INDEX sp_idx_action_status_03
|
||||
ON sp_action_status
|
||||
USING BTREE (tenant, code);
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_action
|
||||
ADD last_action_status_code INTEGER;
|
||||
ALTER TABLE sp_action ADD last_action_status_code INTEGER;
|
||||
@@ -3,10 +3,8 @@ ALTER TABLE sp_rolloutgroup
|
||||
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;
|
||||
UPDATE sp_rolloutgroup SET confirmation_required = FALSE;
|
||||
UPDATE sp_target_filter_query SET confirmation_required = FALSE;
|
||||
|
||||
CREATE TABLE sp_target_conf_status
|
||||
(
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
ALTER TABLE sp_target_filter_query
|
||||
ADD COLUMN access_control_context VARCHAR(4096);
|
||||
ALTER TABLE sp_rollout
|
||||
ADD COLUMN access_control_context VARCHAR(4096);
|
||||
ALTER TABLE sp_target_filter_query ADD COLUMN access_control_context VARCHAR(4096);
|
||||
ALTER TABLE sp_rollout ADD COLUMN access_control_context VARCHAR(4096);
|
||||
@@ -1,6 +1,3 @@
|
||||
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);
|
||||
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);
|
||||
@@ -1,20 +1,9 @@
|
||||
ALTER TABLE sp_rollout
|
||||
ADD COLUMN is_dynamic BOOLEAN;
|
||||
ALTER TABLE sp_rolloutgroup
|
||||
ADD COLUMN is_dynamic BOOLEAN NOT NULL DEFAULT false;
|
||||
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;
|
||||
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;
|
||||
@@ -1,4 +1,2 @@
|
||||
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;
|
||||
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;
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_target_filter_query
|
||||
ADD auto_assign_action_type INTEGER;
|
||||
ALTER TABLE sp_target_filter_query ADD auto_assign_action_type INTEGER;
|
||||
@@ -1,5 +1,4 @@
|
||||
ALTER TABLE sp_action
|
||||
ADD external_ref VARCHAR(512);
|
||||
ALTER TABLE sp_action ADD external_ref VARCHAR(512);
|
||||
CREATE INDEX sp_idx_action_external_ref ON sp_action (external_ref);
|
||||
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_artifact
|
||||
ADD sha256_hash CHAR(64);
|
||||
ALTER TABLE sp_artifact ADD sha256_hash CHAR(64);
|
||||
@@ -1,6 +1,3 @@
|
||||
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;
|
||||
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;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
ALTER TABLE sp_action
|
||||
ADD initiated_by VARCHAR(64) NOT NULL CONSTRAINT DF_SpAction_InitiatedBy DEFAULT '';
|
||||
ALTER TABLE sp_action ADD initiated_by VARCHAR(64) NOT NULL CONSTRAINT DF_SpAction_InitiatedBy DEFAULT '';
|
||||
ALTER TABLE sp_action DROP CONSTRAINT DF_SpAction_InitiatedBy;
|
||||
ALTER TABLE sp_target_filter_query
|
||||
ADD auto_assign_initiated_by VARCHAR(64);
|
||||
ALTER TABLE sp_target_filter_query ADD auto_assign_initiated_by VARCHAR(64);
|
||||
|
||||
@@ -19,14 +19,9 @@ CREATE TABLE sp_target_type_ds_type_relation
|
||||
distribution_set_type NUMERIC(19) NOT NULL,
|
||||
PRIMARY KEY (target_type, distribution_set_type)
|
||||
);
|
||||
ALTER TABLE sp_target_type
|
||||
ADD CONSTRAINT uk_target_type_name UNIQUE (name, tenant);
|
||||
ALTER TABLE sp_target
|
||||
ADD target_type NUMERIC(19) NULL;
|
||||
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;
|
||||
ALTER TABLE sp_target_type ADD CONSTRAINT uk_target_type_name UNIQUE (name, tenant);
|
||||
ALTER TABLE sp_target ADD target_type NUMERIC(19) NULL;
|
||||
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;
|
||||
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_distribution_set
|
||||
ADD valid BIT DEFAULT 1;
|
||||
ALTER TABLE sp_distribution_set ADD valid BIT DEFAULT 1;
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_base_software_module
|
||||
ADD encrypted BIT DEFAULT 0;
|
||||
ALTER TABLE sp_base_software_module ADD encrypted BIT DEFAULT 0;
|
||||
@@ -1,3 +1,2 @@
|
||||
ALTER TABLE sp_action_status
|
||||
ADD code INT;
|
||||
ALTER TABLE sp_action_status ADD code INT;
|
||||
CREATE INDEX sp_idx_action_status_03 ON sp_action_status (tenant, code);
|
||||
@@ -1,2 +1 @@
|
||||
ALTER TABLE sp_action
|
||||
ADD last_action_status_code INT;
|
||||
ALTER TABLE sp_action ADD last_action_status_code INT;
|
||||
@@ -1,7 +1,5 @@
|
||||
ALTER TABLE sp_rolloutgroup
|
||||
ADD confirmation_required BIT DEFAULT 0;
|
||||
ALTER TABLE sp_target_filter_query
|
||||
ADD confirmation_required BIT DEFAULT 0;
|
||||
ALTER TABLE sp_rolloutgroup ADD confirmation_required BIT DEFAULT 0;
|
||||
ALTER TABLE sp_target_filter_query ADD confirmation_required BIT DEFAULT 0;
|
||||
|
||||
CREATE TABLE sp_target_conf_status
|
||||
(
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
ALTER TABLE sp_target_filter_query
|
||||
ADD access_control_context VARCHAR(4096);
|
||||
ALTER TABLE sp_rollout
|
||||
ADD access_control_context VARCHAR(4096);
|
||||
ALTER TABLE sp_target_filter_query ADD access_control_context VARCHAR(4096);
|
||||
ALTER TABLE sp_rollout ADD access_control_context VARCHAR(4096);
|
||||
@@ -1,6 +1,3 @@
|
||||
ALTER TABLE sp_target_type
|
||||
ADD 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);
|
||||
ALTER TABLE sp_target_type ADD 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);
|
||||
@@ -1,17 +1,9 @@
|
||||
ALTER TABLE sp_rollout
|
||||
ADD is_dynamic BIT;
|
||||
ALTER TABLE sp_rolloutgroup
|
||||
ADD is_dynamic BIT NOT NULL DEFAULT 0;
|
||||
ALTER TABLE sp_rollout ADD is_dynamic BIT;
|
||||
ALTER TABLE sp_rolloutgroup ADD is_dynamic BIT NOT NULL DEFAULT 0;
|
||||
|
||||
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;
|
||||
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;
|
||||
@@ -1,4 +1,2 @@
|
||||
ALTER TABLE sp_base_software_module
|
||||
ADD locked BIT NOT NULL DEFAULT 1;
|
||||
ALTER TABLE sp_distribution_set
|
||||
ADD locked BIT NOT NULL DEFAULT 1;
|
||||
ALTER TABLE sp_base_software_module ADD locked BIT NOT NULL DEFAULT 1;
|
||||
ALTER TABLE sp_distribution_set ADD locked BIT NOT NULL DEFAULT 1;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user