From 49c8b94e5a2839da7fb9c370ce199b9c06b4a6cf Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 18 Jul 2015 16:25:34 +0200 Subject: Implement migration 14 for postgres Signed-off-by: Florian Pritz --- application/controllers/tools.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'application/controllers') diff --git a/application/controllers/tools.php b/application/controllers/tools.php index f0d8ce6f9..664a9e324 100644 --- a/application/controllers/tools.php +++ b/application/controllers/tools.php @@ -59,9 +59,14 @@ class Tools extends MY_Controller { return; } - $this->db->query('SET FOREIGN_KEY_CHECKS = 0'); + + if ($this->db->dbdriver !== 'postgre') { + $this->db->query('SET FOREIGN_KEY_CHECKS = 0'); + } $this->db->query('DROP TABLE '.implode(", ", $tables_to_drop)); - $this->db->query('SET FOREIGN_KEY_CHECKS = 1'); + if ($this->db->dbdriver !== 'postgre') { + $this->db->query('SET FOREIGN_KEY_CHECKS = 1'); + } } function test() -- cgit v1.2.3-24-g4f1b From ffacb290fa8a30e6f3e507bf6842b281efbcd558 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 20 Sep 2015 15:36:22 +0200 Subject: postgres: Adapt MySQL query for thumbnail history Signed-off-by: Florian Pritz --- application/controllers/file.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'application/controllers') diff --git a/application/controllers/file.php b/application/controllers/file.php index a78f89bb0..f484c5260 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -684,10 +684,10 @@ class File extends MY_Controller { ->from('files') ->join('file_storage', 'file_storage.id = files.file_storage_id') ->where(' - (user = '.$this->db->escape($user).') + (files.user = '.$this->db->escape($user).') AND ( - mimetype LIKE "image%" - OR mimetype IN ("application/pdf") + mimetype LIKE \'image%\' + OR mimetype IN (\'application/pdf\') )', null, false) ->order_by('date', 'desc') ->get()->result_array(); -- cgit v1.2.3-24-g4f1b