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
pull/2/head
Christian Boltz 10 years ago
parent b3750272e4
commit 7f87d130d7

@ -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

Loading…
Cancel
Save