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

Fix staging nc_resource table missing primary key constraint and deploy fixes #175

Merged
merged 7 commits into from
Mar 1, 2023

Conversation

copelco
Copy link
Member

@copelco copelco commented Mar 1, 2023

Issue

Summary

Staging nc_resource table migration fix

Staging nc_resource table missing constraints:

trafficstops_staging_nc=> \d nc_resource
                                        Table "public.nc_resource"
     Column     |          Type          | Collation | Nullable |                 Default                 
----------------+------------------------+-----------+----------+-----------------------------------------
 id             | integer                |           | not null | nextval('nc_resource_id_seq'::regclass)
 title          | character varying(500) |           | not null | 
 description    | text                   |           |          | 
 image          | character varying(200) |           |          | 
 view_more_link | character varying(200) |           |          | 
 agency_id      | integer                |           |          | 

My local DB for reference:

traffic_stops_nc=# \d nc_resource
                                        Table "public.nc_resource"
     Column     |          Type          | Collation | Nullable |                 Default                 
----------------+------------------------+-----------+----------+-----------------------------------------
 id             | integer                |           | not null | nextval('nc_resource_id_seq'::regclass)
 title          | character varying(500) |           | not null | 
 description    | text                   |           |          | 
 image          | character varying(200) |           |          | 
 view_more_link | character varying(200) |           |          | 
 agency_id      | integer                |           |          | 
Indexes:
    "nc_resource_pkey" PRIMARY KEY, btree (id)
    "nc_resource_agency_id_802c5aa9" btree (agency_id)
Foreign-key constraints:
    "nc_resource_agency_id_802c5aa9_fk_nc_agency_id" FOREIGN KEY (agency_id) REFERENCES nc_agency(id) DEFERRABLE INITIALLY DEFERRED

Add constraint manually:

trafficstops_staging_nc=> ALTER TABLE nc_resource ADD CONSTRAINT nc_resource_pkey PRIMARY KEY (id);
ALTER TABLE

@copelco copelco marked this pull request as ready for review March 1, 2023 17:22
@copelco copelco changed the title Deploy fixes Fix staging nc_resource table missing primary key constraint and deploy fixes Mar 1, 2023
@copelco copelco merged commit 192d9af into develop Mar 1, 2023
@copelco copelco deleted the CU-8677hyhz9-deploy-fixes branch March 1, 2023 21:41
@copelco copelco mentioned this pull request Mar 1, 2023
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.

1 participant