UPDATE event_log_settings SET setting_name='submission_id' WHERE setting_name='article_id'
UPDATE review_assignments SET date_response_due = date_due WHERE date_response_due IS NULL
UPDATE plugin_settings SET setting_value=1 WHERE setting_name='context' AND LOWER(plugin_name) LIKE '%blockplugin'
UPDATE submission_files SET viewable = 1 WHERE file_stage = 2 AND viewable = 0
UPDATE email_templates_default_data SET body=REPLACE(body, '<a href="{$activateUrl}">{$activateUrl}</a>', '{$activateUrl}')
UPDATE email_templates_data SET body=REPLACE(body, '<a href="{$activateUrl}">{$activateUrl}</a>', '{$activateUrl}')
UPDATE email_templates_default_data SET body=REPLACE(body, '<a href="{$url}">{$url}</a>', '{$url}')
UPDATE email_templates_data SET body=REPLACE(body, '<a href="{$url}">{$url}</a>', '{$url}')
UPDATE email_templates_default_data SET body=REPLACE(body, '<a href="{$contextUrl}">{$contextUrl}</a>', '{$contextUrl}')
UPDATE email_templates_data SET body=REPLACE(body, '<a href="{$contextUrl}">{$contextUrl}</a>', '{$contextUrl}')
UPDATE email_templates_default_data SET body=REPLACE(body, '<a href="{$passwordResetUrl}">{$passwordResetUrl}</a>', '{$passwordResetUrl}')
UPDATE email_templates_data SET body=REPLACE(body, '<a href="{$passwordResetUrl}">{$passwordResetUrl}</a>', '{$passwordResetUrl}')
UPDATE email_templates_default_data SET body=REPLACE(body, '<a href="{$submissionReviewUrl}">{$submissionReviewUrl}</a>', '{$submissionReviewUrl}')
UPDATE email_templates_data SET body=REPLACE(body, '<a href="{$submissionReviewUrl}">{$submissionReviewUrl}</a>', '{$submissionReviewUrl}')
UPDATE email_templates_default_data SET body=REPLACE(body, '<a href="{$submissionLayoutUrl}">{$submissionLayoutUrl}</a>', '{$submissionLayoutUrl}')
UPDATE email_templates_data SET body=REPLACE(body, '<a href="{$submissionLayoutUrl}">{$submissionLayoutUrl}</a>', '{$submissionLayoutUrl}')
UPDATE email_templates_default_data SET body=REPLACE(body, '<a href="{$articleUrl}">{$articleUrl}</a>', '{$articleUrl}')
UPDATE email_templates_data SET body=REPLACE(body, '<a href="{$articleUrl}">{$articleUrl}</a>', '{$articleUrl}')
UPDATE email_templates_default_data SET body=REPLACE(body, '<a href="{$subscriptionUrl}">{$subscriptionUrl}</a>', '{$subscriptionUrl}')
UPDATE email_templates_data SET body=REPLACE(body, '<a href="{$subscriptionUrl}">{$subscriptionUrl}</a>', '{$subscriptionUrl}')
INSERT INTO edit_decisions (submission_id, review_round_id, stage_id, round, decision, editor_id, date_decided) SELECT DISTINCT ed.submission_id, 0, 1, 0, 8, ed.editor_id, ed.date_decided FROM edit_decisions ed JOIN (SELECT submission_id, MIN(date_decided) AS date_decided FROM edit_decisions GROUP BY submission_id) ed1 ON (ed1.submission_id = ed.submission_id) WHERE ed.stage_id = 3 AND ed1.date_decided = ed.date_decided AND NOT EXISTS (SELECT ed2.submission_id FROM edit_decisions ed2 WHERE ed2.stage_id = 1 AND ed2.decision = 8 AND ed2.submission_id = ed.submission_id)
UPDATE filter_groups SET output_type = 'xml::schema(https://www.crossref.org/schemas/crossref4.3.6.xsd)' WHERE output_type = 'xml::schema(http://www.crossref.org/schema/deposit/crossref4.3.6.xsd)'
UPDATE email_templates_default_data SET body=REPLACE(body, '{$submissionEditingUrl}', '{$submissionUrl}'), subject=REPLACE(subject, '{$submissionEditingUrl}', '{$submissionUrl}')
UPDATE email_templates_data SET body=REPLACE(body, '{$submissionEditingUrl}', '{$submissionUrl}'), subject=REPLACE(subject, '{$submissionEditingUrl}', '{$submissionUrl}')
DELETE FROM journal_settings WHERE setting_name IN ('focusScopeDesc', 'reviewPolicy', 'pubFreqPolicy', 'openAccessPolicy', 'customAboutItems', 'contributorNote', 'contributors', 'sponsorNote', 'sponsors', 'history')
DELETE FROM email_templates_default WHERE email_key IN ('GIFT_AVAILABLE', 'GIFT_USER_REGISTER', 'GIFT_USER_LOGIN')
DELETE FROM email_templates_default_data WHERE email_key IN ('GIFT_AVAILABLE', 'GIFT_USER_REGISTER', 'GIFT_USER_LOGIN')
DELETE FROM email_templates WHERE email_key IN ('GIFT_AVAILABLE', 'GIFT_USER_REGISTER', 'GIFT_USER_LOGIN')
DELETE FROM email_templates_data WHERE email_key IN ('GIFT_AVAILABLE', 'GIFT_USER_REGISTER', 'GIFT_USER_LOGIN')
DELETE FROM notifications WHERE type IN (33554433, 33554434, 33554435, 33554436, 33554437, 33554438)
DELETE FROM submission_settings WHERE setting_name = 'crossref::depositStatus' AND submission_id IN (SELECT submission_id FROM (SELECT * FROM submission_settings) AS ss2 WHERE setting_name = 'crossref::status')
DELETE FROM submission_settings WHERE setting_name = 'crossref::depositStatusUrl' AND submission_id IN (SELECT submission_id FROM (SELECT * FROM submission_settings) AS ss2 WHERE setting_name = 'crossref::statusUrl')
UPDATE submission_settings SET setting_name = 'crossref::status' WHERE setting_name = 'crossref::depositStatus'
UPDATE submission_settings SET setting_name = 'crossref::statusUrl' WHERE setting_name = 'crossref::depositStatusUrl'
UPDATE metrics SET assoc_type = 531 WHERE assoc_type = 515 AND assoc_id IN (SELECT file_id FROM submission_supplementary_files)
UPDATE metrics SET assoc_type = 531 WHERE assoc_type = 515 AND assoc_id IN (SELECT file_id FROM submission_artwork_files)
DELETE FROM versions WHERE product_type = 'plugins.citationFormats'
DELETE FROM versions WHERE product_type = 'plugins.citationOutput'
DELETE FROM journal_settings WHERE setting_name = 'metaCitationOutputFilterId'
UPDATE filter_groups SET output_type = 'xml::schema(http://schema.datacite.org/meta/kernel-4/metadata.xsd)' WHERE output_type = 'xml::schema(http://schema.datacite.org/meta/kernel-3/metadata.xsd)'