You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using HasData to seed an Entity with a mapped Enum creates a migration that errors with: PostgresException (0x80004005) 42703: column "{{enum value}}"
#3426
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.
I think this is a minor bug on migration code generation, and while I found a work around, I thought I'd contribute my findings. I searched issues and didn't see anyone mention this yet.
Consider the below setup where Voice is an Entity model, and it has a reference to an enumeration, VoiceSource
Hi,
I think this is a minor bug on migration code generation, and while I found a work around, I thought I'd contribute my findings. I searched issues and didn't see anyone mention this yet.
Consider the below setup where Voice is an Entity model, and it has a reference to an enumeration, VoiceSource
An enumeration with Npgsql mapping added
I have some seed data configured:
Then, when I make my INITIAL database migration, this code is generated where the enumeration is referenced directly:
Which fails to run via the migration bundle application:
The fix
Updating the migration file manually to use the string value wrapped with single quotes fixed the issue and the migration succeeds:
The single quotes wrapping the "azure" are necessary FYI, I first tried it without and that also failed.
The text was updated successfully, but these errors were encountered: