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
This commit is contained in:
Christian Boltz committed 2015-05-06 21:34:14 +00:00
1 parent b3750272e4
commit 7f87d130d7
1 file changed
+5 -1
+5 -1
View File
@@ -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