-
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 is ignoring my maxlength when columntype was specified #3985
Comments
This is by-design, if you specify an explicit type then you are overriding all the other hints that EF would give the provider to work out a data type to use. You would typically put "varchar(50)" as the data type if that is what you want. Leaving open for triage, as it seems a little strange that we are converting "varchar" to "varchar(1)" |
As soon as MaxLength attribute (as source for HasMaxLength) is used not only for db schema, but also by GUI generators/validators - it's desirable for HasColumnType() also honor it. |
You are fine to put the max length attribute on, but if you use BTW if you just want to swap to a non-Unicode data type then we have a work item to bring back |
I'm generating my database using migrations, when I specific the column type as varchar and maxlength the result is varchar(1)
I had to remove the column type to generate right.
The text was updated successfully, but these errors were encountered: