TexasDigitalLibrary / Vireo

Vireo is a turnkey Electronic Thesis and Dissertation (ETD) Management System.
https://texasdigitallibrary.atlassian.net/wiki/spaces/VUG/pages/87490642/About
GNU General Public License v2.0
46 stars 35 forks source link

Vireo3 to Vireo4 ActionLog Migration may fail due to ARCHIVED Submission Status. #1815

Closed kaladay closed 10 months ago

kaladay commented 1 year ago

The Submission Status has evolved into a boolean column in the submission_status table in Vireo 4.

This is fine except for when migrating from Vireo 3 to Vireo 4. There are Action Logs that have the Archived status.

It is unclear as to what this ActionLog should be moved to and so there is a need to still have an Archived Submission Status if only for the purposes of maintaining migrated data.

If Vireo 3 is not to be migrated then this likely should not be used and is not needed.

The System Data Loader can configure this but the values is also a hard-coded enumeration to deal with.

kaladay commented 1 year ago

Analysis of the data has revealed that most of the data is in the PUBLISHED status immediately before being switch into the ARCHIVED status or has a Deposit ID set on the Submission.

The migration can be changed to migrate ARCHIVED into PUBLISHED without needing to perform any code changes.

Relevant SQL

Get count of Submissions with a Deposit ID:

select count(*) from submission where id in (select distinct submission_id from actionlog where submissionstate = 'Archived') and depositid is not null;

Get count of Submissions without a Deposit ID:

select count(*) from submission where id in (select distinct submission_id from actionlog where submissionstate = 'Archived') and depositid is null;

Get all of the Action Logs that have a Submission without a Deposit ID and has an ARCHIVED status:

select id, actiondate, submission_id, submissionstate from actionlog where submission_id in (select id from submission where id in (select distinct submission_id from actionlog where submissionstate = 'Archived') and depositid is null) group by submission_id, id order by submission_id asc, actiondate desc;