diff --git a/db/migrations/5.9.1_add_prevent_root_folder_upload_by_students_in_courses_config.php b/db/migrations/6.0.14_add_prevent_root_folder_upload_by_students_in_courses_config.php
similarity index 81%
rename from db/migrations/5.9.1_add_prevent_root_folder_upload_by_students_in_courses_config.php
rename to db/migrations/6.0.14_add_prevent_root_folder_upload_by_students_in_courses_config.php
index 83377ce5a2d75e2d1c1d6ff1391615baa58332a7..d21c9ade11877ba682adcae6357bba207318f3de 100644
--- a/db/migrations/5.9.1_add_prevent_root_folder_upload_by_students_in_courses_config.php
+++ b/db/migrations/6.0.14_add_prevent_root_folder_upload_by_students_in_courses_config.php
@@ -20,6 +20,9 @@ class AddPreventRootFolderUploadByStudentsInCoursesConfig extends Migration
             UNIX_TIMESTAMP(), UNIX_TIMESTAMP(),
             'Studierende können im Dateibereich einer Veranstaltung auf der Ebene des Hauptordners keine Dateien hochladen.')"
         );
+        //This migration initially had the number 5.9.1 when it went into the main branch.
+        //To fix this error, the migration branch must be deleted:
+        DBManager::get()->exec("DELETE FROM `schema_version` WHERE `branch` = '5.9'");
     }
 
     protected function down()