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

PIM-1847: Create User Settings View - Database #164

Conversation

vivid-esnauffer
Copy link
Collaborator

No description provided.


ALTER TABLE cuws.user_setting ADD CONSTRAINT fk_us_of
FOREIGN KEY (office_id)
REFERENCES cuws.office(office_id) ON DELETE RESTRICT ON UPDATE RESTRICT
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ON DELETE RESTRICT ON UPDATE RESTRICT is not necessary. There are some triggers set in ER/Studio

;

CREATE INDEX ix_us_lug ON cuws.user_setting(login_user_guid)
TABLESPACE pg_default
Copy link
Collaborator

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

CREATE INDEX ix_us_lug ON cuws.user_setting(login_user_guid)
TABLESPACE pg_default
;
CREATE INDEX ix_us_psip ON cuws.user_setting(policy_search_insurance_plan_id)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually call the foreign key index the same as the foreign key besides the prefix (fk_ vs ix_)
So for these two it would be ix_us_ip and ix_us_of

@vivid-esnauffer vivid-esnauffer merged commit d95a6ef into feature/3.7.0 Jan 6, 2025
@vivid-esnauffer vivid-esnauffer deleted the feature/PIM-1847-Create-User-Settings-View-Database branch January 6, 2025 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants