Skip to content

Index reported as Extra in Database, but it is also in the model. #33

Open

Description

@urielzen

Hi, I am using SQL Server, and I am getting the following errors.

EXTRA IN DATABASE: Index 'AuthorityStandards', index constraint name. Found = IX_AuthorityStandards_ExtId
EXTRA IN DATABASE: Index 'AuthorityStandards', index constraint name. Found = IX_AuthorityStandards_GradeLevelId
EXTRA IN DATABASE: Index 'AuthorityStandards', index constraint name. Found = IX_AuthorityStandards_SubjectId
EXTRA IN DATABASE: Index 'AuthorityStandards', index constraint name. Found = IX_AuthorityStandards_AuthorityId_SubjectId_GradeLevelId_Name_YearAdopted

My entity class is decorated accordingly

image

The GradeLevelId and SubjectId are there because they are FK to another table.

image

As I was writing this bug report I thought that maybe this had to do with another bug report I created earlier.
Errors when using JSON columns

Since the error in both bug reports happen to be in tables where both have a JSON column. So I went ahead and removed the JSON column with a migration from this table AuthorityStandards and the error reported above went away! In other words these errors are reported only when there is a JSON column present in the table.

I hope this helps

Activity

  1. CSharpFiasco commented on Feb 23, 2024

    @CSharpFiasco

    I have a similar issue when I use a value object. The error message I get is:

    EXTRA IN DATABASE: Index 'Order', index constraint name. Found = IX_Order_CustomerId
    

    I have simplified my project and recreated this issue here. I subsequently created another branch which removed the ShippingAddress field off of the Order entity here. The unit test that does the comparison succeeds when I remove the ShippingAddress field

    By the way, here is some information on my system

    I am using:

    • EfCore.SchemaCompare 8.0.1

    • Visual Studio 2022 Version 17.8.7

    • SQL Server 15 (the tests write to the (localdb)\mssqllocaldb)

    • EF Core 8

  2. JonPSmith commented on Oct 18, 2024

    @JonPSmith
    Owner

    Hi @urielzen,

    Do try version 8.1.0, which supports Json Mapping, and close this if it works. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions