如何在不迁移的情况下生成身份数据库脚本
How Can I generate Identity DB Scripts without migration
我一直在尝试修复一个项目,使其具有 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
但我仍然收到相同的错误消息。
还有其他方法可以获取 Identity4 数据库的脚本吗?
在包管理器控制台(使用 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
这是 GitHub repository 上的 .sql 文件,用于安装 SQL 表。
我一直在尝试修复一个项目,使其具有 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
但我仍然收到相同的错误消息。
还有其他方法可以获取 Identity4 数据库的脚本吗?
在包管理器控制台(使用 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
这是 GitHub repository 上的 .sql 文件,用于安装 SQL 表。