Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create Identity Server DB for SQLite?

I have run dotnet new is4ef to create an Identity Server template.

Next I changed UseSqlServer() -> UseSqlite() in Startup.cs.

The program compiles, but the tables in the DB are not created when it runs.

How to create the suitable tables for the configuration store and operational store?

like image 243
porton Avatar asked Feb 13 '26 04:02

porton


1 Answers

To create the DB, you need to run the migration:

dotnet tool install --global dotnet-ef
dotnet ef migrations add 'initial' --project src/IdentityServer/IdentityServer.csproj --context PersistedGrantDbContext

Then you update the database by

dotnet ef database update --project src/IdentityServer/IdentityServer.csproj --context ConfigurationDbContext

And then the DBs are created.

like image 66
Jeff Tian Avatar answered Feb 15 '26 06:02

Jeff Tian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!