-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullRef scaffolding Postgres DB #30621
Comments
@mharward-gr Have you updated the t4 templates, some bugs in them were fixed in 7.0.3 |
@ErikEJ thank you for the quick response - I don't have any t4 templates set up for this project. Is that something I need to add? |
@mharward-gr Can you post the schema? Or point to where I can get it from in the linked project? |
@ajcvickers Here are the create scripts for the two specific tables above:
The liquidbase schema can be found here for the latest waltz release if that is more useful: https://github.com/finos/waltz/releases/download/1.48/liquibase-scripts.zip |
@mharward-gr your script above references other missing tables (e.g. involvement_kind). Can you please submit a self-contained script that can be executed on an empty database and which reproduces the exception? |
Ah, sorry @roji, here is the create script for involvement_kind. I believe that the 3 tables (with involvement executed last), should be self contained. Hopefully that works.
|
I could create the three tables, but scaffolding worked fine without any error... Can you please take another look? |
Hi @roji, thank you very much for looking at this. This definitely seems to be a problem at my end - not with latest version of EF. With a clean project and clean DB, I have confirmed this happens for 7.0.2 and earlier, but does not happen with 7.0.4. |
Duplicate of #29516 |
When using EF Core scaffolding for an existing Postgres DB, I have started getting the following NullRef error. I have checked multiple versions of EF so I suspect a schema change - but I can't find any compelling changes that might cause it. Either way, shouldn't be getting a null ref.
The DB schema is provided by the open source application Waltz (https://github.com/finos/waltz).
I've reproduced this with a smaller subset of two tables in a couple of places in the schema (but definitely not affecting all tables with relationships).
Included is an example of just two tables that is throwing a null ref.
I've tried making
public.person.employee_id
not nullable, but that doesn't seem stop the error.Would someone be able to take a look?
Command to scaffold
Output
This example is between
person
andinvolvement
, have found the same betweeninvolvement
andinvolvement_kind
, but they are the only two examples I have been able to find from a fairly large schema - so might be something directly related to theinvolvement
table - but processing this alone does not generate the error.Provider and version information
EF Core version: 7.0.4 (have also tried 6.0.8, 6.0.15, 7.0,2 and this doesn't seem to make a difference)
Database provider: Npgsql.EntityFrameworkCore.PostgreSQL
Target framework: .NET 7.0
Operating system: Windows 10
IDE: Terminal
The text was updated successfully, but these errors were encountered: