From 2c0de98cc08384788150df3fe55ff9cff7380cd3 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 21 May 2015 19:18:08 +0200 Subject: migration 14: Fix error if file was already renamed Signed-off-by: Florian Pritz --- application/migrations/014_deduplicate_file_storage.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'application') 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); + } } } -- cgit v1.2.3-24-g4f1b