Fix error when trying to create a page without extras #141
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.
WHY
BEFORE - What was wrong? What was happening before this PR?
I installed PageManager and tried to create a simple "terms and conditions" page using this template:
But I couldn't do that. As soon as I hit "save" in the create form, I was hit with a big fat DB error saying that the
extras
column doesn't have a default.AFTER - What is happening after this PR?
It looks like we have two migrations for this package. The first one creates the table, the second one changes the length of the
extras
column. But when it does that... it no longer hasnullable
on it, so that's forgotten.So I've just added
nullable
to it - and now it works.HOW
How did you achieve that, in technical terms?
Added
nullable
in the second migration file.Is it a breaking change or non-breaking change?
Non-breaking imho but @pxpm please think about it too.
How can we test the before & after?
Try to do the same thing I explained above, in a new project. You should get an error too.