Bug in relation creation when adding table to schema

Just hit a snag when adding tables to a schema. It appears that, if the table has two foreign key relations to the same table then the creation of the relation fails. I’d assume this is because the relations are named with the table names only, not the field names, so it’s try to create two relations with the same name. Obviously I can correct it manually but needs fixing really.

Hello

Thank you for reporting this.
Could you please send to support@ DDL for these 2 tables so we’ll be able to explicitly reproduce the issue and to fix it?

Thanks in advance

I’m using MSSQL. Just create a new database and use this script to create two tables:

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [Table2](
[Id] [int] NOT NULL,
CONSTRAINT [PK_Table2] PRIMARY KEY CLUSTERED
(
[Id] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [Table1](
[Id] [int] NOT NULL,
[ForeignId1] [int] NOT NULL,
[ForeignId2] [int] NOT NULL,
CONSTRAINT [PK_Table1] PRIMARY KEY CLUSTERED
(
[Id] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [Table1] WITH CHECK ADD CONSTRAINT [FK_Table1_Table2_A] FOREIGN KEY([ForeignId1])
REFERENCES [Table2] ([Id])
GO
ALTER TABLE [Table1] CHECK CONSTRAINT [FK_Table1_Table2_A]
GO
ALTER TABLE [Table1] WITH CHECK ADD CONSTRAINT [FK_Table1_Table2_B] FOREIGN KEY([ForeignId2])
REFERENCES [Table2] ([Id])
GO
ALTER TABLE [Table1] CHECK CONSTRAINT [FK_Table1_Table2_B]
GO

Then drag both tables into a DA Schema and it’ll throw the error. Will forward to support@ also.

Btw which exactly DA version and DB access driver did you use?

I’m using DA 8.3.93.1183 with Delphi XE6 Professional.

I’m using FireDAC with the FireDAC C/S addon for Delphi Pro.

Toby Groves
Software Developer
Clarity Software

(t) +44 (0)121 248 2448
(f) +44 (0)121 248 2450
Web: www.clarity-software.comhttp://www.claritypro.com/
Twitter: @clarityprohttp://www.twitter.com/claritypro

[Description: clarity-software-logo-150px-rgb-white]

This email contains information which may be confidential. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) do not copy this communication, or disclose it to any other person. If you have received this email in error please notify the sender immediately, delete the message from your computer system and destroy any copies. Clarity Professional Software is a trading name of Touch Systems Ltd. Except where this email is sent in the usual course of our business, any views or opinions presented are solely those of the author and do not necessarily represent those of Touch Systems Limited. Although Touch Systems Limited operates anti-virus programs, it does not accept responsibility for any damage whatsoever that is caused by viruses being passed. Replies to this email may be monitored and/or recorded by Touch Systems Limited for operational or business reasons. Touch Systems Limited. Registered in England and Wales. Registered No. 02430509. Registered office: The Exchange, Haslucks Green Road, Shirley, Solihull, West Midlands, B90 2EL. Head Office :7 The Pavilions, Cranmore Drive, Solihull, West Midlands, B90 4SB, UK.

Thanks, logged as bugs://76524

What’s the status of this bug? How can i fix it manuall, because i don’t have the time to search it my self.
Thanks in advance.

Its fix is scheduled for the next release of Data Abstract

ok, thank you very much

Hello again,

today i’ve installed the 9.2.103.1311 and it’s still an issue.
in what version it is scheduled to be solved?

Thanks in advance

Any update on the issue?

An update will be posted once the status of the issue changes. It is considered as a low-priority one.

The same happens when you try to refresh the relashionships from the schema manager. If you’ve upgraded from earlier version and you try to open the schema manager it fails an the only thing you can do is to delete all relationships or loop delete the relationship that issues the error and try to open the schema manager again. As we relly on relationships to enforse master detail key updates, i must re-enter all relationships, im my case 358, by hand, when in 6.0.49 worked just fine. This is not a low-priority, at least for us.

Hmm. Sounds bad, yes (IIRC it was not clear that it is almost a showstopper for you, so it was given a low priority). I’ve increased priority for this issue so I’ll start to work on it in a day or two.

bugs://76524 got closed with status fixed.

Hello

Next Beta build will have the required fix.

Relations will use their db-defined names where possible (both in the Schema Modeler and when a new project is created). Also relations refresh logic has been updated.

Regards

1 Like

Thank you very much…

Logged as bugs://i64407.

bugs://i64407 was closed as fixed.