summaryrefslogtreecommitdiffstats
path: root/application/migrations
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-05-21 19:18:08 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-05-21 19:18:08 +0200
commit2c0de98cc08384788150df3fe55ff9cff7380cd3 (patch)
treef2c5faa1a323253088097f0b00f5805c1d39ab6d /application/migrations
parent010a689cd022e130b7ef9ebc58e96bf0fbca6dfd (diff)
migration 14: Fix error if file was already renamed
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/migrations')
-rw-r--r--application/migrations/014_deduplicate_file_storage.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/application/migrations/014_deduplicate_file_storage.php b/application/migrations/014_deduplicate_file_storage.php
index d01ab03a9..bc4171d1d 100644
--- a/application/migrations/014_deduplicate_file_storage.php
+++ b/application/migrations/014_deduplicate_file_storage.php
@@ -51,7 +51,9 @@ class Migration_deduplicate_file_storage extends CI_Migration {
$old = $this->mfile->file($item["hash"]);
$data_id = $item["hash"].'-'.$item["id"];
$new = $this->mfile->file($data_id);
- rename($old, $new);
+ if (file_exists($old)) {
+ rename($old, $new);
+ }
}
}