•  » Requests
  •  » Database primary/foreign key structure

#1 2025-04-25 13:42:03

AthLux
Member
2017-03-04
25

Database primary/foreign key structure

Hello,

Usage of foreign keys in database design would have, in my point of view, 2 benefits:
1) database itself would ensure that no record can be removed as long as it is still in use by another table
2) ErWin Tools like adminer (https://dbmstools.com/tools/adminer) could show the database design and it is easier to recognize the dependencies between tables

e.g.:
piwigo_image_category hold the information which images (image_id) should be shown in which album (category_id)
image_id should be a foreign key to id in piwigo_images and category_id should be a foreign key to id in piwigo_categories

(Copy here your environment details, found on your Piwigo page [Administration > Tools > Maintenance])
Piwigo 15.5.0 Prüfen, ob eine neue Version verfügbar ist.
Installiert auf 19 Februar 2017, vor 8 Jahre 2 Monate 5 Tage
Betriebssystem: Linux
PHP: 8.4.6 (Info anzeigen) [2025-04-25 11:37:42]
MySQL: 10.5.28-MariaDB-0+deb11u1 [2025-04-25 13:37:42]
Grafikbibliothek: External ImageMagick 6.9.11-60
Größe des Cache 22.34 Mo   berechnet vor 17 Minuten Aktualisieren

Offline

 
  •  » Requests
  •  » Database primary/foreign key structure

Board footer

Powered by FluxBB

github linkedin newsletter Piwigo.org © 2002-2026 · Contact