SF.net SVN: postfixadmin:[1763] trunk/upgrade.php
Brought to you by:
christian_boltz,
gingerdog
|
From: <chr...@us...> - 2015-04-04 14:20:59
|
Revision: 1763
http://sourceforge.net/p/postfixadmin/code/1763
Author: christian_boltz
Date: 2015-04-04 14:20:57 +0000 (Sat, 04 Apr 2015)
Log Message:
-----------
Two upgrades for FetchmailHandler:
- upgrade_1762: add 'domain', 'active', 'created' and 'modified' fields
to fetchmail table (used by FetchmailHandler)
- upgrade_1763: fill fetchmail.domain based on mailbox
Modified Paths:
--------------
trunk/upgrade.php
Modified: trunk/upgrade.php
===================================================================
--- trunk/upgrade.php 2015-04-04 13:58:42 UTC (rev 1762)
+++ trunk/upgrade.php 2015-04-04 14:20:57 UTC (rev 1763)
@@ -1369,7 +1369,19 @@
db_query_parsed("UPDATE $table SET domain=SPLIT_PART(domain, '@', 2) WHERE domain=data;");
}
+function upgrade_1762() {
+ _db_add_field('fetchmail', 'domain', "VARCHAR(255) {LATIN1} DEFAULT ''", 'id');
+ _db_add_field('fetchmail', 'active', '{BOOLEAN}', 'date');
+ _db_add_field('fetchmail', 'created', '{DATE}', 'date');
+ _db_add_field('fetchmail', 'modified', '{DATECURRENT}', 'created');
+}
+function upgrade_1763() {
+ $table = table_by_key('fetchmail');
+ db_query_parsed("UPDATE $table SET domain=SUBSTRING_INDEX(mailbox, '@', -1) WHERE domain='';");
+}
+
+
# TODO MySQL:
# - various varchar fields do not have a default value
# https://sourceforge.net/projects/postfixadmin/forums/forum/676076/topic/3419725
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|