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

[OMP] During upgrade to 3.3 script tries to drop submissions.section_id which doesn't exist #6285

Closed
Vitaliy-1 opened this issue Oct 15, 2020 · 8 comments
Assignees
Labels
Bug:1:Minor A bug found in uncommon paths, with low consequences, limited users or has an easy workaround

Comments

@Vitaliy-1
Copy link
Collaborator

OMP 3.3 (current master branch).

Upgrade from 3.2.0 throws error:

ERROR: Upgrade failed: DB: SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'section_id'; check that column/key exists (SQL: alter table `submissions` drop `section_id`)

I don't think OMP has sections, at least I don't see the correspondent table and row in submissions and publications on my test instance. Think, this statement should be moved from the shared library.

@Vitaliy-1 Vitaliy-1 added this to the OJS/OMP/OPS 3.3 milestone Oct 15, 2020
@asmecher
Copy link
Member

@Vitaliy-1, a 3.2.0 database should have a section_id column in the submissions table; see https://github.com/pkp/pkp-lib/blob/3_2_0-0/xml/schema/submissions.xml#L164...L166. Was this database already partially upgraded from 3.2.x to 3.3.x? If so, maybe the column was already dropped?

@NateWr NateWr added the Bug:1:Minor A bug found in uncommon paths, with low consequences, limited users or has an easy workaround label Oct 19, 2020
@Vitaliy-1
Copy link
Collaborator Author

Yes, table section_editors contains a column named section_id but I don't see the same in the submissions table.
Just made a test installation of 3.2.0-3 downloaded from the site to confirm that.

SHOW COLUMNS FROM submissions

submission_id	bigint(20)	NO	PRI	
    NULL
	auto_increment	
context_id	bigint(20)	NO	MUL	
    NULL
		
locale	varchar(14)	YES		
    NULL
		
current_publication_id	bigint(20)	YES		
    NULL
		
date_last_activity	datetime	YES		
    NULL
		
date_submitted	datetime	YES		
    NULL
		
last_modified	datetime	YES		
    NULL
		
stage_id	bigint(20)	NO		1		
status	tinyint(4)	NO		1		
submission_progress	tinyint(4)	NO		1		
work_type	tinyint(4)	NO		0		

@asmecher
Copy link
Member

Yes, table section_editors contains a column named section_id but I don't see the same in the submissions table.

Sorry, you're right, I was looking under the wrong table. The definition of section_id in submissions was in dbscripts/xml/ojs-schema.xml in 3.2.0-3 but moved to lib/pkp/xml/schema/submissions.xml with #2493.

I've just installed a fresh 3.2.0-3 from the .tar.gz package and submissions.section_id is definitely there -- do you see it in your XML descriptor before installing?

@Vitaliy-1
Copy link
Collaborator Author

I've just installed a fresh 3.2.0-3 from the .tar.gz package and submissions.section_id is definitely there -- do you see it in your XML descriptor before installing?

I see it in OJS but not in OMP (in 3.2.0-3). As I mentioned, the problem is relevant only for OMP.

@Vitaliy-1
Copy link
Collaborator Author

My bad; but I also don't see it in the lib/pkp/xml/schema/submissions.xml

@Vitaliy-1
Copy link
Collaborator Author

This is the shared library timestamp that corresponds to OMP 3.2.0-3 version: https://github.com/pkp/pkp-lib/blob/3cbc385fc8ebd07f6117810fe72fc7abfa8abf5a/xml/schema/submissions.xml

@asmecher
Copy link
Member

asmecher commented Oct 19, 2020

My bad; but I also don't see it in the lib/pkp/xml/schema/submissions.xml

You're right again; submissions.section_id only appears in OMP 3.2.1-x. This drop should be made conditional as well on the column's existence.

(Generally speaking these kinds of conditions should be able to go away once we're finished needing to maintain both the XML-based and migration-based upgrade tools.)

@Vitaliy-1 Vitaliy-1 self-assigned this Oct 20, 2020
Vitaliy-1 added a commit to Vitaliy-1/pkp-lib that referenced this issue Nov 3, 2020
@Vitaliy-1
Copy link
Collaborator Author

PR to pkp-lib: #6312
Tests for OMP: pkp/omp#872

Vitaliy-1 added a commit that referenced this issue Nov 4, 2020
#6285 Drop submissions.section_id only if exists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug:1:Minor A bug found in uncommon paths, with low consequences, limited users or has an easy workaround
Projects
None yet
Development

No branches or pull requests

3 participants