Foreign Key and Unique Key at the same time

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
AhmedBR
AppGini Super Hero
AppGini Super Hero
Posts: 327
Joined: 2013-09-19 10:23

Foreign Key and Unique Key at the same time

Post by AhmedBR » 2013-10-19 09:21

Problem:
AppGini does not allow a field to be Foreign Key and Unique Key at the same time.
Unique.gif
Unique.gif (7.57 KiB) Viewed 4963 times
Solution:
Set the field as Foreign in AppGini
Set the field as Unique in PhpMyAdmin

Problem solved.
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper

User avatar
a.gneady
Site Admin
Posts: 1354
Joined: 2012-09-27 14:46
Contact:

Re: Foreign Key and Unique Key at the same time

Post by a.gneady » 2013-10-20 17:05

I'll modify this restriction in future releases ... notice that this (foreign key AND unique) would create a one-to-one relation between the two tables rather than one-to-many.
:idea: AppGini plugins to add more power to your apps:

AhmedBR
AppGini Super Hero
AppGini Super Hero
Posts: 327
Joined: 2013-09-19 10:23

Re: Foreign Key and Unique Key at the same time

Post by AhmedBR » 2013-10-20 18:01

Thanks for alerting about this.
But in my case it is exactly what I need to do in this table. ;)
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper

Post Reply