Blame view

database/update/script_sql/db-update-2016-06-27.sql 947 Bytes
9b4da83b   Alexandre   Version: 2.5.0.0
1
2
use database;

7cc1b02e   Alexandre   bugfixes
3
4
set foreign_key_checks=0;

97276a4a   Etienne Pallier   Mise à jour page ...
5
6
7
-- On execute TOUT ou RIEN
START TRANSACTION;

7cc1b02e   Alexandre   bugfixes
8
ALTER TABLE `documents` ADD `type_document_id` int(11) DEFAULT NULL;
9b4da83b   Alexandre   Version: 2.5.0.0
9

f6132986   Alexandre   maj db-update-201...
10
CREATE TABLE IF NOT EXISTS `type_documents` (
9b4da83b   Alexandre   Version: 2.5.0.0
11
12
13
14
15
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nom` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
);

a7a6c329   Alexandre   bugfixes
16
17
18
19
ALTER TABLE type_documents ENGINE=innoDB;
ALTER TABLE users ENGINE=innoDB;
ALTER TABLE configurations ENGINE=innoDB;

73c4199c   Alexandre   bugfixes
20
21
22
23
ALTER TABLE `documents` ADD CONSTRAINT `fk_documents_type_documents_id` FOREIGN KEY (`type_document_id`) REFERENCES `type_documents` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

ALTER TABLE `documents` DROP `chemin`;
ALTER TABLE `documents` DROP `description`;
9b4da83b   Alexandre   Version: 2.5.0.0
24

9b4da83b   Alexandre   Version: 2.5.0.0
25
26
27
ALTER TABLE `documents` ADD `description` text DEFAULT NULL;
ALTER TABLE `documents` ADD `nom` VARCHAR(100) DEFAULT NULL;

9b4da83b   Alexandre   Version: 2.5.0.0
28
29
30

DROP TABLE IF EXISTS `fichiers`;
DROP TABLE IF EXISTS `utilisateurs`;
73c4199c   Alexandre   bugfixes
31
32

Insert into type_documents(id, nom) values (1, 'N/A');
97276a4a   Etienne Pallier   Mise à jour page ...
33
34

COMMIT;