Identityserver4: Case convention for PostgreSQL

Created on 11 Dec 2019  路  7Comments  路  Source: IdentityServer/IdentityServer4

Hi all,

I am using Identity Server with PostgreSQL. I would like to know if there is a way to change naming convention from Pascal case to snake case?

question

All 7 comments

It's EF Core under the covers -- so the question is can you make that do what you want?

I use this blog post for overriding NpgSQL naming conventions:
https://andrewlock.net/customising-asp-net-core-identity-ef-core-naming-conventions-for-postgresql/
So can I override ConfigurationDbContext's and PersistedGrantDbContext's OnModelCreating method?

I just provided a somewhat simiar example for clustering. You can see if it works for your NpgSQL config:

https://github.com/IdentityServer/IdentityServer4/issues/3770#issuecomment-564327555

When I do that I get the following error:
Unable to resolve service for type 'Microsoft.EntityFrameworkCore.DbContextOptions`1[IdentityServer4.EntityFramework.DbContexts.PersistedGrantDbContext]' while attempting to activate 'MyContext'.

Ah yea, I see. That was more of a copy/paste typo as I tried to write up that comment. Can you try:

public MyDbContext(DbContextOptions<MyDbContext> options, OperationalStoreOptions storeOptions) : base(options, storeOptions)

instead?

I have generated migrations successfully, thanks a lot.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

user1336 picture user1336  路  3Comments

createroftheearth picture createroftheearth  路  3Comments

agilenut picture agilenut  路  3Comments

not-good-with-usernames picture not-good-with-usernames  路  3Comments

klioqc picture klioqc  路  3Comments