Yes, we did an upgrade 2.3.6. to 2.4.8-2 recently. I looked at database dumps from 2014 and 2016 (when we were still running 2.3.6) and there is no field called review_round_id
in any table at all. Here are the schemas for those two tables:
CREATE TABLE review_assignments (
review_id integer NOT NULL,
submission_id bigint NOT NULL,
reviewer_id bigint NOT NULL,
competing_interests text,
regret_message text,
recommendation smallint,
date_assigned timestamp without time zone,
date_notified timestamp without time zone,
date_confirmed timestamp without time zone,
date_completed timestamp without time zone,
date_acknowledged timestamp without time zone,
date_due timestamp without time zone,
date_response_due timestamp without time zone,
last_modified timestamp without time zone,
reminder_was_automatic smallint DEFAULT 0 NOT NULL,
declined smallint DEFAULT 0 NOT NULL,
replaced smallint DEFAULT 0 NOT NULL,
cancelled smallint DEFAULT 0 NOT NULL,
reviewer_file_id bigint,
date_rated timestamp without time zone,
date_reminded timestamp without time zone,
quality smallint,
review_type smallint DEFAULT 1 NOT NULL,
review_method smallint DEFAULT 1 NOT NULL,
round smallint DEFAULT 1 NOT NULL,
step smallint DEFAULT 1 NOT NULL,
review_form_id bigint
);
CREATE TABLE review_rounds (
submission_id bigint NOT NULL,
round smallint NOT NULL,
review_revision bigint,
review_type bigint,
status bigint
);
The fields review_round_id
must have been added during the upgrade to 2.4.8-2.
As you suggested, I fixed review_assignments
as much as possible using review_rounds
:
UPDATE review_assignments as a
SET review_round_id=r.review_round_id
FROM review_rounds as r
WHERE r.submission_id=a.submission_id and r.round=a.round;
DELETE FROM review_assignments WHERE review_round_id is null;
There were only 53 null values at the DELETE step, so it was pretty successful.
The upgrade process proclaimed success.
Iâll report on how well other things work after we do some testing.
Cheers, Brendan.