JonPSmith / EfCore.TestSupport

Tools for helping in unit testing applications that use Entity Framework Core
https://www.thereformedprogrammer.net/new-features-for-unit-testing-your-entity-framework-core-5-code/
Other
352 stars 53 forks source link

Hardcoded role name `postgres` #48

Closed kolpav closed 2 years ago

kolpav commented 2 years ago

FYI postgres is not always current role_name using value returned from SELECT current_user; might be more appropriate.

https://github.com/JonPSmith/EfCore.TestSupport/blob/994cc0a845614805444412732685a0b4c1814930/TestSupport/EfHelpers/Internal/PostgreSqlDropSchemaEnsureClean.cs#L36

JonPSmith commented 2 years ago

Hi @kolpav,

I'm not an postgres expert and I got this code from @roji.

@roji, can you have a look at this for me.

roji commented 2 years ago

Yeah, that makes sense - replacing TO postgres with TO current_user should do it.

JonPSmith commented 2 years ago

Thanks @roji. I'll add that to my list of things to do

JonPSmith commented 2 years ago

Fixed in version 5.2.2