diff --git a/templates/setup-apps-configmap.yaml b/templates/setup-apps-configmap.yaml
index 557f1372184b3cf779eb94d8be2829cdda66a774..3e9bc1b9ecc95a291b820a91832d72e4a39083fa 100644
--- a/templates/setup-apps-configmap.yaml
+++ b/templates/setup-apps-configmap.yaml
@@ -168,6 +168,8 @@ data:
     run_as "php $occ db:add-missing-columns --no-interaction"
     run_as "php $occ db:add-missing-primary-keys --no-interaction"
     run_as "php $occ db:convert-filecache-bigint --no-interaction"
+    echo "Running maintenance:repair, this can take a long time."
+    run_as "php $occ maintenance:repair --include-expensive --no-interaction"
 
     {{- if .Values.scim.token }}
     run_as "php $occ config:app:set scimserviceprovider jwt-secret --value="'"{{ .Values.scim.token }}"'