mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2026-11-20 23:43:26 +03:00
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 git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1763 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
1 parent
27bdba3ba2
commit
9ca7ae050e
1 file changed
+12
+12
@@ -1369,6 +1369,18 @@ function upgrade_1685_pgsql() {
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user