1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| CREATE TABLE fiche (
id_fiche int unsigned NOT NULL auto_increment,
date_entree date NOT NULL,
date_prevue date NOT NULL,
date_sortie date,
date_fin date,
priorite varchar(6) NOT NULL,
mdp varchar(30) NOT NULL,
probleme text NOT NULL,
etat varchar(30) NOT NULL,
intervention text NOT NULL,
garantie varchar(6) NOT NULL,
pieces_jointes varchar(255),
sacoche bool NOT NULL default '0',
id_client int unsigned NOT NULL,
id_commercial int unsigned NOT NULL,
id_technicien int unsigned NOT NULL,
PRIMARY KEY (id_fiche),
KEY fk_idclient (id_client),
KEY fk_idcom (id_commercial),
KEY fk_idtech (id_technicien),
CONSTRAINT fk_idclient FOREIGN KEY (id_client) REFERENCES client(id_client),
CONSTRAINT fk_idcom FOREIGN KEY (id_commercial) REFERENCES employe(id_employe),
CONSTRAINT fk_idtech FOREIGN KEY (id_technicien) REFERENCES employe(id_employe)
) TYPE=InnoDB; |
Partager