-
Notifications
You must be signed in to change notification settings - Fork 223
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
Migration from nullable jsonb column to non-nullable produces invalid migration #2131
Comments
@TETYYS thanks for filing this - yeah, it's an interesting case where the CLR default (empty string) isn't a valid value for the column type (json). There's an ongoing discussion in dotnet/efcore#21765 about this area, let's wait and see how it pans out there. |
Currently, based on dotnet/efcore#21765 (comment), the right way to deal with this is to edit the scaffolded migration and to manually replace the empty string with Closing this as by-design for now. |
When migrating from nullable jsonb column to a non-nullable one, migration tries to execute following statements:
This fails with error
invalid input syntax for type json
, as '' is not valid json.Workaround:
Set default value for the column as valid json explicitly:
The text was updated successfully, but these errors were encountered: