handle repository.size column being NULL in migration v263 (#28336) #28363
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport #28336 by @thenaterhood
This resolves a problem I encountered while updating gitea from 1.20.4 to 1.21. For some reason (correct or otherwise) there are some values in
repository.size
that are NULL in my gitea database which cause this migration to fail due to the NOT NULL constraints.Log snippet (excuse the escape characters)
I assume this should be reasonably safe since
repository.git_size
has a default value of 0 but I don't know if that value being 0 in the odd situation whererepository.size == NULL
has any problematic consequences.