mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 18:50:47 -04:00
Drop fk constraints on locks table
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
cc9825c70d
commit
5d2988e3bd
1 changed files with 9 additions and 0 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue