-
Notifications
You must be signed in to change notification settings - Fork 228
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
Can't scaffold database with expression indices #12
Comments
One problem I see is arbitrary-expression indices, opened dotnet/efcore#3986. For now I will make sure Npgsql at least drops these indices and logs a warning. |
@adopilot, I've fixed the issue with expression indices, they are currently ignored, at least until the EF7 core issue is resolved. Curiously though, after doing that reverse engineering worked just fine - I didn't get the "Column is null" error you posted above. I have some other issues so I'll wait before releasing another nuget though. |
From @adopilot on December 11, 2015 14:18 Any chances to get new nugets soon (please 👍 ). |
@adopilot promise to try to do this later today. Leaving this issue to track actual scaffolding of expression indices once dotnet/efcore#3986 is implemented. |
@adopilot have pushed 3.1.0-rc1-4 which should properly ignore expression indices, please let me know if you run into any trouble. |
From @adopilot on December 16, 2015 11:34 I am sory, But I am unable to Scaffold-DbContext
|
From @eBerdnA on December 24, 2015 14:24 @roji Did you push version 3.1.0-rc1-4 only for "EntityFramework7.Npgsql.Design" or also for "EntityFramework7.Npgsql" because right now I can only get version 3.1.0-rc1-3 for the later through NuGET. So basically I do have the following dependecies in my project.json:
If I try to scaffold my local database with this setup I do get the same error as @adopilot which he got when he opened this issue. I'm using a DB which I created myself but which is very simple (only 4 tables with some foreign keys, so nothing special). UPDATE: I have just created a dump of the db which is causing this effect. Maybe this helps to find the reason for this issue. |
From @eBerdnA on December 27, 2015 11:53 @roji Just to make sure I'm not causing confusion here I don't have any problem running the command as it is described in #914 because I simply don't use it but I do get the error "Column is null". I'm using the command |
@eBerdnA sorry I thought you had the same issue as @adopilot. I just created a database with your SQL dump and then successfully reverse-engineered it with no warnings or errors whatsoever...! Your dependencies look OK, can you please double-check things (do |
From @adopilot on December 28, 2015 9:57 @roji unfortunately I still can't scaffold database
Should EntityFramework7.Npgsql also be at verison version="3.1.0-rc1-5" here is what I get, maybe this is different issue
|
@adopilot thanks for testing, yes this is something new. Can you please open a separate issue and like to a gist of the SQL dump of the database (use |
From @adopilot on December 28, 2015 12:34 @roji I'll open new issue as soon as I be able to reproduce problem. |
From @eBerdnA on December 28, 2015 21:22 @roji It is getting more weird every day. Today I dropped a foreign key from one table and added a new column. Afterwards I have been unable to scaffold any more. Then I restored a new instance from a dump as @adopilot described and scaffold was possible again. But I'm still unable to reproduce it. |
From @eBerdnA on December 28, 2015 22:26 @roji @adopilot I think I found a way to reproduce this effect. The following steps should lead to the problem. 1 - First of all create two tables.
Scaffolding should be possible now. 2 - Add a new column to table Article and a constraint
Scaffolding should still be possible. 3 - Remove the added constraint and the column from table Article. Now scaffolding should fail with Hopefully this helps. UPDATE: Should I just reopen #917? Stacktrace is same as before. |
@eBerdnA thanks for the repro, I'll try it later today! The Npgsql reverse engineering provider queries the PostgreSQL internal catalog tables to figure out the database schema, it's possible that there's some subtle bug there that only manifests itself after doing ALTER or something... I'll let you know what I find. |
Closing this as it was more about a bug caused by having an expression index (the fix was to ignore it). Opened #119 to track expression index support. |
From @adopilot on December 5, 2015 19:57
Npqsql sometimes fail to Reverse engineering with exception which is unreadable to user.
I was trying to Scaffold database of Discourse forum.
In VS2015 console app created targeting .NETFramework,Version=v4.5.1 with EntityFramework7.Npgsql.Design.3.1.0-rc1-3 when try to Scaffold database using Package Manager Console by command like this
user get generated exception like this
That is prryt unreadibile and hard to debug what is wrong with database
Here is gist dump of scema Discourse database I am trying to scaffold.
Copied from original issue: npgsql/npgsql#892
The text was updated successfully, but these errors were encountered: