diff --git a/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-db2.sql b/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-db2.sql new file mode 100644 index 0000000000..35070d680d --- /dev/null +++ b/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-db2.sql @@ -0,0 +1,92 @@ +create table task ( + pk bigint not null auto_increment, + batch_id varchar(255), + check_different bit, + check_missing bit, + compare_fields varchar(255), + completed integer, + created_time datetime not null, + destination_aet varchar(255), + device_name varchar(255) not null, + different integer not null, + error_comment varchar(255), + error_msg varchar(255), + exporter_id varchar(255), + failed integer, + local_aet varchar(255), + matches integer not null, + missing integer not null, + modalities varchar(255), + num_failures integer not null, + num_instances integer, + outcome_msg varchar(255), + payload longblob, + proc_end_time datetime, + proc_start_time datetime, + query_str varchar(255), + queue_name varchar(255) not null, + remaining integer, + remote_aet varchar(255), + rq_uri varchar(4000), + rq_host varchar(255), + rq_user_id varchar(255), + scheduled_time datetime not null, + series_iuid varchar(255), + sop_iuid varchar(255), + task_status integer not null, + status_code integer, + storage_ids varchar(255), + stgcmt_policy integer, + study_iuid varchar(255), + task_type integer not null, + update_location_status bit, + updated_time datetime not null, + version bigint, + warning integer not null, + primary key (pk) +); + +create table rel_task_dicomattrs (task_fk bigint not null, dicomattrs_fk bigint not null); + +alter table rel_task_dicomattrs add constraint UK_e0gtunmen48q8imxggunt7gt7 unique (dicomattrs_fk); +alter table rel_task_dicomattrs add constraint FK_e0gtunmen48q8imxggunt7gt7 foreign key (dicomattrs_fk) references dicomattrs (pk); +alter table rel_task_dicomattrs add constraint FK_pwaoih2f4ay4c00avvt79de7h foreign key (task_fk) references task (pk); + +alter table stgcmt_result add task_fk bigint; + +create index UK_j292rvji1d7hintidhgkkcbpw on stgcmt_result (task_fk); +create index UK_m47ruxpag7pq4gtn12lc63yfe on task (device_name(64)); +create index UK_r2bcfyreh4n9h392iik1aa6sh on task (queue_name(64)); +create index UK_a582by7kuyuhk8hi41tkelhrw on task (task_type); +create index UK_7y5ucdiygunyg2nh7qrs70e7k on task (task_status); +create index UK_76hkd9mjludoohse4g0ru1mg8 on task (created_time); +create index UK_9htwq4ofarp6m88r3ao0grt8j on task (updated_time); +create index UK_xwqht1afwe7k27iulvggnwwl on task (scheduled_time); +create index UK_k6dxmm1gu6u23xq03hbk80m4r on task (batch_id(64)); +create index UK_17gcm1xo6fkujauguyjfxfb2k on task (local_aet(64)); +create index UK_81xi6wnv5b10x3723fxt5bmew on task (remote_aet(64)); +create index UK_f7c43c242ybnvcn3o50lrcpkh on task (destination_aet(64)); +create index UK_pknlk8ggf8lnq38lq3gacvvpt on task (check_missing); +create index UK_1lchdfbbwkjbg7a6coy5t8iq7 on task (check_different); +create index UK_ow0nufrtniev7nkh7d0uv5mxe on task (compare_fields(64)); +create index UK_6a0y0rsssms4mtm9bpkw8vgl6 on task (study_iuid(64), series_iuid(64), sop_iuid(64)); + +create index FK_pwaoih2f4ay4c00avvt79de7h on rel_task_dicomattrs (task_fk) ; + +-- part 2: shall be applied on stopped archive before starting 5.24 + +-- part 3: can be applied on already running archive 5.24 +alter table stgcmt_result drop msg_id; + +drop table diff_task_attrs; +drop table diff_task; +drop table export_task; +drop table retrieve_task; +drop table stgver_task; +drop table queue_msg; + +drop sequence diff_task_pk_seq; +drop sequence export_task_pk_seq; +drop sequence retrieve_task_pk_seq; +drop sequence stgver_task_pk_seq; +drop sequence queue_msg_pk_seq; \ No newline at end of file diff --git a/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-firebird.sql b/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-firebird.sql new file mode 100644 index 0000000000..e522a362c3 --- /dev/null +++ b/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-firebird.sql @@ -0,0 +1,93 @@ +create table task ( + pk numeric(18,0) not null, + batch_id varchar(64), + check_different smallint, + check_missing smallint, + compare_fields varchar(64), + completed integer, + created_time timestamp not null, + destination_aet varchar(64), + device_name varchar(64) not null, + different integer not null, + error_comment varchar(255), + error_msg varchar(255), + exporter_id varchar(64), + failed integer, + local_aet varchar(64), + matches integer not null, + missing integer not null, + modalities varchar(255), + num_failures integer not null, + num_instances integer, + outcome_msg varchar(255), + payload blob, + proc_end_time timestamp, + proc_start_time timestamp, + query_str varchar(255), + queue_name varchar(64) not null, + remaining integer, + remote_aet varchar(64), + rq_uri varchar(4000), + rq_host varchar(255), + rq_user_id varchar(255), + scheduled_time timestamp not null, + series_iuid varchar(64), + sop_iuid varchar(64), + task_status integer not null, + status_code integer, + storage_ids varchar(64), + stgcmt_policy integer, + study_iuid varchar(64), + task_type integer not null, + update_location_status smallint, + updated_time timestamp not null, + version numeric(18,0), + warning integer not null, + primary key (pk) +); + +create table rel_task_dicomattrs (task_fk numeric(18,0) not null, dicomattrs_fk numeric(18,0) not null); + +alter table rel_task_dicomattrs add constraint UK_e0gtunmen48q8imxggunt7gt7 unique (dicomattrs_fk); +alter table rel_task_dicomattrs add constraint FK_e0gtunmen48q8imxggunt7gt7 foreign key (dicomattrs_fk) references dicomattrs; +alter table rel_task_dicomattrs add constraint FK_pwaoih2f4ay4c00avvt79de7h foreign key (task_fk) references task; + +alter table stgcmt_result add task_fk numeric(18,0); + +create index UK_j292rvji1d7hintidhgkkcbpw on stgcmt_result (task_fk); +create index UK_m47ruxpag7pq4gtn12lc63yfe on task (device_name); +create index UK_r2bcfyreh4n9h392iik1aa6sh on task (queue_name); +create index UK_a582by7kuyuhk8hi41tkelhrw on task (task_type); +create index UK_7y5ucdiygunyg2nh7qrs70e7k on task (task_status); +create index UK_76hkd9mjludoohse4g0ru1mg8 on task (created_time); +create index UK_9htwq4ofarp6m88r3ao0grt8j on task (updated_time); +create index UK_xwqht1afwe7k27iulvggnwwl on task (scheduled_time); +create index UK_k6dxmm1gu6u23xq03hbk80m4r on task (batch_id); +create index UK_17gcm1xo6fkujauguyjfxfb2k on task (local_aet); +create index UK_81xi6wnv5b10x3723fxt5bmew on task (remote_aet); +create index UK_f7c43c242ybnvcn3o50lrcpkh on task (destination_aet); +create index UK_pknlk8ggf8lnq38lq3gacvvpt on task (check_missing); +create index UK_1lchdfbbwkjbg7a6coy5t8iq7 on task (check_different); +create index UK_ow0nufrtniev7nkh7d0uv5mxe on task (compare_fields); +create index UK_6a0y0rsssms4mtm9bpkw8vgl6 on task (study_iuid, series_iuid, sop_iuid); + +create generator task_pk_seq; + +-- part 2: shall be applied on stopped archive before starting 5.24 + +-- part 3: can be applied on already running archive 5.24 +drop index UK_4iih0m0ueyvaim3033di45ems; +alter table stgcmt_result drop msg_id; + +drop table diff_task_attrs; +drop table diff_task; +drop table export_task; +drop table retrieve_task; +drop table stgver_task; +drop table queue_msg; + +drop generator diff_task_pk_seq; +drop generator export_task_pk_seq; +drop generator retrieve_task_pk_seq; +drop generator stgver_task_pk_seq; +drop generator queue_msg_pk_seq; \ No newline at end of file diff --git a/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-h2.sql b/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-h2.sql new file mode 100644 index 0000000000..0f943a4f69 --- /dev/null +++ b/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-h2.sql @@ -0,0 +1,95 @@ +-- part 1: can be applied on archive running archive 5.23 +create table task +( + pk int8 not null, + batch_id varchar(255), + check_different boolean, + check_missing boolean, + compare_fields varchar(255), + completed int4, + created_time timestamp not null, + destination_aet varchar(255), + device_name varchar(255) not null, + different int4 not null, + error_comment varchar(255), + error_msg varchar(255), + exporter_id varchar(255), + failed int4, + local_aet varchar(255), + matches int4 not null, + missing int4 not null, + modalities varchar(255), + num_failures int4 not null, + num_instances int4, + outcome_msg varchar(255), + payload bytea, + proc_end_time timestamp, + proc_start_time timestamp, + query_str varchar(255), + queue_name varchar(255) not null, + remaining int4, + remote_aet varchar(255), + rq_uri varchar(4000), + rq_host varchar(255), + rq_user_id varchar(255), + scheduled_time timestamp not null, + series_iuid varchar(255), + sop_iuid varchar(255), + task_status int4 not null, + status_code int4, + storage_ids varchar(255), + stgcmt_policy int4, + study_iuid varchar(255), + task_type int4 not null, + update_location_status boolean, + updated_time timestamp not null, + version int8, + warning int4 not null, + primary key (pk) +); + +create table rel_task_dicomattrs (task_fk int8 not null, dicomattrs_fk int8 not null); +alter table rel_task_dicomattrs add constraint UK_e0gtunmen48q8imxggunt7gt7 unique (dicomattrs_fk); +alter table rel_task_dicomattrs add constraint FK_e0gtunmen48q8imxggunt7gt7 foreign key (dicomattrs_fk) references dicomattrs; +alter table rel_task_dicomattrs add constraint FK_pwaoih2f4ay4c00avvt79de7h foreign key (task_fk) references task; + +alter table stgcmt_result add task_fk int8; + +create index UK_j292rvji1d7hintidhgkkcbpw on stgcmt_result (task_fk); +create index UK_m47ruxpag7pq4gtn12lc63yfe on task (device_name); +create index UK_r2bcfyreh4n9h392iik1aa6sh on task (queue_name); +create index UK_a582by7kuyuhk8hi41tkelhrw on task (task_type); +create index UK_7y5ucdiygunyg2nh7qrs70e7k on task (task_status); +create index UK_76hkd9mjludoohse4g0ru1mg8 on task (created_time); +create index UK_9htwq4ofarp6m88r3ao0grt8j on task (updated_time); +create index UK_xwqht1afwe7k27iulvggnwwl on task (scheduled_time); +create index UK_k6dxmm1gu6u23xq03hbk80m4r on task (batch_id); +create index UK_17gcm1xo6fkujauguyjfxfb2k on task (local_aet); +create index UK_81xi6wnv5b10x3723fxt5bmew on task (remote_aet); +create index UK_f7c43c242ybnvcn3o50lrcpkh on task (destination_aet); +create index UK_pknlk8ggf8lnq38lq3gacvvpt on task (check_missing); +create index UK_1lchdfbbwkjbg7a6coy5t8iq7 on task (check_different); +create index UK_ow0nufrtniev7nkh7d0uv5mxe on task (compare_fields); +create index UK_6a0y0rsssms4mtm9bpkw8vgl6 on task (study_iuid, series_iuid, sop_iuid); + +create index FK_pwaoih2f4ay4c00avvt79de7h on rel_task_dicomattrs (task_fk) ; + +create sequence task_pk_seq; + +-- part 2: shall be applied on stopped archive before starting 5.24 + +-- part 3: can be applied on already running archive 5.24 +alter table stgcmt_result drop msg_id; + +drop table diff_task_attrs; +drop table diff_task; +drop table export_task; +drop table retrieve_task; +drop table stgver_task; +drop table queue_msg; + +drop sequence diff_task_pk_seq; +drop sequence export_task_pk_seq; +drop sequence retrieve_task_pk_seq; +drop sequence stgver_task_pk_seq; +drop sequence queue_msg_pk_seq; diff --git a/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-mysql.sql b/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-mysql.sql new file mode 100644 index 0000000000..d73a922b5d --- /dev/null +++ b/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-mysql.sql @@ -0,0 +1,86 @@ +create table task ( + pk bigint not null auto_increment, + batch_id varchar(255), + check_different bit, + check_missing bit, + compare_fields varchar(255), + completed integer, + created_time datetime not null, + destination_aet varchar(255), + device_name varchar(255) not null, + different integer not null, + error_comment varchar(255), + error_msg varchar(255), + exporter_id varchar(255), + failed integer, + local_aet varchar(255), + matches integer not null, + missing integer not null, + modalities varchar(255), + num_failures integer not null, + num_instances integer, + outcome_msg varchar(255), + payload longblob, + proc_end_time datetime, + proc_start_time datetime, + query_str varchar(255), + queue_name varchar(255) not null, + remaining integer, + remote_aet varchar(255), + rq_uri varchar(4000), + rq_host varchar(255), + rq_user_id varchar(255), + scheduled_time datetime not null, + series_iuid varchar(255), + sop_iuid varchar(255), + task_status integer not null, + status_code integer, + storage_ids varchar(255), + stgcmt_policy integer, + study_iuid varchar(255), + task_type integer not null, + update_location_status bit, + updated_time datetime not null, + version bigint, + warning integer not null, + primary key (pk) +); + +create table rel_task_dicomattrs (task_fk bigint not null, dicomattrs_fk bigint not null); + +alter table rel_task_dicomattrs add constraint UK_e0gtunmen48q8imxggunt7gt7 unique (dicomattrs_fk); +alter table rel_task_dicomattrs add constraint FK_e0gtunmen48q8imxggunt7gt7 foreign key (dicomattrs_fk) references dicomattrs (pk); +alter table rel_task_dicomattrs add constraint FK_pwaoih2f4ay4c00avvt79de7h foreign key (task_fk) references task (pk); + +alter table stgcmt_result add task_fk bigint; + +create index UK_j292rvji1d7hintidhgkkcbpw on stgcmt_result (task_fk); +create index UK_m47ruxpag7pq4gtn12lc63yfe on task (device_name(64)); +create index UK_r2bcfyreh4n9h392iik1aa6sh on task (queue_name(64)); +create index UK_a582by7kuyuhk8hi41tkelhrw on task (task_type); +create index UK_7y5ucdiygunyg2nh7qrs70e7k on task (task_status); +create index UK_76hkd9mjludoohse4g0ru1mg8 on task (created_time); +create index UK_9htwq4ofarp6m88r3ao0grt8j on task (updated_time); +create index UK_xwqht1afwe7k27iulvggnwwl on task (scheduled_time); +create index UK_k6dxmm1gu6u23xq03hbk80m4r on task (batch_id(64)); +create index UK_17gcm1xo6fkujauguyjfxfb2k on task (local_aet(64)); +create index UK_81xi6wnv5b10x3723fxt5bmew on task (remote_aet(64)); +create index UK_f7c43c242ybnvcn3o50lrcpkh on task (destination_aet(64)); +create index UK_pknlk8ggf8lnq38lq3gacvvpt on task (check_missing); +create index UK_1lchdfbbwkjbg7a6coy5t8iq7 on task (check_different); +create index UK_ow0nufrtniev7nkh7d0uv5mxe on task (compare_fields(64)); +create index UK_6a0y0rsssms4mtm9bpkw8vgl6 on task (study_iuid(64), series_iuid(64), sop_iuid(64)); + +create index FK_pwaoih2f4ay4c00avvt79de7h on rel_task_dicomattrs (task_fk) ; + +-- part 2: shall be applied on stopped archive before starting 5.24 + +-- part 3: can be applied on already running archive 5.24 +alter table stgcmt_result drop msg_id; + +drop table diff_task_attrs; +drop table diff_task; +drop table export_task; +drop table retrieve_task; +drop table stgver_task; +drop table queue_msg; \ No newline at end of file diff --git a/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-oracle.sql b/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-oracle.sql new file mode 100644 index 0000000000..0429b2d8cd --- /dev/null +++ b/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-oracle.sql @@ -0,0 +1,94 @@ +create table task ( + pk number(19,0) not null, + batch_id varchar2(255 char), + check_different number(1,0), + check_missing number(1,0), + compare_fields varchar2(255 char), + completed number(10,0), + created_time timestamp not null, + destination_aet varchar2(255 char), + device_name varchar2(255 char) not null, + different number(10,0) not null, + error_comment varchar2(255 char), + error_msg varchar2(255 char), + exporter_id varchar2(255 char), + failed number(10,0), + local_aet varchar2(255 char), + matches number(10,0) not null, + missing number(10,0) not null, + modalities varchar2(255 char), + num_failures number(10,0) not null, + num_instances number(10,0), + outcome_msg varchar2(255 char), + payload blob, + proc_end_time timestamp, + proc_start_time timestamp, + query_str varchar2(255 char), + queue_name varchar2(255 char) not null, + remaining number(10,0), + remote_aet varchar2(255 char), + rq_uri varchar2(4000 char), + rq_host varchar2(255 char), + rq_user_id varchar2(255 char), + scheduled_time timestamp not null, + series_iuid varchar2(255 char), + sop_iuid varchar2(255 char), + task_status number(10,0) not null, + status_code number(10,0), + storage_ids varchar2(255 char), + stgcmt_policy number(10,0), + study_iuid varchar2(255 char), + task_type number(10,0) not null, + update_location_status number(1,0), + updated_time timestamp not null, + version number(19,0), + warning number(10,0) not null, + primary key (pk) +); + +create table rel_task_dicomattrs (task_fk number(19,0) not null, dicomattrs_fk number(19,0) not null); + +alter table rel_task_dicomattrs add constraint UK_e0gtunmen48q8imxggunt7gt7 unique (dicomattrs_fk); +alter table rel_task_dicomattrs add constraint FK_e0gtunmen48q8imxggunt7gt7 foreign key (dicomattrs_fk) references dicomattrs; +alter table rel_task_dicomattrs add constraint FK_pwaoih2f4ay4c00avvt79de7h foreign key (task_fk) references task; + +alter table stgcmt_result add task_fk number(19,0); + + +create index UK_j292rvji1d7hintidhgkkcbpw on stgcmt_result (task_fk); +create index UK_m47ruxpag7pq4gtn12lc63yfe on task (device_name); +create index UK_r2bcfyreh4n9h392iik1aa6sh on task (queue_name); +create index UK_a582by7kuyuhk8hi41tkelhrw on task (task_type); +create index UK_7y5ucdiygunyg2nh7qrs70e7k on task (task_status); +create index UK_76hkd9mjludoohse4g0ru1mg8 on task (created_time); +create index UK_9htwq4ofarp6m88r3ao0grt8j on task (updated_time); +create index UK_xwqht1afwe7k27iulvggnwwl on task (scheduled_time); +create index UK_k6dxmm1gu6u23xq03hbk80m4r on task (batch_id); +create index UK_17gcm1xo6fkujauguyjfxfb2k on task (local_aet); +create index UK_81xi6wnv5b10x3723fxt5bmew on task (remote_aet); +create index UK_f7c43c242ybnvcn3o50lrcpkh on task (destination_aet); +create index UK_pknlk8ggf8lnq38lq3gacvvpt on task (check_missing); +create index UK_1lchdfbbwkjbg7a6coy5t8iq7 on task (check_different); +create index UK_ow0nufrtniev7nkh7d0uv5mxe on task (compare_fields); +create index UK_6a0y0rsssms4mtm9bpkw8vgl6 on task (study_iuid, series_iuid, sop_iuid); + +create index FK_pwaoih2f4ay4c00avvt79de7h on rel_task_dicomattrs (task_fk) ; + +create sequence task_pk_seq; +-- part 2: shall be applied on stopped archive before starting 5.24 + +-- part 3: can be applied on already running archive 5.24 +alter table stgcmt_result drop column msg_id; + +drop table diff_task_attrs; +drop table diff_task; +drop table export_task; +drop table retrieve_task; +drop table stgver_task; +drop table queue_msg; + +drop sequence diff_task_pk_seq; +drop sequence export_task_pk_seq; +drop sequence retrieve_task_pk_seq; +drop sequence stgver_task_pk_seq; +drop sequence queue_msg_pk_seq; \ No newline at end of file diff --git a/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-psql.sql b/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-psql.sql index 8266a0bac0..0f943a4f69 100644 --- a/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-psql.sql +++ b/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-psql.sql @@ -55,7 +55,7 @@ alter table rel_task_dicomattrs add constraint FK_pwaoih2f4ay4c00avvt79de7h fore alter table stgcmt_result add task_fk int8; -create index UK_ghrndxbss4vxuxmsc3xeu2ol8 on stgcmt_result (task_fk); +create index UK_j292rvji1d7hintidhgkkcbpw on stgcmt_result (task_fk); create index UK_m47ruxpag7pq4gtn12lc63yfe on task (device_name); create index UK_r2bcfyreh4n9h392iik1aa6sh on task (queue_name); create index UK_a582by7kuyuhk8hi41tkelhrw on task (task_type); @@ -81,12 +81,12 @@ create sequence task_pk_seq; -- part 3: can be applied on already running archive 5.24 alter table stgcmt_result drop msg_id; +drop table diff_task_attrs; drop table diff_task; drop table export_task; drop table retrieve_task; drop table stgver_task; drop table queue_msg; -drop table diff_task_attrs; drop sequence diff_task_pk_seq; drop sequence export_task_pk_seq; diff --git a/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-sqlserver.sql b/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-sqlserver.sql new file mode 100644 index 0000000000..9fce3d3fdf --- /dev/null +++ b/dcm4chee-arc-entity/src/main/resources/sql/update-5.24-sqlserver.sql @@ -0,0 +1,95 @@ +create table task ( + pk bigint identity not null, + batch_id varchar(255), + check_different bit, + check_missing bit, + compare_fields varchar(255), + completed int, + created_time datetime2 not null, + destination_aet varchar(255), + device_name varchar(255) not null, + different int not null, + error_comment varchar(255), + error_msg varchar(255), + exporter_id varchar(255), + failed int, + local_aet varchar(255), + matches int not null, + missing int not null, + modalities varchar(255), + num_failures int not null, + num_instances int, + outcome_msg varchar(255), + payload varbinary(MAX), + proc_end_time datetime2, + proc_start_time datetime2, + query_str varchar(255), + queue_name varchar(255) not null, + remaining int, + remote_aet varchar(255), + rq_uri varchar(4000), + rq_host varchar(255), + rq_user_id varchar(255), + scheduled_time datetime2 not null, + series_iuid varchar(255), + sop_iuid varchar(255), + task_status int not null, + status_code int, + storage_ids varchar(255), + stgcmt_policy int, + study_iuid varchar(255), + task_type int not null, + update_location_status bit, + updated_time datetime2 not null, + version bigint, + warning int not null, + primary key (pk) +); + +create table rel_task_dicomattrs (task_fk bigint not null, dicomattrs_fk bigint not null); + +alter table rel_task_dicomattrs add constraint UK_e0gtunmen48q8imxggunt7gt7 unique (dicomattrs_fk); +alter table rel_task_dicomattrs add constraint FK_e0gtunmen48q8imxggunt7gt7 foreign key (dicomattrs_fk) references dicomattrs; +alter table rel_task_dicomattrs add constraint FK_pwaoih2f4ay4c00avvt79de7h foreign key (task_fk) references task; + +alter table stgcmt_result add task_fk bigint; + +create index UK_j292rvji1d7hintidhgkkcbpw on stgcmt_result (task_fk); +create index UK_m47ruxpag7pq4gtn12lc63yfe on task (device_name); +create index UK_r2bcfyreh4n9h392iik1aa6sh on task (queue_name); +create index UK_a582by7kuyuhk8hi41tkelhrw on task (task_type); +create index UK_7y5ucdiygunyg2nh7qrs70e7k on task (task_status); +create index UK_76hkd9mjludoohse4g0ru1mg8 on task (created_time); +create index UK_9htwq4ofarp6m88r3ao0grt8j on task (updated_time); +create index UK_xwqht1afwe7k27iulvggnwwl on task (scheduled_time); +create index UK_k6dxmm1gu6u23xq03hbk80m4r on task (batch_id); +create index UK_17gcm1xo6fkujauguyjfxfb2k on task (local_aet); +create index UK_81xi6wnv5b10x3723fxt5bmew on task (remote_aet); +create index UK_f7c43c242ybnvcn3o50lrcpkh on task (destination_aet); +create index UK_pknlk8ggf8lnq38lq3gacvvpt on task (check_missing); +create index UK_1lchdfbbwkjbg7a6coy5t8iq7 on task (check_different); +create index UK_ow0nufrtniev7nkh7d0uv5mxe on task (compare_fields); +create index UK_6a0y0rsssms4mtm9bpkw8vgl6 on task (study_iuid, series_iuid, sop_iuid); + +create index FK_pwaoih2f4ay4c00avvt79de7h on rel_task_dicomattrs (task_fk) ; + +create sequence task_pk_seq; + +-- part 2: shall be applied on stopped archive before starting 5.24 + +-- part 3: can be applied on already running archive 5.24 +drop index UK_4iih0m0ueyvaim3033di45ems on stgcmt_result; +alter table stgcmt_result drop column msg_id; + +drop table diff_task_attrs; +drop table diff_task; +drop table export_task; +drop table retrieve_task; +drop table stgver_task; +drop table queue_msg; + +drop sequence diff_task_pk_seq; +drop sequence export_task_pk_seq; +drop sequence retrieve_task_pk_seq; +drop sequence stgver_task_pk_seq; +drop sequence queue_msg_pk_seq;