From 9110df8bbad1eaf8672ba664e9640eadbdedd669 Mon Sep 17 00:00:00 2001 From: Guillaume HOMBERG Date: Thu, 14 Dec 2017 09:59:21 +0100 Subject: [PATCH] Fix: - missing procedures call - Remove duplicated line in migration procedure --- db-bootstrap/1_create_translations_tables.sql | 4 +++- db-bootstrap/3_fill translations_tables.sql | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/db-bootstrap/1_create_translations_tables.sql b/db-bootstrap/1_create_translations_tables.sql index 66ecdfc..67cb4a0 100644 --- a/db-bootstrap/1_create_translations_tables.sql +++ b/db-bootstrap/1_create_translations_tables.sql @@ -62,4 +62,6 @@ BEGIN ALTER TABLE `threats` ADD description_translation_id INT(11), ADD label_translation_id INT(11); ALTER TABLE `vulnerabilities` ADD description_translation_id INT(11), ADD label_translation_id INT(11); END;; -DELIMITER ; \ No newline at end of file +DELIMITER ; + +CALL add_new_translation_id_columns; \ No newline at end of file diff --git a/db-bootstrap/3_fill translations_tables.sql b/db-bootstrap/3_fill translations_tables.sql index ca1dd5b..2292a4a 100644 --- a/db-bootstrap/3_fill translations_tables.sql +++ b/db-bootstrap/3_fill translations_tables.sql @@ -2418,14 +2418,16 @@ CALL `duplicate_data_vulnerabilities`; -- Procedure to delete old hard-codded translations columns in tables +DROP PROCEDURE IF EXISTS delete_old_translation_columns; DELIMITER ;; CREATE PROCEDURE delete_old_translation_columns () BEGIN + ALTER TABLE anrs DROP COLUMN label1, DROP COLUMN label2, DROP COLUMN label3, DROP COLUMN label4, DROP COLUMN description1, DROP COLUMN description2, DROP COLUMN description3, DROP COLUMN description4; ALTER TABLE assets DROP COLUMN label1, DROP COLUMN label2, DROP COLUMN label3, DROP COLUMN label4, DROP COLUMN description1, DROP COLUMN description2, DROP COLUMN description3, DROP COLUMN description4; ALTER TABLE guides DROP COLUMN description1, DROP COLUMN description2, DROP COLUMN description3, DROP COLUMN description4; ALTER TABLE guides_items DROP COLUMN description1, DROP COLUMN description2, DROP COLUMN description3, DROP COLUMN description4; ALTER TABLE historicals DROP COLUMN label1, DROP COLUMN label2, DROP COLUMN label3, DROP COLUMN label4; - ALTER TABLE assets DROP COLUMN label1, DROP COLUMN label2, DROP COLUMN label3, DROP COLUMN label4, DROP COLUMN name1, DROP COLUMN name2, DROP COLUMN name3, DROP COLUMN name4; + ALTER TABLE instances DROP COLUMN label1, DROP COLUMN label2, DROP COLUMN label3, DROP COLUMN label4, DROP COLUMN name1, DROP COLUMN name2, DROP COLUMN name3, DROP COLUMN name4; ALTER TABLE measures DROP COLUMN description1, DROP COLUMN description2, DROP COLUMN description3, DROP COLUMN description4; ALTER TABLE models DROP COLUMN label1, DROP COLUMN label2, DROP COLUMN label3, DROP COLUMN label4, DROP COLUMN description1, DROP COLUMN description2, DROP COLUMN description3, DROP COLUMN description4; ALTER TABLE objects DROP COLUMN label1, DROP COLUMN label2, DROP COLUMN label3, DROP COLUMN label4, DROP COLUMN name1, DROP COLUMN name2, DROP COLUMN name3, DROP COLUMN name4; @@ -2442,3 +2444,4 @@ BEGIN END;; DELIMITER ; +CALL delete_old_translation_columns; \ No newline at end of file