SF.net SVN: postfixadmin:[1786] trunk/upgrade.php
Brought to you by:
christian_boltz,
gingerdog
|
From: <chr...@us...> - 2015-05-06 21:34:17
|
Revision: 1786
http://sourceforge.net/p/postfixadmin/code/1786
Author: christian_boltz
Date: 2015-05-06 21:34:14 +0000 (Wed, 06 May 2015)
Log Message:
-----------
upgrade.php:
- split upgrade_1763() into mysql and pgsql versions because pgsql
doesn't support SUBSTRING_INDEX
(reported by darix on IRC)
Modified Paths:
--------------
trunk/upgrade.php
Modified: trunk/upgrade.php
===================================================================
--- trunk/upgrade.php 2015-04-26 19:25:43 UTC (rev 1785)
+++ trunk/upgrade.php 2015-05-06 21:34:14 UTC (rev 1786)
@@ -1376,10 +1376,14 @@
_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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|