Entity developer (NHibernate) 7.1.151 generating wrong SQL at Update the Database from Model

Entity developer (NHibernate) 7.1.151 generating wrong SQL at Update the Database from Model

Hello

If you add an association between two entities with composite primary keys, entity developer (NHibernate) 7.1.151 will generate the wrong sql script at "Update the Database from Model".

Example (Assoc is One Cat to Many Dogs, ISet)


The generated SQL is: 
  1. CREATE TABLE dbo.Cats (
  2.    ID INT NOT NULL,
  3.    Edited DATETIME2 NOT NULL,
  4.    CatFood VARCHAR(8000) NOT NULL,
  5.    CONSTRAINT PK_Cats PRIMARY KEY (ID, Edited)
  6. )
  7. GO

  8. -- 
  9. -- Creating a table dbo.Dogs 
  10. -- 
  11. CREATE TABLE dbo.Dogs (
  12.    ID INT NOT NULL,
  13.    Edited DATETIME2 NOT NULL,
  14.    DogFood VARCHAR(8000) NOT NULL,
  15.    CatId INT NOT NULL,
  16.    CatEdited DATETIME2 NOT NULL,
  17.    CONSTRAINT PK_Dogs PRIMARY KEY (ID, Edited),
  18.    CONSTRAINT FK_Dogs_Cats_0 FOREIGN KEY (CatId, CatEdited) REFERENCES dbo.Cats (ID, ID)
  19. )
  20. GO

Line 19 is obviously wrong ,I think it should be:
  1. CONSTRAINT FK_Dogs_Cats_0 FOREIGN KEY (DogID, DogEdited) REFERENCES dbo.Cats


nHibernate is generating the correct output at "Schema Export" (and is working...)
  1. SchemaExport schemaExport = new SchemaExport(conf);
  2. schemaExport.Create(true, true);