IsFixedLength() isn't propagated to foreign keys #18961
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
Milestone
A foreign key referencing a
string
column that hasIsFixedLength
set to true doesn't automatically receiveIsFixedLength
, resulting in a database error because the column types don't match.Steps to reproduce
When running this, I get an exception from the database:
If I remove
IsFixedLength
, everything works properly - bothIsUnicode
andHasMaxLength
are set up on the foreign key to be the same as on the primary key - both columns end up beingvarchar(2)
. Since both of these are transferred automatically to the foreign key, I would expect that to be the case withIsFixedLength
as well.This isn't a critical issue of course because we can always specify
IsFixedLength
on the foreign key manually.Further technical details
EF Core version: 3.0.0
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET Core 3.0
Operating system: Windows 10 Version 1903
IDE: Visual Studio 16.4.0 Preview 5.0
The text was updated successfully, but these errors were encountered: