Parent/Child relation without ID PK?

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
DevGiu
AppGini Super Hero
AppGini Super Hero
Posts: 151
Joined: 2016-05-27 09:08

Parent/Child relation without ID PK?

Post by DevGiu » 2016-05-29 18:51

Hi,

I have 2 tables.
Table 1:
id
code
name
company

table 2:
id
code
table1code
company

The problem is, I want to reference table2->table1code with table1->code, not with table1->id, and AppGini forces me to link over ID PK.
For optimization, MySQL has autonumeric, but if I reference with this, I enter into problems importing/exporting data. For example, If I try to export invoices, and try to import on another instance of the application, autonumeric could be different, and I will lose the reference between parent/child.
For this reason, I need to have a stable value to reference.

Maybe I have my mind locked, and probably there are something obvious I don't see right now (for sure, too much hours working this week) but I don't see any efficient way to do this.
/Giuseppe
Professional Outsourcing Services

Post Reply