diff --git a/database/update/script_sql/db-update-2016-06-27.sql b/database/update/script_sql/db-update-2016-06-27.sql index 3e864c0..9509896 100755 --- a/database/update/script_sql/db-update-2016-06-27.sql +++ b/database/update/script_sql/db-update-2016-06-27.sql @@ -3,7 +3,7 @@ use database; ALTER TABLE `documents` DROP `chemin`; ALTER TABLE `documents` DROP `description`; -CREATE TABLE `type_documents` ( +CREATE TABLE IF NOT EXISTS `type_documents` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nom` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`) @@ -15,8 +15,7 @@ ALTER TABLE `documents` ADD `type_document_id` int(11) DEFAULT 1; ALTER TABLE `documents` ADD `description` text DEFAULT NULL; ALTER TABLE `documents` ADD `nom` VARCHAR(100) DEFAULT NULL; -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` ADD CONSTRAINT `fk_documents_type_documents_id` FOREIGN KEY (`type_document_id`) REFERENCES `type_documents` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; DROP TABLE IF EXISTS `fichiers`; DROP TABLE IF EXISTS `utilisateurs`; -- libgit2 0.21.2