-
Notifications
You must be signed in to change notification settings - Fork 1
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
PIM-1847: Create User Settings View - Database #164
Merged
vivid-esnauffer
merged 6 commits into
feature/3.7.0
from
feature/PIM-1847-Create-User-Settings-View-Database
Jan 6, 2025
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b223b66
PIM-1847: Create User Settings View - Database
vivid-esnauffer 6e24954
PIM-1847: Added comment on table
vivid-esnauffer e706589
PIM-1847: Create User Settings View - Database - updates from tech re…
vivid-esnauffer fbc01a2
PIM-1847: Create User Settings View - Database - renamed indices
vivid-esnauffer 2a0eacf
Fixed the table comment and the create/update user timestamp
vivid-esnauffer b679040
PIM-1847: Allowed nulls for crop_year, plan, and office
vivid-esnauffer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions
1
...-underwriting-liquibase/scripts/03_00_xx/03_07_00/00/ddl/grants/cuws.ddl.apply_grants.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,6 +1,7 @@ | ||
|
||
--Grant CRUD access to proxy role | ||
GRANT SELECT, INSERT, UPDATE, DELETE ON cuws.verified_yield_grain_basket TO "app_cuws_rest_proxy"; | ||
GRANT SELECT, INSERT, UPDATE, DELETE ON cuws.user_setting TO "app_cuws_rest_proxy"; | ||
|
||
--Grant read only access to all tables for the readonly role | ||
GRANT SELECT ON ALL TABLES IN SCHEMA cuws TO "app_cuws_readonly"; |
73 changes: 73 additions & 0 deletions
73
...derwriting-liquibase/scripts/03_00_xx/03_07_00/00/ddl/tables/cuws.create.user_setting.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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
\qecho Create user_setting table | ||
CREATE TABLE cuws.user_setting( | ||
underwriting_user_guid varchar(32) NOT NULL, | ||
login_user_guid varchar(32) NOT NULL, | ||
login_user_id varchar(64) NOT NULL, | ||
login_user_type varchar(64) NOT NULL, | ||
given_name varchar(50), | ||
family_name varchar(50), | ||
policy_search_crop_year numeric(4, 0) NOT NULL, | ||
policy_search_insurance_plan_id numeric(9, 0) NOT NULL, | ||
policy_search_office_id numeric(9, 0) NOT NULL, | ||
create_user varchar(64) NOT NULL, | ||
create_date timestamp(0) NOT NULL, | ||
update_user varchar(64) NOT NULL, | ||
update_date timestamp(0) NOT NULL | ||
) TABLESPACE pg_default | ||
; | ||
|
||
COMMENT ON COLUMN cuws.user_setting.underwriting_user_guid IS 'Underwriting User Guid is a unique key of an underwriting user ' | ||
; | ||
COMMENT ON COLUMN cuws.user_setting.login_user_guid IS 'Login User Guid is a unique key from the authentication for a user.' | ||
; | ||
COMMENT ON COLUMN cuws.user_setting.login_user_id IS 'Login User Id is the user id from the authentication for a user ' | ||
; | ||
COMMENT ON COLUMN cuws.user_setting.login_user_type IS 'Login User Type is the user type from the authentication for a user ' | ||
; | ||
COMMENT ON COLUMN cuws.user_setting.given_name IS 'Given Name is the given name from the authentication for a user ' | ||
; | ||
COMMENT ON COLUMN cuws.user_setting.family_name IS 'Family Name is the family name from the authentication for a user ' | ||
; | ||
COMMENT ON COLUMN cuws.user_setting.policy_search_crop_year IS 'Policy Search Crop Year is the user''s preferred crop year to search for on the policy screen' | ||
; | ||
COMMENT ON COLUMN cuws.user_setting.policy_search_insurance_plan_id IS 'Policy Search Insurance Plan Id is the user''s preferred insurance plan to search for on the policy screen.' | ||
; | ||
COMMENT ON COLUMN cuws.user_setting.policy_search_office_id IS 'Policy Search Office Id is the user''s preferred office to search for on the policy screen.' | ||
; | ||
COMMENT ON COLUMN cuws.user_setting.create_user IS 'Create User is the user id of the user that created the record ' | ||
; | ||
COMMENT ON COLUMN cuws.user_setting.create_date IS 'Create Date is the date when the record was created ' | ||
; | ||
COMMENT ON COLUMN cuws.user_setting.update_user IS 'Update User is the user id of the user that updated the record last' | ||
; | ||
COMMENT ON COLUMN cuws.user_setting.update_date IS 'Update Date is the date when the record was updated last ' | ||
; | ||
COMMENT ON TABLE cuws.user_setting IS 'The table contains user''s preferred settings for search ' | ||
; | ||
|
||
CREATE INDEX ix_us_lug ON cuws.user_setting(login_user_guid) | ||
TABLESPACE pg_default | ||
; | ||
CREATE INDEX ix_us_ip ON cuws.user_setting(policy_search_insurance_plan_id) | ||
TABLESPACE pg_default | ||
; | ||
CREATE INDEX ix_us_of ON cuws.user_setting(policy_search_office_id) | ||
TABLESPACE pg_default | ||
; | ||
ALTER TABLE cuws.user_setting ADD | ||
CONSTRAINT pk_us PRIMARY KEY (underwriting_user_guid) USING INDEX TABLESPACE pg_default | ||
; | ||
|
||
ALTER TABLE cuws.user_setting ADD | ||
CONSTRAINT uk_us UNIQUE (login_user_guid) USING INDEX TABLESPACE pg_default | ||
; | ||
|
||
ALTER TABLE cuws.user_setting ADD CONSTRAINT fk_us_ip | ||
FOREIGN KEY (policy_search_insurance_plan_id) | ||
REFERENCES cuws.insurance_plan(insurance_plan_id) | ||
; | ||
|
||
ALTER TABLE cuws.user_setting ADD CONSTRAINT fk_us_of | ||
FOREIGN KEY (policy_search_office_id) | ||
REFERENCES cuws.office(office_id) | ||
; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indexes for foreign keys insurance plan and office are missing