-
Notifications
You must be signed in to change notification settings - Fork 3
Fix Citation published field type mismatch between Java boolean and PostgreSQL smallint #395
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
Conversation
…nnotation Co-authored-by: rvosa <[email protected]>
|
@copilot this is not going well. I think something is wrong about the logic, where the input form (citationForm.jsp) has a number of different publication statuses, the controller seems to treat it as a boolean, but the database wants a smallint. Investigate very carefully what is going on here. When I tried your latest commit, the following happened: |
|
@copilot try again. I think you were getting stuck in a loop. My hypothesis is that the web page has multiple publication statuses (e.g. 'Published', 'In review'), which are mapped to small ints in the database, but the controller for some reason still thinks we're just dealing with a boolean. I'm not sure about this but it would be a thing to explore. However, be openminded and investigate other possibilities as well. Look at the JSP, look at the Controller, and look at the database. |
…from smallint to boolean Co-authored-by: rvosa <[email protected]>
I investigated the issue and found the root cause. You were right - there was a mismatch, but it was in the database schema definition rather than the controller logic. Root cause: The production schema ( Fix in commit 9b59d02:
Note: The |
published boolean) and production (published smallint)@Type(NumericBooleanType)annotation from Citation.javabooleaninstead ofsmallintforpublishedcolumns (citation, matrix, phylotree tables)Root Cause Analysis
The original error occurred because:
Citation.javahas aboolean mPublishedfield0000_SCHEMA_before_patches_start.sql) usespublished booleanTBASE2_POSTGRES_CREATION.sql) incorrectly usedpublished smallint@Type(NumericBooleanType)converted boolean to integer, which broke CI testsSolution
@Type(NumericBooleanType)annotation fromCitation.isPublished()TBASE2_POSTGRES_CREATION.sqlto usebooleantype forpublishedcolumns incitation,matrix, andphylotreetables, aligning with the test schemaNotes
citationStatusDescriptionfield from the form correctly maps to theCitationStatusentity (with descriptive values like "In Prep", "In Review", "Published")mPublishedboolean field inCitationis a separate field used for internal trackingOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.