Commit 73c4199cb014f8ee00b2f4587a24704a3228f515

Authored by Alexandre
1 parent f6132986

bugfixes

Showing 1 changed file with 7 additions and 5 deletions   Show diff stats
database/update/script_sql/db-update-2016-06-27.sql
1 1 use database;
2 2  
3   -ALTER TABLE `documents` DROP `chemin`;
4   -ALTER TABLE `documents` DROP `description`;
  3 +ALTER TABLE `documents` ADD `type_document_id` int(11) DEFAULT 1;
5 4  
6 5 CREATE TABLE IF NOT EXISTS `type_documents` (
7 6 `id` int(11) NOT NULL AUTO_INCREMENT,
... ... @@ -9,13 +8,16 @@ CREATE TABLE IF NOT EXISTS `type_documents` (
9 8 PRIMARY KEY (`id`)
10 9 );
11 10  
12   -Insert into type_documents(id, nom) values (1, 'N/A');
  11 +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;
  12 +
  13 +ALTER TABLE `documents` DROP `chemin`;
  14 +ALTER TABLE `documents` DROP `description`;
13 15  
14   -ALTER TABLE `documents` ADD `type_document_id` int(11) DEFAULT 1;
15 16 ALTER TABLE `documents` ADD `description` text DEFAULT NULL;
16 17 ALTER TABLE `documents` ADD `nom` VARCHAR(100) DEFAULT NULL;
17 18  
18   -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;
19 19  
20 20 DROP TABLE IF EXISTS `fichiers`;
21 21 DROP TABLE IF EXISTS `utilisateurs`;
  22 +
  23 +Insert into type_documents(id, nom) values (1, 'N/A');
... ...