diff --git a/migration/21.04/2104.sql b/migration/21.04/2104.sql
index c59f7502adf7f5b9d4c13093b13d1ab0c85280c7..ddc747c6258e0d2d9bcb8ff5a4c1a841caf775e4 100644
--- a/migration/21.04/2104.sql
+++ b/migration/21.04/2104.sql
@@ -24,3 +24,5 @@ CREATE TABLE attachment_types
     CONSTRAINT attachment_types_unique_key UNIQUE (type_id)
 )
 WITH (OIDS=FALSE);
+
+UPDATE history_batch SET total_errors = 0 WHERE total_errors IS NULL;