summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-07-16 12:55:28 +0200
committerRobin Appelman <icewind@owncloud.com>2015-08-03 14:13:36 +0200
commit96a9d171b3fc31a6ad1ed89dca987765ed1ce721 (patch)
treea51669e20e585a0347ad4cf018b57c3cebd31ad5 /lib
parent86acd535c243569fda7c1a2957073509c7e94f89 (diff)
downloadnextcloud-server-96a9d171b3fc31a6ad1ed89dca987765ed1ce721.tar.gz
nextcloud-server-96a9d171b3fc31a6ad1ed89dca987765ed1ce721.zip
Fix db schema
Diffstat (limited to 'lib')
-rw-r--r--lib/private/lock/abstractlockingprovider.php2
-rw-r--r--lib/private/lock/dblockingprovider.php16
-rw-r--r--lib/repair/dropoldtables.php1
3 files changed, 9 insertions, 10 deletions
diff --git a/lib/private/lock/abstractlockingprovider.php b/lib/private/lock/abstractlockingprovider.php
index 290bb77e52f..03b4912ea13 100644
--- a/lib/private/lock/abstractlockingprovider.php
+++ b/lib/private/lock/abstractlockingprovider.php
@@ -1,8 +1,6 @@
<?php
/**
- * @author Morris Jobke <hey@morrisjobke.de>
* @author Robin Appelman <icewind@owncloud.com>
- * @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2015, ownCloud, Inc.
* @license AGPL-3.0
diff --git a/lib/private/lock/dblockingprovider.php b/lib/private/lock/dblockingprovider.php
index 70f4539eb28..aee66bca745 100644
--- a/lib/private/lock/dblockingprovider.php
+++ b/lib/private/lock/dblockingprovider.php
@@ -38,7 +38,7 @@ class DBLockingProvider extends AbstractLockingProvider {
}
protected function initLockField($path) {
- $this->connection->insertIfNotExist('*PREFIX*locks', ['path' => $path, 'lock' => 0], ['path']);
+ $this->connection->insertIfNotExist('*PREFIX*file_locks', ['path' => $path, 'lock' => 0], ['path']);
}
/**
@@ -47,7 +47,7 @@ class DBLockingProvider extends AbstractLockingProvider {
* @return bool
*/
public function isLocked($path, $type) {
- $query = $this->connection->prepare('SELECT `lock` from `*PREFIX*locks` WHERE `path` = ?');
+ $query = $this->connection->prepare('SELECT `lock` from `*PREFIX*file_locks` WHERE `path` = ?');
$query->execute([$path]);
$lockValue = (int)$query->fetchColumn();
if ($type === self::LOCK_SHARED) {
@@ -68,12 +68,12 @@ class DBLockingProvider extends AbstractLockingProvider {
$this->initLockField($path);
if ($type === self::LOCK_SHARED) {
$result = $this->connection->executeUpdate(
- 'UPDATE `*PREFIX*locks` SET `lock` = `lock` + 1 WHERE `path` = ? AND `lock` >= 0',
+ 'UPDATE `*PREFIX*file_locks` SET `lock` = `lock` + 1 WHERE `path` = ? AND `lock` >= 0',
[$path]
);
} else {
$result = $this->connection->executeUpdate(
- 'UPDATE `*PREFIX*locks` SET `lock` = -1 WHERE `path` = ? AND `lock` = 0',
+ 'UPDATE `*PREFIX*file_locks` SET `lock` = -1 WHERE `path` = ? AND `lock` = 0',
[$path]
);
}
@@ -91,12 +91,12 @@ class DBLockingProvider extends AbstractLockingProvider {
$this->initLockField($path);
if ($type === self::LOCK_SHARED) {
$this->connection->executeUpdate(
- 'UPDATE `*PREFIX*locks` SET `lock` = `lock` - 1 WHERE `path` = ? AND `lock` > 0',
+ 'UPDATE `*PREFIX*file_locks` SET `lock` = `lock` - 1 WHERE `path` = ? AND `lock` > 0',
[$path]
);
} else {
$this->connection->executeUpdate(
- 'UPDATE `*PREFIX*locks` SET `lock` = 0 WHERE `path` = ? AND `lock` = -1',
+ 'UPDATE `*PREFIX*file_locks` SET `lock` = 0 WHERE `path` = ? AND `lock` = -1',
[$path]
);
}
@@ -114,12 +114,12 @@ class DBLockingProvider extends AbstractLockingProvider {
$this->initLockField($path);
if ($targetType === self::LOCK_SHARED) {
$result = $this->connection->executeUpdate(
- 'UPDATE `*PREFIX*locks` SET `lock` = 1 WHERE `path` = ? AND `lock` = -1',
+ 'UPDATE `*PREFIX*file_locks` SET `lock` = 1 WHERE `path` = ? AND `lock` = -1',
[$path]
);
} else {
$result = $this->connection->executeUpdate(
- 'UPDATE `*PREFIX*locks` SET `lock` = -1 WHERE `path` = ? AND `lock` = 1',
+ 'UPDATE `*PREFIX*file_locks` SET `lock` = -1 WHERE `path` = ? AND `lock` = 1',
[$path]
);
}
diff --git a/lib/repair/dropoldtables.php b/lib/repair/dropoldtables.php
index 89f872e16cc..cfe0df6cb5b 100644
--- a/lib/repair/dropoldtables.php
+++ b/lib/repair/dropoldtables.php
@@ -76,6 +76,7 @@ class DropOldTables extends BasicEmitter implements RepairStep {
'calendar_share_event',
'foldersize',
'fscache',
+ 'locks',
'log',
'media_albums',
'media_artists',