Open jamesra opened 2 years ago
Microsoft.Data.SqlClient.SqlException: 'Column 'MosaicShape' in table 'Location' is of a type that is invalid for use as a key column in an index or statistics.'
This error looks significantly different from what's in this issue's title. Can you please update one or the other, or add details about how the Geometry.UserData
error fits into it?
Sorry about that. I had another issue I solved before filing this one. I also mis-keyed and submitted this a bit early, but I'm still struggling with it so I left it submitted.
Are you looking for https://github.com/dotnet/efcore/issues/12538?
Yes, apparently I am.
I am getting this error creating my database from scratch in a unit test:
This is a simplified version of the class. It was reverse-engineered by EF Core Power Tools.
In a unit test I attempt to create this database from scratch. The error occurs at
DataContext.Database.EnsureCreated();
This previous issue indicates a spatial index should be possible. https://github.com/dotnet/efcore/issues/12538
I also tried removing the [Index] attribute from the class and creating it with the builder:
entity.HasIndex(e => e.MosaicShape, "MosaicShape_Index");
The error was the same, as expected.