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

Correct possible dropping of notnull from locale columns on upgrade #10293

Closed
asmecher opened this issue Aug 8, 2024 · 9 comments
Closed

Correct possible dropping of notnull from locale columns on upgrade #10293

asmecher opened this issue Aug 8, 2024 · 9 comments
Assignees
Milestone

Comments

@asmecher
Copy link
Member

asmecher commented Aug 8, 2024

The implementation of #9425 included migration code that extended the length of any identified locale columns. However, some of these columns (e.g. publication_galleys.locale) are nullable, and this code will either make them NOT NULL or, if there is null data present, fail with an error.

I would suggest altering the migration to make it preserve the NOT NULL status of the column when extending the length.

@jyhein and @ajnyga, just a heads-up -- @touhidurabir would like to fix it.

PRs
pkp-lib --> #10305
ojs --> pkp/ojs#4398 [TEST ONLY]

@ajnyga
Copy link
Collaborator

ajnyga commented Aug 9, 2024

thanks, go ahead

@touhidurabir
Copy link
Member

@asmecher tests are passing , can you take a look at the PR at #10293 (comment)

@asmecher
Copy link
Member Author

@ajnyga, could you or @jyhein review this one? Thanks!

@asmecher
Copy link
Member Author

@ajnyga or @jyhein, this is breaking just about everything on upgraded installations; could you have a look at the PRs above?

@bozana
Copy link
Collaborator

bozana commented Sep 23, 2024

@touhidurabir, what does "->first(default:[])" mean?

@touhidurabir
Copy link
Member

@touhidurabir, what does "->first(default:[])" mean?

@bozana please see at https://github.com/pkp/pkp-lib/pull/10305/files#r1771286012 for reasoning .

@bozana
Copy link
Collaborator

bozana commented Sep 23, 2024

So I took a look at the code changes and they look good to me: we now look if the column to be changed is nullable and act accordingly i.e. we use $table->string($l, 28)->nullable()->change() (instead of $table->string($l, 28)->change()) in that case.
I have not tested it, but I think we can merge it :-)

@ajnyga
Copy link
Collaborator

ajnyga commented Sep 23, 2024

sorry for missing this in august, we talked about this in the morning and looks to be fine. I also tried running upgrade test from 3.4 stable.

@asmecher
Copy link
Member Author

Merged your PR, thanks, @touhidurabir!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants