SF.net SVN: postfixadmin:[1881] trunk/upgrade.php
Brought to you by:
christian_boltz,
gingerdog
|
From: <chr...@us...> - 2016-11-01 20:31:54
|
Revision: 1881
http://sourceforge.net/p/postfixadmin/code/1881
Author: christian_boltz
Date: 2016-11-01 20:31:52 +0000 (Tue, 01 Nov 2016)
Log Message:
-----------
upgrade_1835_mysql: fix defaults for both date fields at once
Doing it in two steps fails, see comment by Gabor 'Morc' KORMOS on
https://sourceforge.net/p/postfixadmin/bugs/5/
Note: This is an exception from the "never change an existing
upgrade_*() function" rule because
a) the result doesn't change for people where it worked and
b) it will continue here anyway for people who had upgrade problems
Modified Paths:
--------------
trunk/upgrade.php
Modified: trunk/upgrade.php
===================================================================
--- trunk/upgrade.php 2016-11-01 19:31:41 UTC (rev 1880)
+++ trunk/upgrade.php 2016-11-01 20:31:52 UTC (rev 1881)
@@ -1619,14 +1619,14 @@
function upgrade_1835_mysql() {
# change default values for existing datetime fields with a 0000-00-00 default to {DATETIME}
- foreach (array('admin', 'alias', 'alias_domain', 'domain', 'mailbox', 'domain_admins', 'vacation') as $table_to_change) {
+ foreach (array('domain_admins', 'vacation') as $table_to_change) {
$table = table_by_key($table_to_change);
db_query_parsed("ALTER TABLE `$table` CHANGE `created` `created` {DATETIME}");
}
foreach (array('admin', 'alias', 'alias_domain', 'domain', 'mailbox') as $table_to_change) {
$table = table_by_key($table_to_change);
- db_query_parsed("ALTER TABLE `$table` CHANGE `modified` `modified` {DATETIME}");
+ db_query_parsed("ALTER TABLE `$table` CHANGE `created` `created` {DATETIME}, CHANGE `modified` `modified` {DATETIME}");
}
$table = table_by_key('log');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|