Data Generator - Foreign Keys

Discussion of open issues, suggestions and bugs regarding database management and administration tools for MySQL
Post Reply
cdunn66
Posts: 5
Joined: Mon 24 May 2021 05:02

Data Generator - Foreign Keys

Post by cdunn66 » Mon 24 May 2021 05:18

Trying to generate values for a data table which has a column which is a foreign key to a status table.

Now the status table is already pre-populated but for some reason the data generation for the data table won't refer to this table but insists that we also generate data for this status table within the tool.

Do you know how I can tell the tool to read from the database rather than insisting on creating this data itself.

dzhanhira
Devart Team
Posts: 239
Joined: Mon 26 Oct 2020 13:49

Re: Data Generator - Foreign Keys

Post by dzhanhira » Mon 24 May 2021 08:06

It is necessary for such columns under Foreign Key to use not a Foreign Key generator, but a Table Or View generator.
In this case, the generator will take values for the table's children from the existing dataset in the parent one.

cdunn66
Posts: 5
Joined: Mon 24 May 2021 05:02

Re: Data Generator - Foreign Keys

Post by cdunn66 » Tue 25 May 2021 05:22

Many thanks for this response. Yes, I have converted my generator to use Tables and not Foreign Keys in these instances and it works a treat now.

Post Reply