efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Scaffold-DbContext does not handle Identity auth

Open JerkerPihl opened this issue 7 years ago • 1 comments

If you should scaffold an .Net to Core then I guess it would be nice if it could identify Identity auth tables and also create an migration script for these tables, since the Identity at .Net to Core differs a lot. It should be also possible to exclude model creation for these tables(but how does it handle that in DBContext OnModelCreating ?) If you have models of the tables EF have troubles with what is referred when coding. Have tried to port my db quite some time. My latest suggestion to this manually is like ...

  1. Create asp.net core 2.X project with Identity auth
  2. Make migrations for new project and update database
  3. Compare the schema new project with the old in VS.
  4. Update the old database schema with the new schema(a really hairy and messy thing)

Further technical details

EF Core version: (found in project.csproj or packages.config) Database Provider: (e.g. Microsoft.EntityFrameworkCore.SqlServer) Operating system: IDE: (e.g. Visual Studio 2017 15.4)

So Scaffold-DbContext missing support for Identity databases

JerkerPihl avatar Apr 02 '19 15:04 JerkerPihl

@JerkerPihl Addressing the different points here:

  • There is a migration guide published by the ASP.NET guys for moving from old Identity to Core Identity. We're not planning to do anything beyond this.
  • Excluding tables from migrations is covered by #2725
  • Tables can be excluded from scaffolding on the command line or using EF Core Power Tools from @ErikEJ

ajcvickers avatar Apr 08 '19 15:04 ajcvickers