Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-09-25 10:12:26 +0300
committerJulius Härtl <jus@bitgrid.net>2020-09-25 12:06:15 +0300
commit5cb8454f23db2d7de1eab8f867c7bcef247df8a6 (patch)
tree711e93dc26d685c119a40f09cf0cad9fc056697c
parentfd2b5e40dbe2503a73cf47c3703c470b0a1b745b (diff)
Drop fk constraints on locks tablestable20-10.5
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--lib/private/Repair/Owncloud/SaveAccountsTableData.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/Repair/Owncloud/SaveAccountsTableData.php b/lib/private/Repair/Owncloud/SaveAccountsTableData.php
index 6ca46934d71..89c331a7d71 100644
--- a/lib/private/Repair/Owncloud/SaveAccountsTableData.php
+++ b/lib/private/Repair/Owncloud/SaveAccountsTableData.php
@@ -78,6 +78,15 @@ class SaveAccountsTableData implements IRepairStep {
$numUsers = $this->runStep($offset);
}
+ // oc_persistent_locks will be removed later on anyways so we can just drop and ignore any foreign key constraints here
+ $tableName = $this->config->getSystemValue('dbtableprefix', 'oc_') . 'persistent_locks';
+ $schema = $this->db->createSchema();
+ $table = $schema->getTable($tableName);
+ foreach ($table->getForeignKeys() as $foreignKey) {
+ $table->removeForeignKey($foreignKey->getName());
+ }
+ $this->db->migrateToSchema($schema);
+
// Remove the table
if ($this->hasForeignKeyOnPersistentLocks) {
$this->db->dropTable('persistent_locks');