-
Couldn't load subscription status.
- Fork 10.5k
Alter database design for the Social Logins feature. #64192
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
Conversation
...serLogins for V3 schema Added Id primary key field to IdentityUserToken and IdentityUserLogin entities Updated V3 schema configuration to use Id primary keys with unique indexes instead of composite keys Made FindTokenAsync obsolete with guidance to use FindTokenByUniqueIndexAsync for V3 schema Updated UserStoreBase to use FindTokenByUniqueIndexAsync internally for token operations Modified UserStore and UserOnlyStore implementations to handle V3 schema with proper Id generation Updated SqlStoreTestBase to verify V3 schema includes Id columns Added comprehensive integration tests for UserManager with V3 schema Created UserStoreVersionThreeTest with specific V3 schema validation Updated DefaultUI sample to use V3 schema configuration All automated and manual testing passes successfully This change improves the database schema by using surrogate primary keys with unique indexes, which provides better performance and aligns with modern database design patterns. The V3 schema maintains backward compatibility while offering improved data access patterns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Docker containerization support for the IdentitySample.DefaultUI project and implements Identity V3 schema changes. The V3 schema introduces Id primary keys for IdentityUserLogin, IdentityUserToken, IdentityUserClaim, and IdentityRoleClaim entities (replacing composite primary keys with unique indexes), and includes comprehensive Docker setup scripts for Windows and Linux.
Key Changes:
- Added Docker infrastructure with compose, Dockerfile, and startup scripts (bash/batch) for running the sample with SQL Server
- Implemented V3 schema changes with Id primary keys and unique indexes for UserLogins and UserTokens
- Added external authentication support (Google) and email sender service to the sample
- Updated Entity Framework store implementations to support the new V3 schema with
FindTokenByUniqueIndexAsync
Reviewed Changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| start.sh / start.cmd | Interactive menu-based scripts to manage Docker containers for SQL Server and web app |
| docker-compose.yml | Docker Compose configuration for SQL Server 2022 and ASP.NET Core web application |
| Dockerfile | Multi-stage build for the Identity sample using .NET 10 preview SDK and runtime |
| appsettings.json | Updated connection string to use Docker SQL Server and added Google auth configuration |
| Startup.cs | Configured V3 schema version, added Google authentication provider, and email sender service |
| IdentityUserLogin.cs / IdentityUserToken.cs / IdentityUserClaim.cs / IdentityRoleClaim.cs | Added Id primary key properties (changed from int to TKey for claims) |
| UserStoreBase.cs | Added FindTokenByUniqueIndexAsync method and obsoleted FindTokenAsync |
| UserStore.cs / UserOnlyStore.cs | Implemented FindTokenByUniqueIndexAsync using unique index queries and added Id generation for string keys |
| IdentityUserContext.cs | Updated V3 model configuration to use Id primary keys with unique indexes; V1/V2 now ignore Id property |
| Test files | Added comprehensive tests for V3 schema functionality with tokens and logins |
| .devcontainer/devcontainer.json | Updated to use proper customizations structure for VS Code extensions and settings |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'kwy' to 'key'.
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing dollar sign ($) for environment variable interpolation. Should be ${GoogleClientSecret} to match the pattern used for GoogleClientId on line 33.
...serLogins for V3 schema Added Id primary key field to IdentityUserToken and IdentityUserLogin entities Updated V3 schema configuration to use Id primary keys with unique indexes instead of composite keys Made FindTokenAsync obsolete with guidance to use FindTokenByUniqueIndexAsync for V3 schema Updated UserStoreBase to use FindTokenByUniqueIndexAsync internally for token operations Modified UserStore and UserOnlyStore implementations to handle V3 schema with proper Id generation Updated SqlStoreTestBase to verify V3 schema includes Id columns Added comprehensive integration tests for UserManager with V3 schema Created UserStoreVersionThreeTest with specific V3 schema validation Updated DefaultUI sample to use V3 schema configuration All automated and manual testing passes successfully This change improves the database schema by using surrogate primary keys with unique indexes, which provides better performance and aligns with modern database design patterns. The V3 schema maintains backward compatibility while offering improved data access patterns
I'm going to close and re-open another because, on linux the Shipped and Unshpped APIs were amended, where it should just be the unshipped. However this did give me an error when only adding to the unshipped?
Alter database schema design for the Social Logins feature.
Summary of the changes (Less than 80 chars):
Add Id primary keys to IdentityUserTokens/Logins for V3 schema
Please see the attached report.
PR Report.md