Aggiunta chiave primaria per associazione attributi-articoli

This commit is contained in:
Dasc3er 2021-09-01 17:55:34 +02:00
parent ff3ff06faf
commit 15e80de184
1 changed files with 1 additions and 0 deletions

View File

@ -54,6 +54,7 @@ CREATE TABLE IF NOT EXISTS `mg_articolo_attributo` (
`id_valore` int(11) NOT NULL, `id_valore` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY(`id_articolo`, `id_valore`),
FOREIGN KEY (`id_articolo`) REFERENCES `mg_articoli`(`id`), FOREIGN KEY (`id_articolo`) REFERENCES `mg_articoli`(`id`),
FOREIGN KEY (`id_valore`) REFERENCES `mg_valori_attributi`(`id`) FOREIGN KEY (`id_valore`) REFERENCES `mg_valori_attributi`(`id`)
) ENGINE=InnoDB; ) ENGINE=InnoDB;