SF.net SVN: postfixadmin:[1795] trunk/upgrade.php
Brought to you by:
christian_boltz,
gingerdog
|
From: <chr...@us...> - 2015-09-07 20:46:34
|
Revision: 1795
http://sourceforge.net/p/postfixadmin/code/1795
Author: christian_boltz
Date: 2015-09-07 20:46:31 +0000 (Mon, 07 Sep 2015)
Log Message:
-----------
upgrade.php:
- change fetchmail.date from DATECURRENT to date
https://sourceforge.net/p/postfixadmin/bugs/351/
Modified Paths:
--------------
trunk/upgrade.php
Modified: trunk/upgrade.php
===================================================================
--- trunk/upgrade.php 2015-09-06 21:47:34 UTC (rev 1794)
+++ trunk/upgrade.php 2015-09-07 20:46:31 UTC (rev 1795)
@@ -1369,10 +1369,21 @@
db_query_parsed("UPDATE $table SET domain=SPLIT_PART(domain, '@', 2) WHERE domain=data;");
}
+function upgrade_1761_mysql() {
+ # upgrade_1762 adds the 'modified' column as {DATECURRENT}, therefore we first need to change
+ # 'date' to {DATE} (mysql only allows one {DATECURRENT} column per table)
+ $table_fetchmail = table_by_key('fetchmail');
+ db_query_parsed("ALTER TABLE `$table_fetchmail` CHANGE `date` `date` {DATE}");
+}
+
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');
+
+ # If you followed SVN and got upgrade failures here, you might need to
+ # UPDATE config SET value=1760 WHERE name='version';
+ # and run setup.php again (upgrade_1761_mysql was added later).
_db_add_field('fetchmail', 'modified', '{DATECURRENT}', 'created');
}
@@ -1391,6 +1402,11 @@
db_query_parsed("UPDATE $table SET active='{BOOL_TRUE}'");
}
+function upgrade_1795_mysql() {
+ # upgrade_1761_mysql() was added later (in r1795) - make sure it runs for everybody
+ # (running it twice doesn't hurt)
+ upgrade_1761_mysql();
+}
# TODO MySQL:
# - various varchar fields do not have a default value
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|