2017-03-04 46 views
2

我一直在尝试修复一个项目,使其具有IdentityServer4的数据库脚本。我被告知运行如何在不迁移的情况下生成标识数据库脚本

dotnet ef migrations add InitialIdentityServerMigration -c PersistedGrantDbContext 

然而,当我跑,我收到一个错误:

dotnet: No executable found matching command "dotnet-ef"

所以我跟着几个resources用于获取的dotnet-EF

和我安装了一个几个nuget包:

  • Microsoft.EntityFrameworkCore.Tools
  • Microsoft.EntityFrameworkCore.Design

但仍affter一切,我收到同样的错误消息。

是否有另一种获取Identity4 DB脚本的方法?

+1

看看这个:http://identity.codeplex.com/ – Valkyrie

+0

是Identity2和Identity4相同的模式? –

+0

不幸的没有,但它略有不同:http://stackoverflow.com/questions/36345121/how-to-migrate-database-schema-from-identity-2-2-0-to-3-0-0rc1 - 终极 – Valkyrie

回答

1

尝试在包管理器控制台(使用Powershell)中运行旧式语法。

Add-Migration InitialIdentityServerPersistedGrantDbMigration -c PersistedGrantDbContext -o Data/Migrations/IdentityServer/PersistedGrantDb 
Add-Migration InitialIdentityServerConfigurationDbMigration -c ConfigurationDbContext -o Data/Migrations/IdentityServer/ConfigurationDb 
Update-Database -c PersistedGrantDbContext 
Update-Database -c ConfigurationDbContext 
+0

谢谢你,你一直在帮助我的地方 –

+0

高兴地帮助:-) –

+0

是的,这是它。这困扰着我,这就是为什么我没有在其他职位上发布identityServer4 instuctions。谢谢,我欠你。 –

相关问题