-
Notifications
You must be signed in to change notification settings - Fork 27
Added evolution file to apply foreign key constraints to database #3692
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
Open
Jetpackjules
wants to merge
4
commits into
develop
Choose a base branch
from
3574-missing-foreign-key-constraints
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 hidden or 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,129 @@ | ||
| # --- !Ups | ||
|
|
||
| ALTER TABLE audit_task | ||
| ADD CONSTRAINT fk_audit_task_amt_assignment | ||
| FOREIGN KEY (amt_assignment_id) REFERENCES amt_assignment(amt_assignment_id); | ||
|
|
||
| ALTER TABLE audit_task_comment | ||
| ADD CONSTRAINT fk_audit_task_comment_user | ||
| FOREIGN KEY (user_id) REFERENCES sidewalk_user(user_id); | ||
|
|
||
| ALTER TABLE audit_task_incomplete | ||
| ADD CONSTRAINT fk_audit_task_incomplete_audit_task | ||
| FOREIGN KEY (audit_task_id) REFERENCES audit_task(audit_task_id); | ||
|
|
||
| ALTER TABLE audit_task_interaction | ||
| ADD CONSTRAINT fk_audit_task_interaction_small | ||
| FOREIGN KEY (audit_task_interaction_id) REFERENCES audit_task_interaction_small(audit_task_interaction_id); | ||
|
|
||
| ALTER TABLE audit_task_interaction | ||
| ADD CONSTRAINT fk_audit_task_interaction_gsv_data | ||
| FOREIGN KEY (gsv_panorama_id) REFERENCES gsv_data(gsv_panorama_id); | ||
|
|
||
| ALTER TABLE global_attribute | ||
| ADD CONSTRAINT fk_global_attribute_street_edge | ||
| FOREIGN KEY (street_edge_id) REFERENCES street_edge(street_edge_id); | ||
|
|
||
| ALTER TABLE gsv_data | ||
| ADD CONSTRAINT fk_gsv_data_gsv_link | ||
| FOREIGN KEY (gsv_panorama_id) REFERENCES gsv_link(gsv_panorama_id); | ||
|
|
||
| ALTER TABLE label | ||
| ADD CONSTRAINT fk_label_gsv_data | ||
| FOREIGN KEY (gsv_panorama_id) REFERENCES gsv_data(gsv_panorama_id); | ||
|
|
||
| ALTER TABLE label | ||
| ADD CONSTRAINT fk_label_street_edge | ||
| FOREIGN KEY (street_edge_id) REFERENCES street_edge(street_edge_id); | ||
|
|
||
| ALTER TABLE label | ||
| ADD CONSTRAINT fk_label_user | ||
| FOREIGN KEY (user_id) REFERENCES sidewalk_user(user_id); | ||
|
|
||
| ALTER TABLE label_point | ||
| ADD CONSTRAINT fk_label_point_label | ||
| FOREIGN KEY (label_id) REFERENCES label(label_id); | ||
|
|
||
| ALTER TABLE region_completion | ||
| ADD CONSTRAINT fk_region_completion_region | ||
| FOREIGN KEY (region_id) REFERENCES region(region_id); | ||
|
|
||
| ALTER TABLE street_edge_issue | ||
| ADD CONSTRAINT fk_street_edge_issue_street_edge | ||
| FOREIGN KEY (street_edge_id) REFERENCES street_edge(street_edge_id); | ||
|
|
||
| ALTER TABLE street_edge_issue | ||
| ADD CONSTRAINT fk_street_edge_issue_user | ||
| FOREIGN KEY (user_id) REFERENCES sidewalk_user(user_id); | ||
|
|
||
| ALTER TABLE street_edge_region | ||
| ADD CONSTRAINT fk_street_edge_region_region | ||
| FOREIGN KEY (region_id) REFERENCES region(region_id); | ||
|
|
||
| ALTER TABLE street_edge_region | ||
| ADD CONSTRAINT fk_street_edge_region_street_edge | ||
| FOREIGN KEY (street_edge_id) REFERENCES street_edge(street_edge_id); | ||
|
|
||
| ALTER TABLE user_current_region | ||
| ADD CONSTRAINT fk_user_current_region_region | ||
| FOREIGN KEY (region_id) REFERENCES region(region_id); | ||
|
|
||
| ALTER TABLE user_current_region | ||
| ADD CONSTRAINT fk_user_current_region_user | ||
| FOREIGN KEY (user_id) REFERENCES sidewalk_user(user_id); | ||
|
|
||
| ALTER TABLE user_login_info | ||
| ADD CONSTRAINT fk_user_login_info_login_info | ||
| FOREIGN KEY (login_info_id) REFERENCES login_info(login_info_id); | ||
|
|
||
| ALTER TABLE user_password_info | ||
| ADD CONSTRAINT fk_user_password_info_login_info | ||
| FOREIGN KEY (login_info_id) REFERENCES login_info(login_info_id); | ||
|
|
||
| ALTER TABLE user_role | ||
| ADD CONSTRAINT fk_user_role_role | ||
| FOREIGN KEY (role_id) REFERENCES role(role_id); | ||
|
|
||
| ALTER TABLE user_role | ||
| ADD CONSTRAINT fk_user_role_user | ||
| FOREIGN KEY (user_id) REFERENCES sidewalk_user(user_id); | ||
|
|
||
| ALTER TABLE user_survey_option_submission | ||
| ADD CONSTRAINT fk_user_survey_option_submission_survey_option | ||
| FOREIGN KEY (survey_option_id) REFERENCES survey_option(survey_option_id); | ||
|
|
||
| ALTER TABLE validation_task_interaction | ||
| ADD CONSTRAINT fk_validation_task_interaction_gsv_data | ||
| FOREIGN KEY (gsv_panorama_id) REFERENCES gsv_data(gsv_panorama_id); | ||
|
|
||
| ALTER TABLE validation_task_interaction | ||
| ADD CONSTRAINT fk_validation_task_interaction_mission | ||
| FOREIGN KEY (mission_id) REFERENCES mission(mission_id); | ||
|
|
||
| # --- !Downs | ||
|
|
||
| DROP CONSTRAINT IF EXISTS fk_validation_task_interaction_mission; | ||
Jetpackjules marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| DROP CONSTRAINT IF EXISTS fk_validation_task_interaction_gsv_data; | ||
| DROP CONSTRAINT IF EXISTS fk_user_survey_option_submission_survey_option; | ||
| DROP CONSTRAINT IF EXISTS fk_user_role_user; | ||
| DROP CONSTRAINT IF EXISTS fk_user_role_role; | ||
| DROP CONSTRAINT IF EXISTS fk_user_password_info_login_info; | ||
| DROP CONSTRAINT IF EXISTS fk_user_login_info_login_info; | ||
| DROP CONSTRAINT IF EXISTS fk_user_current_region_user; | ||
| DROP CONSTRAINT IF EXISTS fk_user_current_region_region; | ||
| DROP CONSTRAINT IF EXISTS fk_street_edge_region_street_edge; | ||
| DROP CONSTRAINT IF EXISTS fk_street_edge_region_region; | ||
| DROP CONSTRAINT IF EXISTS fk_street_edge_issue_user; | ||
| DROP CONSTRAINT IF EXISTS fk_street_edge_issue_street_edge; | ||
| DROP CONSTRAINT IF EXISTS fk_region_completion_region; | ||
| DROP CONSTRAINT IF EXISTS fk_label_point_label; | ||
| DROP CONSTRAINT IF EXISTS fk_label_user; | ||
| DROP CONSTRAINT IF EXISTS fk_label_street_edge; | ||
| DROP CONSTRAINT IF EXISTS fk_label_gsv_data; | ||
| DROP CONSTRAINT IF EXISTS fk_gsv_data_gsv_link; | ||
| DROP CONSTRAINT IF EXISTS fk_global_attribute_street_edge; | ||
| DROP CONSTRAINT IF EXISTS fk_audit_task_interaction_gsv_data; | ||
| DROP CONSTRAINT IF EXISTS fk_audit_task_interaction_small; | ||
| DROP CONSTRAINT IF EXISTS fk_audit_task_incomplete_audit_task; | ||
| DROP CONSTRAINT IF EXISTS fk_audit_task_comment_user; | ||
| DROP CONSTRAINT IF EXISTS fk_audit_task_amt_assignment; | ||
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.
Uh oh!
There was an error while loading. Please reload this page.