summaryrefslogtreecommitdiffstats
path: root/application/migrations/015_actually_deduplicate_file_storage.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-05-22 11:10:19 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-05-22 11:10:19 +0200
commit7525386dccf23434eb0751d8ca5f6d1a17e47f49 (patch)
tree64dffa3d20a2bcc1274805f17bafdda9ff829baf /application/migrations/015_actually_deduplicate_file_storage.php
parent2c566fe8da9b2463c3376bafb24bc7428ab341a3 (diff)
Fix missing db prefix in migration0.9.0
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/migrations/015_actually_deduplicate_file_storage.php')
-rw-r--r--application/migrations/015_actually_deduplicate_file_storage.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/application/migrations/015_actually_deduplicate_file_storage.php b/application/migrations/015_actually_deduplicate_file_storage.php
index 8f2a51c74..2fea26dab 100644
--- a/application/migrations/015_actually_deduplicate_file_storage.php
+++ b/application/migrations/015_actually_deduplicate_file_storage.php
@@ -13,18 +13,18 @@ class Migration_actually_deduplicate_file_storage extends CI_Migration {
} else {
// XXX: This query also exists in migration 14
$this->db->query('
- DELETE file_storage
- FROM file_storage
- LEFT OUTER JOIN files ON files.file_storage_id = file_storage.id
- WHERE file_storage.id NOT IN (
+ DELETE `'.$prefix.'file_storage`
+ FROM `'.$prefix.'file_storage`
+ LEFT OUTER JOIN `'.$prefix.'files` ON `'.$prefix.'files`.file_storage_id = `'.$prefix.'file_storage`.id
+ WHERE `'.$prefix.'file_storage`.id NOT IN (
SELECT min(x.id)
FROM (
SELECT fs.id, fs.hash
- FROM file_storage fs
+ FROM `'.$prefix.'file_storage` fs
) x
GROUP BY x.hash
)
- AND files.id IS NULL
+ AND `'.$prefix.'files`.id IS NULL
');
$chunk = 500;