From 621a3c888c53a7973122ba114e5b55417dc51bfb Mon Sep 17 00:00:00 2001 From: dhanendra06 Date: Sun, 22 Sep 2024 23:01:59 +0530 Subject: [PATCH 1/2] MOSIP-35798 Signed-off-by: dhanendra06 --- db_scripts/mosip_kernel/ddl/kernel-uin.sql | 6 ++++++ .../mosip_kernel/sql/1.2.0.1_to_1.3.0_rollback.sql | 4 +++- .../mosip_kernel/sql/1.2.0.1_to_1.3.0_upgrade.sql | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/db_scripts/mosip_kernel/ddl/kernel-uin.sql b/db_scripts/mosip_kernel/ddl/kernel-uin.sql index 58db188f49d..ae5bf1346d6 100644 --- a/db_scripts/mosip_kernel/ddl/kernel-uin.sql +++ b/db_scripts/mosip_kernel/ddl/kernel-uin.sql @@ -15,6 +15,12 @@ CREATE TABLE kernel.uin( ); -- ddl-end -- + +--index section starts---- +CREATE INDEX IF NOT EXISTS uin_status ON kernel.uin using btree(uin_status) where uin_status='UNUSED'; +CREATE INDEX IF NOT EXISTS uin_uin ON kernel.uin using btree(uin); +--index section ends------ + COMMENT ON TABLE kernel.uin IS 'UIN: Stores pre-generated UINs that are assigned to an individual as part of registration process.'; -- ddl-end -- COMMENT ON COLUMN kernel.uin.uin IS 'UIN: Pre-generated UINs (Unique Identification Number), which will be used to assign to an individual'; diff --git a/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_rollback.sql b/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_rollback.sql index 381e2be11c1..e6c8ed56ea9 100644 --- a/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_rollback.sql +++ b/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_rollback.sql @@ -1 +1,3 @@ -\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' \ No newline at end of file +--#INDEX-- +DROP INDEX IF EXISTS uin_status ON kernel.uin; +DROP INDEX IF EXISTS uin_uin ON kernel.uin; \ No newline at end of file diff --git a/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_upgrade.sql b/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_upgrade.sql index 381e2be11c1..f20a2945aa0 100644 --- a/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_upgrade.sql +++ b/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_upgrade.sql @@ -1 +1,3 @@ -\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' \ No newline at end of file +--#INDEX-- +CREATE INDEX IF NOT EXISTS uin_status ON kernel.uin using btree(uin_status) where uin_status='UNUSED'; +CREATE INDEX IF NOT EXISTS uin_uin ON kernel.uin using btree(uin); \ No newline at end of file From 574909456c0f6506db1b9d498399148f49f136bc Mon Sep 17 00:00:00 2001 From: dhanendra06 Date: Tue, 24 Sep 2024 12:50:26 +0530 Subject: [PATCH 2/2] updated the pr based on review comments Signed-off-by: dhanendra06 --- db_scripts/mosip_kernel/ddl/kernel-uin.sql | 4 ++-- .../mosip_kernel/sql/1.2.0.1_to_1.3.0_rollback.sql | 4 ++-- .../mosip_kernel/sql/1.2.0.1_to_1.3.0_upgrade.sql | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/db_scripts/mosip_kernel/ddl/kernel-uin.sql b/db_scripts/mosip_kernel/ddl/kernel-uin.sql index ae5bf1346d6..7a9f83ec80b 100644 --- a/db_scripts/mosip_kernel/ddl/kernel-uin.sql +++ b/db_scripts/mosip_kernel/ddl/kernel-uin.sql @@ -17,8 +17,8 @@ CREATE TABLE kernel.uin( -- ddl-end -- --index section starts---- -CREATE INDEX IF NOT EXISTS uin_status ON kernel.uin using btree(uin_status) where uin_status='UNUSED'; -CREATE INDEX IF NOT EXISTS uin_uin ON kernel.uin using btree(uin); +CREATE INDEX IF NOT EXISTS idx_uin_status ON kernel.uin using btree(uin_status) where uin_status='UNUSED'; +CREATE INDEX IF NOT EXISTS idx_uin_uin ON kernel.uin using btree(uin); --index section ends------ COMMENT ON TABLE kernel.uin IS 'UIN: Stores pre-generated UINs that are assigned to an individual as part of registration process.'; diff --git a/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_rollback.sql b/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_rollback.sql index e6c8ed56ea9..22e61fb2f2d 100644 --- a/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_rollback.sql +++ b/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_rollback.sql @@ -1,3 +1,3 @@ --#INDEX-- -DROP INDEX IF EXISTS uin_status ON kernel.uin; -DROP INDEX IF EXISTS uin_uin ON kernel.uin; \ No newline at end of file +DROP INDEX IF EXISTS idx_uin_status ON kernel.uin; +DROP INDEX IF EXISTS idx_uin_uin ON kernel.uin; \ No newline at end of file diff --git a/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_upgrade.sql b/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_upgrade.sql index f20a2945aa0..6879f27d7bb 100644 --- a/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_upgrade.sql +++ b/db_upgrade_scripts/mosip_kernel/sql/1.2.0.1_to_1.3.0_upgrade.sql @@ -1,3 +1,3 @@ --#INDEX-- -CREATE INDEX IF NOT EXISTS uin_status ON kernel.uin using btree(uin_status) where uin_status='UNUSED'; -CREATE INDEX IF NOT EXISTS uin_uin ON kernel.uin using btree(uin); \ No newline at end of file +CREATE INDEX IF NOT EXISTS idx_uin_status ON kernel.uin using btree(uin_status) where uin_status='UNUSED'; +CREATE INDEX IF NOT EXISTS idx_uin_uin ON kernel.uin using btree(uin); \ No newline at end of file