[BUG] No schema at foreign key references (v4.0.30)

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
r.heuschkel@ibitech.com
Posts: 14
Joined: Mon 22 Aug 2011 15:44

[BUG] No schema at foreign key references (v4.0.30)

Post by r.heuschkel@ibitech.com » Mon 22 Aug 2011 16:05

If I use a different database schema for my generated storage objects the sql scripting engine (for SQL Server 2008 in my case) forgets to add that schema in front of the table names in foreign key references.

Example:

Code: Select all

-- 
-- Creating a table ibi.tblKunden 
-- 
CREATE TABLE ibi.tblKunden (
   KN_PN_GUID UNIQUEIDENTIFIER NOT NULL,
   KN_ID VARCHAR(MAX) NOT NULL,
   CONSTRAINT PK_tblKunden PRIMARY KEY (KN_PN_GUID),
   CONSTRAINT FK_tblKunden_tblPersonen_0 FOREIGN KEY (KN_PN_GUID) REFERENCES tblPersonen (PN_GUID)
While the schema 'ibi' is correctly added in front of 'tblKunden' for the CREATE statement, it is missing in front of 'tblPersonen' in the REFERENCES part at the end. So if my DB user doesn't have 'ibi' as its default schema, the script will fail because the DB can't find the table 'tblPersonen'.

The corrected script looks like that and runs fine:

Code: Select all

-- 
-- Creating a table ibi.tblKunden 
-- 
CREATE TABLE ibi.tblKunden (
   KN_PN_GUID UNIQUEIDENTIFIER NOT NULL,
   KN_ID VARCHAR(MAX) NOT NULL,
   CONSTRAINT PK_tblKunden PRIMARY KEY (KN_PN_GUID),
   CONSTRAINT FK_tblKunden_tblPersonen_0 FOREIGN KEY (KN_PN_GUID) REFERENCES ibi.tblPersonen (PN_GUID)

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Wed 24 Aug 2011 16:10

We have reproduced this issue, we will post here when it is fixed.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Fri 07 Oct 2011 09:39

This issue is fixed, the fix is available in the latest 4.1.55 build of Entity Developer (and in the new builds of data providers as well). The new build of Entity Developer can be downloaded from
http://www.devart.com/entitydeveloper/download.html
(the trial and free versions only) or from Registered Users' Area (for users with active subscription only).

For more information about the fixes and improvements available in the new build, please refer to
http://www.devart.com/forums/viewtopic.php?t=22169

Post Reply