Closed nachoRSK closed 3 months ago
Hi @nachoRSK,
I don't know if this is a bug or if there is a reason for it. I have noticed that after running EF Core migrations, the ClientId and the Scope name columns are not constrained to be unique. Is there a reason for this?
What provider are you using? I tried to reproduce that locally with SQLite and SQL Server but in both cases, the indexes seem to be correctly created:
SQLite:
CREATE UNIQUE INDEX "IX_OpenIddictApplications_ClientId" ON "OpenIddictApplications" ("ClientId")
CREATE UNIQUE INDEX "IX_OpenIddictScopes_Name" ON "OpenIddictScopes" ("Name")
SQL Server:
CREATE UNIQUE NONCLUSTERED INDEX [IX_OpenIddictApplications_ClientId]
ON [dbo].[OpenIddictApplications]([ClientId] ASC) WHERE ([ClientId] IS NOT NULL);
CREATE UNIQUE NONCLUSTERED INDEX [IX_OpenIddictScopes_Name]
ON [dbo].[OpenIddictScopes]([Name] ASC) WHERE ([Name] IS NOT NULL);
I'm sorry; I was looking at the constraints all the time, and I missed the indexes. Many thanks for the quick response.
No problem 😄
Confirm you've already contributed to this project or that you sponsor it
Version
5.6.0
Question
Hi, I don't know if this is a bug or if there is a reason for it. I have noticed that after running EF Core migrations, the ClientId and the Scope name columns are not constrained to be unique. Is there a reason for this?
I used the Velusia sample, but the one responsible for this seems to be the OpenIddictEFCore package.