johnny 5
johnny 5

Reputation: 21033

How Can I generate Identity DB Scripts without migration

I've been trying to fix a project so it has the db script for IdentityServer4. I've been informed to run

dotnet ef migrations add InitialIdentityServerMigration -c PersistedGrantDbContext

However when I run that I receive an error:

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

So I followed a few resources for getting dotnet-ef

and I Installed a few nuget packagets:

but still affter all that I receive the same error message.

Is there another way to get the script for a Identity4 DB?

Upvotes: 3

Views: 2042

Answers (2)

aaronR
aaronR

Reputation: 1567

Here are the .sql files on GitHub repository to install the SQL tables.

Upvotes: 1

travis.js
travis.js

Reputation: 5281

Try running the older style syntax in the Package Manager Console (which is using 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

Upvotes: 5

Related Questions