summaryrefslogtreecommitdiff
path: root/app/models/project_statistics.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/project_statistics.rb')
-rw-r--r--app/models/project_statistics.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/project_statistics.rb b/app/models/project_statistics.rb
index 1d8e72c902a..55c7c6ab682 100644
--- a/app/models/project_statistics.rb
+++ b/app/models/project_statistics.rb
@@ -75,7 +75,12 @@ class ProjectStatistics < ApplicationRecord
end
def update_storage_size
- self.storage_size = repository_size + wiki_size + lfs_objects_size + build_artifacts_size + packages_size + snippets_size
+ storage_size = repository_size + wiki_size + lfs_objects_size + build_artifacts_size + packages_size
+ # The `snippets_size` column was added on 20200622095419 but db/post_migrate/20190527194900_schedule_calculate_wiki_sizes.rb
+ # might try to update project statistics before the `snippets_size` column has been created.
+ storage_size += snippets_size if self.class.column_names.include?('snippets_size')
+
+ self.storage_size = storage_size
end
# Since this incremental update method does not call update_storage_size above,