From 7f87d130d71202bbca07e9b9ecfc925d0248b024 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Wed, 6 May 2015 21:34:14 +0000 Subject: [PATCH] upgrade.php: - split upgrade_1763() into mysql and pgsql versions because pgsql doesn't support SUBSTRING_INDEX (reported by darix on IRC) git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1786 a1433add-5e2c-0410-b055-b7f2511e0802 --- upgrade.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/upgrade.php b/upgrade.php index bb71bd23..30bc6505 100644 --- a/upgrade.php +++ b/upgrade.php @@ -1376,10 +1376,14 @@ function upgrade_1762() { _db_add_field('fetchmail', 'modified', '{DATECURRENT}', 'created'); } -function upgrade_1763() { +function upgrade_1763_mysql() { $table = table_by_key('fetchmail'); db_query_parsed("UPDATE $table SET domain=SUBSTRING_INDEX(mailbox, '@', -1) WHERE domain='';"); } +function upgrade_1763_pgsql() { + $table = table_by_key('fetchmail'); + db_query_parsed("UPDATE $table SET domain=SPLIT_PART(mailbox, '@', 2) WHERE domain='';"); +} function upgrade_1767() { # 'active' was just added, so make sure all existing jobs stay active