-
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
nvarchar(max) can't be used with indexed columns #1071
Comments
Can a key/foreign key property length be lowered to 128? To follow EF6 of defaulting keys to 128? Or you have a reason to use string length of 450, which is quite big for the string key. |
A workaround for now is during the OnModelCreating event of your Context add the following to manually change the column length to 450 characters versus letting the CLR make them nvarchar(max), you will get an nvarchar(450). Give that your POCO is named YOUROBJECTNAME and that your property is named YOURFIELDNAME and is defined as a string
|
Clearing for triage as this was marked as pri1... but if we are going to do it, we should do it for RTM |
(See How to create an index for a string property in Entity Framework 7)
Similar to how we use
nvarchar(450)
on key columns, we should do something similar for indexed columns. I assume this also applies tovarbinary(max)
.The text was updated successfully, but these errors were encountered: