Sqlite Code Generation fails
statler opened this issue · 6 comments
I am trying to reverse engineer the attached Sqlite db with the given config. It fails with an uninformative warning. I tried debugging the T4, but that bails out after creating the configs for the primitives. Latest version. Any ideas?
OK - so it runs correctly if you use the debug T4 template function in VS, but fails if you try and run it on save.
OK, so it runs, but still generates incorrect configurations. Basically, if a class has multiple FKs to the same table, it will only add the first relationship . I expect that this line is the culprit
var constraints = fkList.Select(x => x.FkSchema + "." + x.ConstraintName).Distinct();
Because in the Sqlite config, the schema is identical, and the constraintname is built using the current table and FK Primary key ID, which is also the same. I expect this is a mistake, and the constraintname should include the local property.
Are you planning on fixing this?
The issue of multiple foreign keys to the same table has been fixed. Thanks for the heads-up on where to look. Foreign keys will have a different name though and will need to be changed in your code after the first run. Download the latest EF.Reverse.POCO.v3.ttinclude