Blame view

database/update/script_sql/db-update-2016-06-07.sql 854 Bytes
97276a4a   Etienne Pallier   Mise à jour page ...
1
2
3
4
5
6
use database;

-- On execute TOUT ou RIEN
START TRANSACTION;


4fd23929   Alexandre   Version: 2.5.0
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
DROP TABLE IF EXISTS `documents`;
CREATE TABLE IF NOT EXISTS `documents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type_doc` varchar(20) DEFAULT NULL,
  `description` varchar(100) DEFAULT NULL,
  `chemin` varchar(100) DEFAULT NULL,
  `materiel_id` int(11) DEFAULT NULL,
  `suivi_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_documents_materiel_id` (`materiel_id`),
  KEY `fk_documents_suivi_id` (`suivi_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

ALTER TABLE `documents`
  ADD CONSTRAINT `fk_documents_materiel_id` FOREIGN KEY (`materiel_id`) REFERENCES `materiels` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_documents_suivi_id` FOREIGN KEY (`suivi_id`) REFERENCES `suivis` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
97276a4a   Etienne Pallier   Mise à jour page ...
23
24

COMMIT;