diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-09-25 09:12:26 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-12-09 12:13:32 +0100 |
commit | 7518f67f33af5b90721c898367b0f3a569201a14 (patch) | |
tree | 7b561014cd8f830d50dcd4a9fa96d7d0848e3bf0 /lib | |
parent | 96071d7b7723b5002fc111370868b9c181d394ad (diff) | |
download | nextcloud-server-7518f67f33af5b90721c898367b0f3a569201a14.tar.gz nextcloud-server-7518f67f33af5b90721c898367b0f3a569201a14.zip |
Drop fk constraints on locks table
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Repair/Owncloud/SaveAccountsTableData.php | 9 |
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'); |