-
Notifications
You must be signed in to change notification settings - Fork 28
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
Unable to create migration using Pomelo's connector when Option types are already present in model #143
Comments
Hi @GunnerGuyven Sounds like it could be related to Pomelo if it works with @bricelam, quick question, in |
That's right, there is no model change. I have narrowed this issue to the presence of the option type itself in the previous migration. You can construct an elaborate model involving option types and so long as there are no previous migrations (involving option types), the migration will succeed. |
I have created a project demonstrating this issue
And opened a ticket with Pomelo to match this one (PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#1700) |
@simon-reynolds Researching the codebase of Pomelo, I see that they do indeed also add an If there is a 'good citizen' approach to this problem, what would it be and which library should hold that responsibility? |
The model differ is not designed to be overridden by providers or extensions. Additional functionality should instead be enabled using model annotations.
I vaguely remember this. I think there's an EF issue to review this code and see if there's anything we can add to make this better. What functionality is currently added by the F# override? Could it be part of the core EF implementation? |
The F# override is to add support for the The F# model differ matches conventions by marking every column that isn't a PrimaryKey as non-nullable unless the CLR type is either |
Hmm, it feels like this shouldn't be needed in the differ. An F#-specific model building convention should mark the IColumn as IsNullable when the CLR type uses /cc @AndriySvyryd |
Describe the bug
A migration cannot be created when using
Pomelo.EntityFrameworkCore.MySql
as the connector when an option type is present on the existing (pre-migration) model.To Reproduce
Starting with the following model:
No Database is necessary, this issue is only concerned with creating migrations.
Steps to reproduce the behavior:
dotnet ef migrations add test1
(no issue)dotnet ef migrations add test2
(no issue)dotnet ef migrations add test3
(no issue)dotnet ef migrations add test4
(FAIL)Expected behavior
I would expect migration 4 to succeed.
Additional context
This works with
Microsoft.EntityFrameworkCore.Sqlite
so it may be a failure of the Pomelo connector specifically, but I am unsure. I've tested all of the 6.0.x releases of Pomelo's connector with the same result.The text was updated successfully, but these errors were encountered: