Skip to content
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

EntityFramework Migration Generation Produces Unexpected Index Column #31187

Closed
vsfeedback opened this issue Jul 5, 2023 · 3 comments
Closed

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work]
Please see attached SLN. After running the following command in Visual Studio's Developer PowerShell:

dotnet ef migrations add EFCore72 -v --project Starbeam.Applications.Gateway.Initialization --startup-project Starbeam.Entities.Design --configuration Debug

It produces the 20230628141213_EFCore72 file which contains the following command:

migrationBuilder.CreateIndex(
                name: "IX_Transaction_SystemDebit_SourceId",
                table: "Transaction",
                column: "SystemDebit_SourceId",
                unique: true,
                filter: "[SourceId] IS NOT NULL");

Expected:

migrationBuilder.CreateIndex(
                name: "IX_Transaction_SystemDebit_SourceId",
                table: "Transaction",
                column: "SystemDebit_SourceId",
                unique: true,
                filter: "[SystemDebit_SourceId] IS NOT NULL");

Original Comments

Feedback Bot on 6/29/2023, 03:24 AM:

(private comment, text removed)


Original Solutions

(no solutions)

@ajcvickers
Copy link
Member

This issue is lacking enough information for us to be able to fully understand what is happening. Please attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate.

@Mike-E-angelo
Copy link

Hi @ajcvickers thank you for your reply and investigation. For clarity, this is the same solution you were able to attend to with #29847. I removed the indexes as you suggested and ran the above command, resulting in the generated migration which is a part of the solution as provided in the developercommunity ticket. Please let me know if there is any further information required.

@ajcvickers
Copy link
Member

Duplicate of #31153

@ajcvickers ajcvickers marked this as a duplicate of #31153 Jul 5, 2023
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants