【发布时间】:2017-07-28 09:32:00
【问题描述】:
我正在尝试为我的 IdentityServer4 令牌服务器设置存储, 我正在关注这个tutorial,在那里我遇到了这样的数据库迁移:
dotnet ef migrations add InitialIdentityServerMigration -c PersistedGrantDbContext
dotnet ef migrations add InitialIdentityServerMigration -c ConfigurationDbContext
dotnet ef migrations add InitialIdentityServerMigration -c ApplicationDbContext
显然我正在运行不同版本的 powershell,或者工具被搞砸了,所以我必须使用不同的语法来运行我的迁移
Add-Migration InitialIdentityServerPersistedGrantDbMigration -c PersistedGrantDbContext -o Data/Migrations/IdentityServer/PersistedGrantDb
Add-Migration InitialIdentityServerConfigurationDbMigration -c ConfigurationDbContext -o Data/Migrations/IdentityServer/ConfigurationDb
这两个命令效果很好,但是我仍然缺少生成 ApplicationDbContext 的第三个命令:
当我运行时,我得到了这个异常:
SqlException:无效的对象名称“AspNetUsers”。
我在身份数据库中缺少此表以及其他一些表,有人知道要使用哪个迁移吗?
【问题讨论】:
标签: c# powershell asp.net-core migration identity