-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MOSIP-32453 : Added upgrade and rollback scripts for spring batch jav…
…a migration (#1073) * Added upgrade and rollback scripts for spring batch java migration Signed-off-by: GOKULRAJ136 <110164849+GOKULRAJ136@users.noreply.github.com> * Added cleanup.sql and taken a backup before deleting other lang data Signed-off-by: GOKULRAJ136 <110164849+GOKULRAJ136@users.noreply.github.com> --------- Signed-off-by: GOKULRAJ136 <110164849+GOKULRAJ136@users.noreply.github.com>
- Loading branch information
1 parent
2435755
commit 35ba58e
Showing
5 changed files
with
96 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
DELETE FROM master.template_file_format | ||
WHERE lang_code !='eng'; | ||
|
||
DELETE FROM master.authentication_method | ||
WHERE lang_code !='eng'; | ||
|
||
DELETE FROM master.app_detail | ||
WHERE lang_code !='eng'; | ||
|
||
DELETE FROM master.biometric_type | ||
WHERE lang_code !='eng'; | ||
|
||
DELETE FROM master.biometric_attribute | ||
WHERE lang_code !='eng'; | ||
|
||
DELETE FROM master.module_detail | ||
WHERE lang_code !='eng'; | ||
|
||
|
||
drop table master.admin_param; | ||
drop table master.appl_form_type; | ||
drop table master.message_list; | ||
drop table master.doc_format; | ||
drop table master.gender; | ||
drop table master.global_param; | ||
drop table master.id_type; | ||
drop table master.individual_type; | ||
drop table master.introducer_type; | ||
drop table master.status_list; | ||
drop table master.status_type; |
24 changes: 1 addition & 23 deletions
24
db_upgrade_scripts/mosip_master/sql/1.2.0.1_to_1.2.1.0_rollback.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1 @@ | ||
-- Rollback script for master.app_detail | ||
ALTER TABLE master.app_detail ALTER COLUMN lang_code SET NOT NULL; | ||
ALTER TABLE master.app_detail DROP CONSTRAINT pk_appdtl_id; | ||
ALTER TABLE master.app_detail ADD CONSTRAINT pk_appdtl_id PRIMARY KEY (id, lang_code); | ||
|
||
-- Rollback script for master.biometric_attribute | ||
ALTER TABLE master.biometric_attribute ALTER COLUMN lang_code SET NOT NULL; | ||
ALTER TABLE master.biometric_attribute DROP CONSTRAINT pk_bmattr_code; | ||
ALTER TABLE master.biometric_attribute ADD CONSTRAINT pk_bmattr_code PRIMARY KEY (code, lang_code); | ||
|
||
-- Rollback script for master.module_detail | ||
ALTER TABLE master.module_detail ALTER COLUMN lang_code SET NOT NULL; | ||
ALTER TABLE master.module_detail DROP CONSTRAINT pk_moddtl_code; | ||
ALTER TABLE master.module_detail ADD CONSTRAINT pk_moddtl_code PRIMARY KEY (id, lang_code); | ||
|
||
-- Rollback script for master.template_file_format | ||
ALTER TABLE master.template DROP CONSTRAINT IF EXISTS fk_tmplt_tffmt CASCADE; | ||
ALTER TABLE master.template_file_format ALTER COLUMN lang_code SET NOT NULL; | ||
ALTER TABLE master.template_file_format DROP CONSTRAINT pk_tffmt_code; | ||
ALTER TABLE master.template_file_format ADD CONSTRAINT pk_tffmt_code PRIMARY KEY (code, lang_code); | ||
|
||
-- Rollback script for master.template | ||
ALTER TABLE master.template ADD CONSTRAINT fk_tmplt_tffmt FOREIGN KEY (file_format_code, lang_code) REFERENCES master.template_file_format (code, lang_code); | ||
\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' |
24 changes: 1 addition & 23 deletions
24
db_upgrade_scripts/mosip_master/sql/1.2.0.1_to_1.2.1.0_upgrade.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1 @@ | ||
-- Upgrade script for master.app_detail | ||
ALTER TABLE master.app_detail DROP CONSTRAINT IF EXISTS pk_appdtl_id CASCADE; | ||
ALTER TABLE master.app_detail ALTER COLUMN lang_code DROP NOT NULL; | ||
ALTER TABLE master.app_detail ADD CONSTRAINT pk_appdtl_id PRIMARY KEY (id); | ||
|
||
-- Upgrade script for master.biometric_attribute | ||
ALTER TABLE master.biometric_attribute DROP CONSTRAINT IF EXISTS pk_bmattr_code CASCADE; | ||
ALTER TABLE master.biometric_attribute ALTER COLUMN lang_code DROP NOT NULL; | ||
ALTER TABLE master.biometric_attribute ADD CONSTRAINT pk_bmattr_code PRIMARY KEY (code); | ||
|
||
-- Upgrade script for master.module_detail | ||
ALTER TABLE master.module_detail DROP CONSTRAINT IF EXISTS pk_moddtl_code CASCADE; | ||
ALTER TABLE master.module_detail ALTER COLUMN lang_code DROP NOT NULL; | ||
ALTER TABLE master.module_detail ADD CONSTRAINT pk_moddtl_code PRIMARY KEY (id); | ||
|
||
-- Upgrade script for master.template_file_format | ||
ALTER TABLE master.template DROP CONSTRAINT IF EXISTS fk_tmplt_tffmt CASCADE; | ||
ALTER TABLE master.template_file_format DROP CONSTRAINT IF EXISTS pk_tffmt_code CASCADE; | ||
ALTER TABLE master.template_file_format ALTER COLUMN lang_code DROP NOT NULL; | ||
ALTER TABLE master.template_file_format ADD CONSTRAINT pk_tffmt_code PRIMARY KEY (code); | ||
|
||
-- Upgrade script for master.template | ||
ALTER TABLE master.template ADD CONSTRAINT fk_tmplt_tffmt FOREIGN KEY (file_format_code) REFERENCES master.template_file_format (code); | ||
\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' |
32 changes: 32 additions & 0 deletions
32
db_upgrade_scripts/mosip_master/sql/1.2.1.0_to_1.3.0_rollback.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
db_upgrade_scripts/mosip_master/sql/1.2.1.0_to_1.3.0_upgrade.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters