Commit 7cc1b02e3a5566e0c0be67a529d69e9ebef32fb7

Authored by Alexandre
1 parent fe672157

bugfixes

database/labinvent_2.1_12-05-16.sql
... ... @@ -77,10 +77,10 @@ CREATE TABLE IF NOT EXISTS `documents` (
77 77 `nom` VARCHAR(100) DEFAULT NULL,
78 78 `materiel_id` int(11) DEFAULT NULL,
79 79 `suivi_id` int(11) DEFAULT NULL,
80   - `type_document_id` int(11) DEFAULT 1,
  80 + `type_document_id` int(11) DEFAULT NULL,
81 81 PRIMARY KEY (`id`),
82 82 KEY `fk_documents_materiel_id` (`materiel_id`),
83   - KEY `fk_documents_suivi_id` (`suivi_id`)
  83 + KEY `fk_documents_suivi_id` (`suivi_id`),
84 84 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
85 85  
86 86 -- --------------------------------------------------------
... ...
database/update/script_sql/.gitignore
1   -/db-update-2016-06-20-build.sql
  1 +/*-build.sql
2 2 /db-update-2016-06-24-build.sql
3   -/db-update-2016-06-24-2.sql~
  3 +/*~
4 4 /db-update-2016-06-24-2-build.sql
... ...
database/update/script_sql/db-update-2016-06-27-irap.sql
1 1 use database;
2 2  
  3 +set foreign_key_checks=0;
  4 +
  5 +ALTER TABLE `documents` DROP `type_document_id`;
  6 +
  7 +ALTER TABLE `documents` ADD `type_document_id` int(11) DEFAULT NULL;
3 8 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;
4 9  
... ...
database/update/script_sql/db-update-2016-06-27.sql
1 1 use database;
2 2  
3   -ALTER TABLE `documents` ADD `type_document_id` int(11) DEFAULT 1;
  3 +set foreign_key_checks=0;
  4 +
  5 +ALTER TABLE `documents` ADD `type_document_id` int(11) DEFAULT NULL;
4 6  
5 7 CREATE TABLE IF NOT EXISTS `type_documents` (
6 8 `id` int(11) NOT NULL AUTO_INCREMENT,
... ...