diff --git a/bindings/java/src/org/sleuthkit/datamodel/SleuthkitCase.java b/bindings/java/src/org/sleuthkit/datamodel/SleuthkitCase.java index 5728f9ba43d1b718ca5ea5390ed127647619ed1d..916eb1968e7ffa3261446c5d71c2fb302ccfb7ce 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/SleuthkitCase.java +++ b/bindings/java/src/org/sleuthkit/datamodel/SleuthkitCase.java @@ -2130,13 +2130,20 @@ private CaseDbSchemaVersionNumber updateFromSchema8dot4toSchema8dot5(CaseDbSchem if (resultSet != null && resultSet.next()) { int tagSetId = resultSet.getInt(1); - String updateQuery = "UPDATE tag_names SET tag_set_id = %d, color = '%s', rank = %d WHERE display_name = '%s'"; - statement.executeUpdate(String.format(updateQuery, tagSetId, "Red", 1, "CAT-1: Child Exploitation (Illegal)")); - statement.executeUpdate(String.format(updateQuery, tagSetId, "Lime", 2, "CAT-2: Child Exploitation (Non-Illegal/Age Difficult)")); - statement.executeUpdate(String.format(updateQuery, tagSetId, "Yellow", 3, "CAT-3: CGI/Animation (Child Exploitive)")); - statement.executeUpdate(String.format(updateQuery, tagSetId, "Purple", 4, "CAT-4: Exemplar/Comparison (Internal Use Only)")); - statement.executeUpdate(String.format(updateQuery, tagSetId, "Green", 5, "CAT-5: Non-pertinent")); - statement.executeUpdate(String.format(updateQuery, tagSetId, "Silver", 0, "CAT-0: Uncategorized", 0)); + String updateQuery = "UPDATE tag_names SET tag_set_id = %d, color = '%s', rank = %d, display_name = '%s' WHERE display_name = '%s'"; + statement.executeUpdate(String.format(updateQuery, tagSetId, "Red", 1, "Child Exploitation (Illegal)", "CAT-1: Child Exploitation (Illegal)")); + statement.executeUpdate(String.format(updateQuery, tagSetId, "Lime", 2, "Child Exploitation (Non-Illegal/Age Difficult)", "CAT-2: Child Exploitation (Non-Illegal/Age Difficult)")); + statement.executeUpdate(String.format(updateQuery, tagSetId, "Yellow", 3, "CGI/Animation (Child Exploitive)", "CAT-3: CGI/Animation (Child Exploitive)")); + statement.executeUpdate(String.format(updateQuery, tagSetId, "Purple", 4, "Exemplar/Comparison (Internal Use Only)", "CAT-4: Exemplar/Comparison (Internal Use Only)")); + statement.executeUpdate(String.format(updateQuery, tagSetId, "Fuchsia", 5, "Non-pertinent", "CAT-5: Non-pertinent")); + + String deleteContentTag = "DELETE FROM content_tags WHERE tag_name_id IN (SELECT tag_name_id from tag_names WHERE display_name LIKE 'CAT-0: Uncategorized')"; + String deleteArtifactTag = "DELETE FROM blackboard_artifact_tags WHERE tag_name_id IN (SELECT tag_name_id from tag_names WHERE display_name LIKE 'CAT-0: Uncategorized')"; + String deleteCat0 = "DELETE FROM tag_names WHERE display_name = 'CAT-0: Uncategorized'"; + statement.executeUpdate(deleteContentTag); + statement.executeUpdate(deleteArtifactTag); + statement.executeUpdate(deleteCat0); + } else { throw new TskCoreException("Failed to retrieve the default tag_set_id from DB"); }