Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-35798,MOSIP-32162 #1089

Merged
merged 5 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion db_scripts/mosip_idrepo/ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
\ir ddl/idrepo-anonymous_profile.sql
\ir ddl/idrepo-channel_info.sql
\ir ddl/idrepo-identity_update_count_tracker.sql
\ir ddl/idrepo-handle.sql
\ir ddl/idrepo-handle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ CREATE TABLE idrepo.credential_request_status (

);
-- ddl-end --

--index section starts----
CREATE INDEX IF NOT EXISTS idx_cred_req_NEW_status_cr_dtimes ON idrepo.credential_request_status USING btree(cr_dtimes) WHERE status = 'NEW';
CREATE INDEX IF NOT EXISTS idx_cred_tran_status ON idrepo.credential_request_status USING btree(status);
--index section ends------
2 changes: 1 addition & 1 deletion db_scripts/mosip_idrepo/ddl/idrepo-fk.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ ON DELETE NO ACTION ON UPDATE NO ACTION;
ALTER TABLE idrepo.uin_biometric ADD CONSTRAINT fk_uinb_uin FOREIGN KEY (uin_ref_id)
REFERENCES idrepo.uin (uin_ref_id) MATCH SIMPLE
ON DELETE NO ACTION ON UPDATE NO ACTION;
-- ddl-end --
-- ddl-end --
6 changes: 6 additions & 0 deletions db_scripts/mosip_idrepo/ddl/idrepo-handle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ CREATE TABLE idrepo.handle(
CONSTRAINT uk_handle UNIQUE (handle_hash)
);
-- ddl-end --

--index section starts----
CREATE INDEX IF NOT EXISTS idx_handle_handle_hash ON idrepo.handle USING btree(handle_hash);
CREATE INDEX IF NOT EXISTS idx_handle_uin_hash ON idrepo.handle USING btree(uin_hash);
--index section ends------

COMMENT ON TABLE idrepo.handle IS 'Handle and handle hash mapped to UIN.';
-- ddl-end --
COMMENT ON COLUMN idrepo.handle.id IS 'ID: System generated UUID';
Expand Down
5 changes: 5 additions & 0 deletions db_scripts/mosip_idrepo/ddl/idrepo-uin.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ CREATE TABLE idrepo.uin(

);
-- ddl-end --

--index section starts----
CREATE INDEX IF NOT EXISTS idx_uin_uin_hash ON idrepo.uin USING btree(uin_hash);
--index section ends------

COMMENT ON TABLE idrepo.uin IS 'UIN: Information related to an individual (demographic, biometric, and uploaded documents) are stored. The information is stored in JSON format. A hash value of the JSON file is also maintained as a separate column as an added security to prevent data tampering.';
-- ddl-end --
COMMENT ON COLUMN idrepo.uin.uin_ref_id IS 'UIN Reference ID: System generated id mapped to a UIN used for references in the system. UIN reference ID is also used as folder/bucket in DFS (HDFS/CEPH) to store documents and biometric CBEFF file.';
Expand Down
4 changes: 4 additions & 0 deletions db_scripts/mosip_idrepo/ddl/idrepo-uin_draft.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ CREATE TABLE idrepo.uin_draft(
);
-- ddl-end --

--index section starts----
CREATE INDEX IF NOT EXISTS idx_uin_draft_reg_id ON idrepo.uin_draft USING btree(reg_id);
--index section ends------

5 changes: 5 additions & 0 deletions db_scripts/mosip_idrepo/ddl/idrepo-uin_h.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ CREATE TABLE idrepo.uin_h(

);
-- ddl-end --

--index section starts----
CREATE INDEX IF NOT EXISTS idx_uin_h_reg_id ON idrepo.uin_h USING btree(reg_id);
--index section ends------

COMMENT ON TABLE idrepo.uin_h IS 'UIN History : This to track changes to base table record whenever there is an INSERT/UPDATE/DELETE ( soft delete ), Effective DateTimestamp is used for identifying latest or point in time information. Refer base table description for details. ';
-- ddl-end --
COMMENT ON COLUMN idrepo.uin_h.uin_ref_id IS 'UIN Reference ID: System generated id mapped to a UIN used for references in the system. UIN reference ID is also used as folder/bucket in DFS (HDFS/CEPH) to store documents and biometric CBEFF file.';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--INDEX
DROP INDEX IF EXISTS idx_uin_uin_hash ON idrepo.uin;
DROP INDEX IF EXISTS idx_uin_draft_reg_id ON idrepo.uin_draft;
DROP INDEX IF EXISTS idx_uin_h_reg_id ON idrepo.uin_h;
DROP INDEX IF EXISTS idx_handle_handle_hash ON idrepo.handle;
DROP INDEX IF EXISTS idx_handle_uin_hash ON idrepo.handle;
DROP INDEX IF EXISTS idx_cred_req_NEW_status_cr_dtimes ON idrepo.credential_request_status;
DROP INDEX IF EXISTS idx_cred_tran_status ON idrepo.credential_request_status;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

--INDEX
CREATE INDEX IF NOT EXISTS idx_uin_uin_hash ON idrepo.uin USING btree(uin_hash);
CREATE INDEX IF NOT EXISTS idx_uin_draft_reg_id ON idrepo.uin_draft USING btree(reg_id);
CREATE INDEX IF NOT EXISTS idx_uin_h_reg_id ON idrepo.uin_h USING btree(reg_id);
CREATE INDEX IF NOT EXISTS idx_handle_handle_hash ON idrepo.handle USING btree(handle_hash);
CREATE INDEX IF NOT EXISTS idx_handle_uin_hash ON idrepo.handle USING btree(uin_hash);
CREATE INDEX IF NOT EXISTS idx_cred_req_NEW_status_cr_dtimes ON idrepo.credential_request_status USING btree(cr_dtimes) WHERE status = 'NEW';
CREATE INDEX IF NOT EXISTS idx_cred_tran_status ON idrepo.credential_request_status USING btree(status);
Loading