Skip to content

Commit

Permalink
[MOSIP-32507] Pre-reg service migration from Java 11 to Java 21 (#683)
Browse files Browse the repository at this point in the history
* updated kernel.keymanager.version in pom

* [MOSIP-19036] Fixed adding lunch hours and moving lunch hours issue.

* [MOSIP-20468] Created Specific error code for consumed PRID, [MOSIP-20435] wrote unit tests for NotificationService

* [MOSIP-20435] Updated unit test for Demographic service

* [MOSIP-20435] Fixed sonar issues

* Added all changes

* Updated changes

* MOSIP-21214 Added Script to insert record in mosip_prereg applications table.

* MOSIP-21214 Added Script to insert record in mosip_prereg applications table.

* MOSIP-21409 : Changed timestamp to time.

* [MOSIP-20020] Update release_changes.yml

* [ MOSIP-20021 ] updated release_changes.yml to update README.md badges

* [MOSIP-20028] added action for tagging

* DB release script re-structurisation changes

* MOSIP-23623 Added revoke.sql

* MOSIP-23854 ref to pre_registration_transaction

* Release Bot Pre-release changes

* Update README.md

* [MOSIP-24254] reverted pom version

* Mosip 23833 (#595)

* [MOSIP-23833] update db release scripts

* [MOSIP-23833] added psql error handling

* [MOSIP-24322] updated deploy.properties

* [MOSIP-23833] restructered db upgrade scripts

* Update upgrade.properties

* Update upgrade.properties

Signed-off-by: Keshav Mishra <[email protected]>

* Update upgrade.properties

Signed-off-by: Keshav Mishra <[email protected]>

---------

Signed-off-by: Keshav Mishra <[email protected]>

* release-1.2.0.1 build failure issue

* MOSIP-23945 bean defination modified

* [MOSIP-27964] Update 1.1.5.5_to_1.2.0.1-B1_upgrade.sql

Signed-off-by: Keshav Mishra <[email protected]>

* Update 1.1.5.5_to_1.2.0.1-B1_rollback.sql

Signed-off-by: Keshav Mishra <[email protected]>

* [MOSIP-27964]

* [MOSIP-27964]

* [MOSIP-27987] Updated prereg db_upgrade_scripts

* [MOSIP-28035] Update 1.1.5.5_to_1.2.0.1-B1_rollback.sql (#600)

Signed-off-by: Keshav Mishra <[email protected]>

* [MOSIP-27987] Updated scripts

* Updated review changes

* [MOSIP-27978] Update 1.1.5.5_to_1.2.0.1-B1_upgrade.sql

Signed-off-by: Keshav Mishra <[email protected]>

* [MOSIP-28179] Updated internal dependencies

* [MOSIP-28225] moved ddl statements to upgrade scripts

* deleted ddl files

* [MOSIP-21206] Added support for pre-reg app service also to be a lib

* [MOSIP-28225] Updated PR as per review

* Update pom.xml

Signed-off-by: Loganathan Sekar <[email protected]>

* [MOSIP-23518] Update 1.1.5.5_to_1.2.0.1-B1_upgrade.sql (#607)

Signed-off-by: Keshav Mishra <[email protected]>

* [MOSIP-28488] Update README.md (#608)

Signed-off-by: Rakshithb1 <[email protected]>

* [MOSIP-28225] Updated upgrade scripts

* [MOSIP-27966] Update 1.1.5.5_to_1.2.0.1-B1_rollback.sql

Signed-off-by: Keshav Mishra <[email protected]>

* [MOSIP-28484] Added error handling for deploy.sh script (#617)

Co-authored-by: akilalakshmanan <[email protected]>

* [MOSIP-29142] updated workflows as per reusable workflows templates (#624)

[MOSIP-25631]

Co-authored-by: syed-salman-technoforte <[email protected]>

* [MOSIP-29918] added db-test.yml (#628)

Signed-off-by: Rakshithb1 <[email protected]>

* [MOSIP-29805] Updated Anonymous profile

Signed-off-by: Aiham <[email protected]>

* [MOSIP-29805] Updated naming convention

Signed-off-by: Aiham <[email protected]>

* [MOSIP-29805] Rebuilt maven

Signed-off-by: Aiham <[email protected]>

* [DSD-3932] removed release-changes.yml, tag.yml and updated push-trigger.yml file (#636)

Signed-off-by: techno-467 <[email protected]>

* Release changes (#640)

* Updated Pom versions for release changes

Signed-off-by: GitHub <[email protected]>

* Update pom.xml

Signed-off-by: PRAFUL RAKHADE <[email protected]>

* Update push-trigger.yml

Signed-off-by: Chandra Keshav Mishra <[email protected]>

---------

Signed-off-by: GitHub <[email protected]>
Signed-off-by: PRAFUL RAKHADE <[email protected]>
Signed-off-by: Chandra Keshav Mishra <[email protected]>
Co-authored-by: Prafulrakhade <[email protected]>
Co-authored-by: PRAFUL RAKHADE <[email protected]>

* [[MOSIP-29961] removed paths from db-test.yml (#642)

Signed-off-by: Rakshith B <[email protected]>

* [MOSIP-29805] Updated Anonymous profile (#634)

* [MOSIP-29805] Updated Anonymous profile

Signed-off-by: Aiham <[email protected]>

* [MOSIP-29805] Updated naming convention

Signed-off-by: Aiham <[email protected]>

---------

Signed-off-by: Aiham <[email protected]>

* [DSD-3932] updated push-trigger.yml file (#643)

Signed-off-by: techno-467 <[email protected]>

* [MOSIP-25644] Fixed otp issue

Signed-off-by: Aiham <[email protected]>

* [MOSIP-31071] Added logger to debug

Signed-off-by: Aiham <[email protected]>

* [MOSIP-31199] Updated internal dependency

Signed-off-by: Aiham <[email protected]>

* [MOSIP-31071] Removed logger

Signed-off-by: Aiham <[email protected]>

* [MOSIP-31202] updated sql file names (#648)

* Rename 1.2.0.1-B1_to_1.2.0.1_rollback.sql to 1.2.0.1-B1_to_1.2.0.1-B2_rollback.sql

Signed-off-by: Praful Rakhade <[email protected]>

* Rename 1.2.0.1-B1_to_1.2.0.1_upgrade.sql to 1.2.0.1-B1_to_1.2.0.1-B2_upgrade.sql

Signed-off-by: Praful Rakhade <[email protected]>

---------

Signed-off-by: Praful Rakhade <[email protected]>

* [DSD-4255] Fixed Nexus failure

Signed-off-by: Aiham <[email protected]>

* [DSD-4255] Fixed Nexus failure

Signed-off-by: Aiham <[email protected]>

* [DSD-4255]Update push-trigger.yml (#651)

Signed-off-by: Rakshitha650 <[email protected]>

* [MOSIP-31762] Added db scripts for 1.2.0.1-B3_to_1.2.0.1

Signed-off-by: Aiham <[email protected]>

* Updated Pom versions for release changes (#653)

Signed-off-by: GitHub <[email protected]>
Co-authored-by: Prafulrakhade <[email protected]>

* [MOSIP-31762] Updated db scripts (#654)

Signed-off-by: Aiham <[email protected]>

* [MOSIP-32507] Migrated Pre-reg services from Java 11 to Java 21

Signed-off-by: Aiham <[email protected]>

* Fixed postgres build failure

Signed-off-by: Aiham <[email protected]>

* Updated batchjob db scripts

Signed-off-by: Aiham <[email protected]>

* Updated db scripts

Signed-off-by: Aiham <[email protected]>

* updated scripts

Signed-off-by: Aiham <[email protected]>

* updated test cases

Signed-off-by: Aiham <[email protected]>

* [Java21]

Signed-off-by: JanardhanBS-SyncByte <[email protected]>

* [Java21]

Signed-off-by: JanardhanBS-SyncByte <[email protected]>

* [Java21]

Signed-off-by: JanardhanBS-SyncByte <[email protected]>

* [Java21]

Signed-off-by: JanardhanBS-SyncByte <[email protected]>

* [Java21]

Signed-off-by: JanardhanBS-SyncByte <[email protected]>

* [Java21]

Signed-off-by: JanardhanBS-SyncByte <[email protected]>

* [Java21]

Signed-off-by: JanardhanBS-SyncByte <[email protected]>

* [Java21]

Signed-off-by: JanardhanBS-SyncByte <[email protected]>

* updated test case

Signed-off-by: Aiham <[email protected]>

* [Java21]

Signed-off-by: JanardhanBS-SyncByte <[email protected]>

* [Java21]

Signed-off-by: JanardhanBS-SyncByte <[email protected]>

* [Java21]

Signed-off-by: JanardhanBS-SyncByte <[email protected]>

* Updated code

Signed-off-by: Aiham <[email protected]>

* [Java21]

Signed-off-by: JanardhanBS-SyncByte <[email protected]>

* [Java21]

Signed-off-by: JanardhanBS-SyncByte <[email protected]>

* [Java21]

Signed-off-by: JanardhanBS-SyncByte <[email protected]>

* [Java21]

Signed-off-by: JanardhanBS-SyncByte <[email protected]>

* updated

* [MOSIP-32507] Fixed application service run,  Datasync run, Batchjob run failures

Signed-off-by: Aiham <[email protected]>

* code cleanup

Signed-off-by: Aiham <[email protected]>

---------

Signed-off-by: Keshav Mishra <[email protected]>
Signed-off-by: Loganathan Sekar <[email protected]>
Signed-off-by: Vishwa <[email protected]>
Signed-off-by: Rakshithb1 <[email protected]>
Signed-off-by: Rakshithb1 <[email protected]>
Signed-off-by: Aiham <[email protected]>
Signed-off-by: techno-467 <[email protected]>
Signed-off-by: GitHub <[email protected]>
Signed-off-by: PRAFUL RAKHADE <[email protected]>
Signed-off-by: Chandra Keshav Mishra <[email protected]>
Signed-off-by: Rakshith B <[email protected]>
Signed-off-by: Praful Rakhade <[email protected]>
Signed-off-by: Rakshitha650 <[email protected]>
Signed-off-by: JanardhanBS-SyncByte <[email protected]>
Signed-off-by: Aiham Hasan <[email protected]>
Co-authored-by: Mayura Deshmukh <[email protected]>
Co-authored-by: Mayura Deshmukh <[email protected]>
Co-authored-by: Mahammed Taheer <[email protected]>
Co-authored-by: kameshsr <[email protected]>
Co-authored-by: Sasikumar Ganesan <[email protected]>
Co-authored-by: kameshsr <[email protected]>
Co-authored-by: Keshav Mishra <[email protected]>
Co-authored-by: syed-salman-technoforte <[email protected]>
Co-authored-by: syed-salman-technoforte <[email protected]>
Co-authored-by: pramod444 <[email protected]>
Co-authored-by: Vishwa <[email protected]>
Co-authored-by: Loganathan Sekar <[email protected]>
Co-authored-by: Rakshithb1 <[email protected]>
Co-authored-by: Akila Lakshmanan <[email protected]>
Co-authored-by: akilalakshmanan <[email protected]>
Co-authored-by: syed salman <[email protected]>
Co-authored-by: PRAFUL RAKHADE <[email protected]>
Co-authored-by: Prafulrakhade <[email protected]>
Co-authored-by: Rakshitha650 <[email protected]>
Co-authored-by: JanardhanBS-SyncByte <[email protected]>
  • Loading branch information
21 people authored Jun 14, 2024
1 parent 007d0b0 commit 888b94b
Show file tree
Hide file tree
Showing 344 changed files with 7,343 additions and 5,504 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:

jobs:
build-maven-pre-registration:
uses: mosip/kattu/.github/workflows/maven-build.yml@master
uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21
with:
SERVICE_LOCATION: ./pre-registration
BUILD_ARTIFACT: pre-registration
Expand All @@ -37,7 +37,7 @@ jobs:
publish_to_nexus:
if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' && github.event_name != 'release' && github.event_name != 'prerelease' && github.event_name != 'publish' }}"
needs: build-maven-pre-registration
uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master
uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master-java21
with:
SERVICE_LOCATION: ./pre-registration
secrets:
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
BUILD_ARTIFACT: 'pre-registration'
fail-fast: false
name: ${{ matrix.SERVICE_NAME }}
uses: mosip/kattu/.github/workflows/docker-build.yml@master
uses: mosip/kattu/.github/workflows/docker-build.yml@master-java21
with:
SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }}
SERVICE_NAME: ${{ matrix.SERVICE_NAME }}
Expand All @@ -81,7 +81,7 @@ jobs:
sonar_analysis:
needs: build-maven-pre-registration
if: "${{ github.event_name != 'pull_request' }}"
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21
with:
SERVICE_LOCATION: ./pre-registration
secrets:
Expand Down
2 changes: 1 addition & 1 deletion apitest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ ENV ENV_USER=
ENV ENV_ENDPOINT=
ENV ENV_TESTLEVEL=smokeAndRegression

ENTRYPOINT ["./entrypoint.sh"]
ENTRYPOINT ["./entrypoint.sh"]
2 changes: 1 addition & 1 deletion db_scripts/mosip_prereg/ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
\ir ddl/applicant_demographic_consumed.sql
\ir ddl/applicant_document.sql
\ir ddl/applicant_document_consumed.sql
\ir ddl/batch_job_instance.sql
\ir ddl/batch_job_execution.sql
\ir ddl/batch_job_execution_context.sql
\ir ddl/batch_job_execution_param.sql
\ir ddl/batch_job_instance.sql
\ir ddl/batch_step_execution.sql
\ir ddl/batch_step_execution_context.sql
\ir ddl/intf_processed_prereg_list.sql
Expand Down
6 changes: 3 additions & 3 deletions db_scripts/mosip_prereg/ddl/batch-fk.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ ALTER TABLE prereg.batch_step_execution_context ADD CONSTRAINT step_exec_ctx_fk
ON UPDATE NO ACTION
ON DELETE NO ACTION;

CREATE SEQUENCE prereg.batch_step_execution_seq;
CREATE SEQUENCE prereg.batch_job_execution_seq;
CREATE SEQUENCE prereg.batch_job_seq;
CREATE SEQUENCE prereg.batch_step_execution_seq MAXVALUE 9223372036854775807 NO CYCLE;
CREATE SEQUENCE prereg.batch_job_execution_seq MAXVALUE 9223372036854775807 NO CYCLE;
CREATE SEQUENCE prereg.batch_job_seq MAXVALUE 9223372036854775807 NO CYCLE;

-- grants to access all sequences
GRANT usage, SELECT ON ALL SEQUENCES
Expand Down
25 changes: 11 additions & 14 deletions db_scripts/mosip_prereg/ddl/batch_job_execution.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@

CREATE TABLE prereg.batch_job_execution
(
job_execution_id bigint NOT NULL,
version bigint,
job_instance_id bigint NOT NULL,
create_time timestamp without time zone NOT NULL,
start_time timestamp without time zone,
end_time timestamp without time zone,
status character varying(10) COLLATE pg_catalog."default",
exit_code character varying(2500) COLLATE pg_catalog."default",
exit_message character varying(2500) COLLATE pg_catalog."default",
last_updated timestamp without time zone,
job_configuration_location character varying(2500) COLLATE pg_catalog."default",
CONSTRAINT batch_job_execution_pkey PRIMARY KEY (job_execution_id)
JOB_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY ,
VERSION BIGINT ,
JOB_INSTANCE_ID BIGINT NOT NULL,
CREATE_TIME TIMESTAMP NOT NULL,
START_TIME TIMESTAMP DEFAULT NULL ,
END_TIME TIMESTAMP DEFAULT NULL ,
STATUS VARCHAR(10) ,
EXIT_CODE VARCHAR(2500) ,
EXIT_MESSAGE VARCHAR(2500) ,
LAST_UPDATED TIMESTAMP
)
WITH (
OIDS = FALSE
);

);
7 changes: 3 additions & 4 deletions db_scripts/mosip_prereg/ddl/batch_job_execution_context.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

CREATE TABLE prereg.batch_job_execution_context
(
job_execution_id bigint NOT NULL,
short_context character varying(2500) COLLATE pg_catalog."default" NOT NULL,
serialized_context text COLLATE pg_catalog."default",
CONSTRAINT batch_job_execution_context_pkey PRIMARY KEY (job_execution_id)
JOB_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,
SHORT_CONTEXT VARCHAR(2500) NOT NULL,
SERIALIZED_CONTEXT TEXT
)
WITH (
OIDS = FALSE
Expand Down
17 changes: 6 additions & 11 deletions db_scripts/mosip_prereg/ddl/batch_job_execution_param.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@

CREATE TABLE prereg.batch_job_execution_params
(
job_execution_id bigint NOT NULL,
type_cd character varying(6) COLLATE pg_catalog."default" NOT NULL,
key_name character varying(100) COLLATE pg_catalog."default" NOT NULL,
string_val character varying(250) COLLATE pg_catalog."default",
date_val timestamp without time zone,
long_val bigint,
double_val double precision,
identifying character(1) COLLATE pg_catalog."default" NOT NULL
JOB_EXECUTION_ID BIGINT NOT NULL ,
PARAMETER_NAME VARCHAR(100) NOT NULL ,
PARAMETER_TYPE VARCHAR(100) NOT NULL ,
PARAMETER_VALUE VARCHAR(2500) ,
IDENTIFYING CHAR(1) NOT NULL
)
WITH (
OIDS = FALSE
)
;

);
16 changes: 6 additions & 10 deletions db_scripts/mosip_prereg/ddl/batch_job_instance.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

CREATE TABLE prereg.batch_job_instance
(
job_instance_id bigint NOT NULL,
version bigint,
job_name character varying(100) COLLATE pg_catalog."default" NOT NULL,
job_key character varying(32) COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT batch_job_instance_pkey PRIMARY KEY (job_instance_id),
CONSTRAINT job_inst_un UNIQUE (job_name, job_key)
JOB_INSTANCE_ID BIGINT NOT NULL PRIMARY KEY ,
VERSION BIGINT ,
JOB_NAME VARCHAR(100) NOT NULL,
JOB_KEY VARCHAR(32) NOT NULL,
constraint JOB_INST_UN unique (JOB_NAME, JOB_KEY)
)
WITH (
OIDS = FALSE
)
;


);
40 changes: 20 additions & 20 deletions db_scripts/mosip_prereg/ddl/batch_step_execution.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

CREATE TABLE prereg.batch_step_execution
(
step_execution_id bigint NOT NULL,
version bigint NOT NULL,
step_name character varying(100) COLLATE pg_catalog."default" NOT NULL,
job_execution_id bigint NOT NULL,
start_time timestamp without time zone NOT NULL,
end_time timestamp without time zone,
status character varying(10) COLLATE pg_catalog."default",
commit_count bigint,
read_count bigint,
filter_count bigint,
write_count bigint,
read_skip_count bigint,
write_skip_count bigint,
process_skip_count bigint,
rollback_count bigint,
exit_code character varying(2500) COLLATE pg_catalog."default",
exit_message character varying(2500) COLLATE pg_catalog."default",
last_updated timestamp without time zone,
CONSTRAINT batch_step_execution_pkey PRIMARY KEY (step_execution_id)
STEP_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY ,
VERSION BIGINT NOT NULL,
STEP_NAME VARCHAR(100) NOT NULL,
JOB_EXECUTION_ID BIGINT NOT NULL,
CREATE_TIME TIMESTAMP NOT NULL,
START_TIME TIMESTAMP DEFAULT NULL ,
END_TIME TIMESTAMP DEFAULT NULL ,
STATUS VARCHAR(10) ,
COMMIT_COUNT BIGINT ,
READ_COUNT BIGINT ,
FILTER_COUNT BIGINT ,
WRITE_COUNT BIGINT ,
READ_SKIP_COUNT BIGINT ,
WRITE_SKIP_COUNT BIGINT ,
PROCESS_SKIP_COUNT BIGINT ,
ROLLBACK_COUNT BIGINT ,
EXIT_CODE VARCHAR(2500) ,
EXIT_MESSAGE VARCHAR(2500) ,
LAST_UPDATED TIMESTAMP
)
WITH (
OIDS = FALSE
);
);
10 changes: 4 additions & 6 deletions db_scripts/mosip_prereg/ddl/batch_step_execution_context.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

CREATE TABLE prereg.batch_step_execution_context
(
step_execution_id bigint NOT NULL,
short_context character varying(2500) COLLATE pg_catalog."default" NOT NULL,
serialized_context text COLLATE pg_catalog."default",
CONSTRAINT batch_step_execution_context_pkey PRIMARY KEY (step_execution_id)

STEP_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY,
SHORT_CONTEXT VARCHAR(2500) NOT NULL,
SERIALIZED_CONTEXT TEXT
)
WITH (
OIDS = FALSE
);
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
\c mosip_prereg

REASSIGN OWNED BY postgres TO sysadmin;

GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA prereg TO sysadmin;

DROP TABLE IF EXISTS prereg.applications;
DROP TABLE IF EXISTS prereg.anonymous_profile;

ALTER TABLE prereg.reg_appointment ADD CONSTRAINT fk_rappmnt_id FOREIGN KEY (prereg_id)
REFERENCES prereg.applicant_demographic(prereg_id) MATCH SIMPLE
ON DELETE NO ACTION ON UPDATE NO ACTION;
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
\c mosip_prereg

REASSIGN OWNED BY sysadmin TO postgres;

REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA prereg FROM prereguser;

REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA prereg FROM sysadmin;

GRANT SELECT, INSERT, TRUNCATE, REFERENCES, UPDATE, DELETE ON ALL TABLES IN SCHEMA prereg TO prereguser;

GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA prereg TO postgres;

CREATE TABLE IF NOT EXISTS prereg.applications(
application_id character varying(36) NOT NULL,
booking_type character varying(256) NOT NULL,
booking_status_code character varying(256),
application_status_code character varying(256),
regcntr_id character varying(10),
appointment_date date,
booking_date date,
slot_from_time time without time zone,
slot_to_time time without time zone,
contact_info character varying(256),
cr_by character varying(256) NOT NULL,
cr_dtimes timestamp without time zone NOT NULL,
upd_by character varying(256),
upd_dtimes timestamp without time zone,
CONSTRAINT appid_pk PRIMARY KEY (application_id)
);

GRANT SELECT,INSERT,UPDATE,DELETE,REFERENCES ON prereg.applications TO prereguser;

CREATE TABLE IF NOT EXISTS prereg.anonymous_profile
(
id character varying(36) NOT NULL,
profile character varying NOT NULL,
cr_by character varying(256) NOT NULL,
cr_dtimes timestamp without time zone NOT NULL,
upd_by character varying(256),
upd_dtimes timestamp without time zone,
is_deleted boolean,
del_dtimes timestamp without time zone,
CONSTRAINT anonymous_profile_pkey PRIMARY KEY (id)
);

GRANT SELECT,INSERT,UPDATE,DELETE,REFERENCES ON prereg.anonymous_profile TO prereguser;

ALTER TABLE prereg.reg_appointment DROP CONSTRAINT IF EXISTS fk_rappmnt_id CASCADE;

CREATE INDEX IF NOT EXISTS idx_app_demo_cr_by ON prereg.applicant_demographic USING btree (cr_by COLLATE pg_catalog."default" ASC NULLS LAST) TABLESPACE pg_default;
CREATE INDEX IF NOT EXISTS idx_app_demo_prid ON prereg.applicant_demographic USING btree (prereg_id COLLATE pg_catalog."default" ASC NULLS LAST) TABLESPACE pg_default;

ALTER TABLE prereg.prid_seq RENAME TO prid_seq_to_be_deleted;
ALTER TABLE prereg.transaction_type RENAME TO transaction_type_to_be_deleted;
ALTER TABLE prereg.language_transliteration RENAME TO language_transliteration_to_be_deleted;
ALTER TABLE prereg.prid_seed RENAME TO prid_seed_to_be_deleted;
ALTER TABLE prereg.pre_registration_transaction RENAME TO pre_registration_transaction_to_be_deleted;
ALTER TABLE prereg.processed_prereg_list DROP CONSTRAINT IF EXISTS pprlst_pregtrn_fk CASCADE;

INSERT INTO prereg.applications(application_id, booking_type, booking_status_code, regcntr_id, appointment_date, booking_date,
slot_from_time, slot_to_time, contact_info, cr_by, cr_dtimes, upd_by, upd_dtimes, application_status_code)
Select t1.prereg_id, 'NEW_PREREGISTRATION', t1.status_code, t2.regcntr_id, t2.appointment_date,
t2.booking_dtimes, t2.slot_from_time, t2.slot_to_time, t1.cr_appuser_id, t1.cr_by, t1.cr_dtimes, t1.upd_by, t1.upd_dtimes,
Case When t1.status_code='Application_Incomplete' THEN 'DRAFT' Else 'SUBMITTED' End
From prereg.applicant_demographic t1
LEFT Join prereg.reg_appointment t2 On t1.prereg_id=t2.prereg_id;

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION'
22 changes: 22 additions & 0 deletions db_upgrade_scripts/mosip_prereg/sql/1.2.0.1_to_1_revoke.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- ------------------------------------------------------------------------------------------
-- Revoke script for Migrating Spring batch version to 5.0 as part of Java 21 Migration.
-- References:
-- 1. https://github.com/spring-projects/spring-batch/wiki/Spring-Batch-5.0-Migration-Guide#ms-sqlserver
-- 2. https://github.com/spring-projects/spring-batch/blob/main/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/5.0/migration-postgresql.sql
-- ------------------------------------------------------------------------------------------
ALTER TABLE BATCH_STEP_EXECUTION DROP CREATE_TIME TIMESTAMP NOT NULL DEFAULT '1970-01-01 00:00:00';
ALTER TABLE BATCH_STEP_EXECUTION ALTER COLUMN START_TIME ADD NULL;
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ADD COLUMN DATE_VAL;
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ADD COLUMN LONG_VAL;
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ADD COLUMN DOUBLE_VAL;
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN TYPE_CD TYPE VARCHAR(6);
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME PARAMETER_TYPE TO TYPE_CD;
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN KEY_NAME TYPE VARCHAR(100);
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME PARAMETER_NAME TO KEY_NAME;
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN STRING_VAL TYPE VARCHAR(250);
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME PARAMETER_VALUE TO STRING_VAL;
ALTER TABLE BATCH_JOB_EXECUTION ADD COLUMN JOB_CONFIGURATION_LOCATION;

DROP SEQUENCE BATCH_STEP_EXECUTION_SEQ;
DROP SEQUENCE BATCH_JOB_EXECUTION_SEQ;
DROP SEQUENCE BATCH_JOB_SEQ;
22 changes: 22 additions & 0 deletions db_upgrade_scripts/mosip_prereg/sql/1.2.0.1_to_1_upgrade.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- ------------------------------------------------------------------------------------------
-- Upgrade script for Migrating Spring batch version to 5.0 as part of Java 21 Migration.
-- References:
-- 1. https://github.com/spring-projects/spring-batch/wiki/Spring-Batch-5.0-Migration-Guide#ms-sqlserver
-- 2. https://github.com/spring-projects/spring-batch/blob/main/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/5.0/migration-postgresql.sql
-- ------------------------------------------------------------------------------------------
ALTER TABLE BATCH_STEP_EXECUTION ADD CREATE_TIME TIMESTAMP NOT NULL DEFAULT '1970-01-01 00:00:00';
ALTER TABLE BATCH_STEP_EXECUTION ALTER COLUMN START_TIME DROP NOT NULL;
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS DROP COLUMN DATE_VAL;
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS DROP COLUMN LONG_VAL;
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS DROP COLUMN DOUBLE_VAL;
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN TYPE_CD TYPE VARCHAR(100);
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME TYPE_CD TO PARAMETER_TYPE;
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN KEY_NAME TYPE VARCHAR(100);
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME KEY_NAME TO PARAMETER_NAME;
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN STRING_VAL TYPE VARCHAR(2500);
ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME STRING_VAL TO PARAMETER_VALUE;
ALTER TABLE BATCH_JOB_EXECUTION DROP COLUMN JOB_CONFIGURATION_LOCATION;

CREATE SEQUENCE BATCH_STEP_EXECUTION_SEQ START WITH 0 MINVALUE 0 MAXVALUE 9223372036854775807 NO CYCLE;
CREATE SEQUENCE BATCH_JOB_EXECUTION_SEQ START WITH 0 MINVALUE 0 MAXVALUE 9223372036854775807 NO CYCLE;
CREATE SEQUENCE BATCH_JOB_SEQ START WITH 0 MINVALUE 0 MAXVALUE 9223372036854775807 NO CYCLE;
12 changes: 12 additions & 0 deletions db_upgrade_scripts/mosip_prereg/upgrade.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
MOSIP_DB_NAME=
DB_SERVERIP=
DB_PORT=
SU_USER=postgres
SU_USER_PWD=
SYS_ADMIN_USER=
SYS_ADMIN_PWD=
DEFAULT_DB_NAME=postgres
DBUSER_PWD=
ACTION=
CURRENT_VERSION=
UPGRADE_VERSION=
Loading

0 comments on commit 888b94b

Please sign in to comment.