sfu-dhil / wphp

Women's Print History Project database front end.
https://womensprinthistoryproject.com/
GNU General Public License v2.0
1 stars 8 forks source link

Fix volumes input for Dodd titles #361

Closed kkatemoffatt closed 8 months ago

kkatemoffatt commented 8 months ago

What isn’t working as expected on the website?

For all titles connected to firm IDs 6666 and/or 4034 that have no input in the "volumes" field, please input "1" in the volumes field.

If you encountered an error message, please copy the relevant details or take a screenshot and paste it below.

N/A

What is the URL of the page where you encountered the bug?

N/A

What steps did you take before you encountered the bug?

N/A

What browser, operating system, and device were you using when you encountered the error?

N/A

Additional information

Here's an example of a title record connected to firm ID 6666 that has no input in the volumes field and that should say "1" in the volumes field: https://womensprinthistoryproject.com/title/25012

andrew-gardener commented 8 months ago

Hi Kate,

I've finished updating 498 titles with this change.

andrew-gardener commented 8 months ago

Historical bookkeeping (you can ignore)

/* find records */
SELECT title.*
FROM title
JOIN title_firmrole ON title.id = title_firmrole.title_id
WHERE title_firmrole.firm_id IN (6666, 4034)
AND title.volumes IS NULL;

/* update records */
UPDATE title
JOIN title_firmrole ON title.id = title_firmrole.title_id
SET title.volumes = 1
WHERE title_firmrole.firm_id IN (6666, 4034)
AND title.volumes IS NULL;