-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Migrations: Enum literal generated for defaultValue #6193
Comments
Migrations actually shouldn't use the enum at all (since you may remove the enum from the model at some point in the future). It should use the underlying value (i.e. |
@Bartmax which versions of the packages are you using? We thought this was fixed in RTM (but maybe we missed a case) |
@rowanmiller I'm using 1.0 (RTM). And yup, It happened that I removed a type and I was unable to work with migrations, so using the underlying type makes lot of sense. Just in case, the enum is defined as:
|
#4061 was older issue. Looks like we have regressed. |
Thanks for the info - assigning to fix in 1.1 |
I found the root cause here. Don't worry, @smitpatel, it's not a regression. Because a non-nullable column is being added, the model differ is synthesizing a default. However, it is not unwrapping the enum type before getting a default value. |
Add a migration when a model has an enum fails to include the using for the appropiate namespace on the migration file and results in compilation error.
adding the using by hand solves the issue.
The text was updated successfully, but these errors were encountered: