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