SF.net SVN: postfixadmin:[1632] trunk/upgrade.php
Brought to you by:
christian_boltz,
gingerdog
|
From: <chr...@us...> - 2014-01-21 19:17:11
|
Revision: 1632
http://sourceforge.net/p/postfixadmin/code/1632
Author: christian_boltz
Date: 2014-01-21 19:17:09 +0000 (Tue, 21 Jan 2014)
Log Message:
-----------
upgrade.php:
- change {BOOLEAN} to include "default false"
- revert the r1626 changes in upgrade_1283
(BTW: "by default, every admin is a superadmin" is not a good idea ;-)
Revision Links:
--------------
http://sourceforge.net/p/postfixadmin/code/1626
Modified Paths:
--------------
trunk/upgrade.php
Modified: trunk/upgrade.php
===================================================================
--- trunk/upgrade.php 2014-01-21 19:04:56 UTC (rev 1631)
+++ trunk/upgrade.php 2014-01-21 19:17:09 UTC (rev 1632)
@@ -197,7 +197,7 @@
'{PRIMARY}' => 'primary key',
'{UNSIGNED}' => 'unsigned' ,
'{FULLTEXT}' => 'FULLTEXT',
- '{BOOLEAN}' => 'tinyint(1) NOT NULL',
+ '{BOOLEAN}' => "tinyint(1) NOT NULL DEFAULT '" . db_get_boolean(False) . "'",
'{UTF-8}' => '/*!40100 CHARACTER SET utf8 */',
'{LATIN1}' => '/*!40100 CHARACTER SET latin1 */',
'{IF_NOT_EXISTS}' => 'IF NOT EXISTS',
@@ -217,7 +217,7 @@
'{PRIMARY}' => 'primary key',
'{UNSIGNED}' => '',
'{FULLTEXT}' => '',
- '{BOOLEAN}' => 'BOOLEAN NOT NULL',
+ '{BOOLEAN}' => "BOOLEAN NOT NULL DEFAULT '" . db_get_boolean(False) . "'",
'{UTF-8}' => '', # UTF-8 is simply ignored.
'{LATIN1}' => '', # same for latin1
'{IF_NOT_EXISTS}' => '', # does not work with PgSQL
@@ -392,7 +392,7 @@
$result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN transport VARCHAR(255) AFTER maxquota;", TRUE);
}
if(!_mysql_field_exists($table_domain, 'backupmx')) {
- $result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN backupmx {BOOLEAN} DEFAULT {BOOL_FALSE} AFTER transport;", TRUE);
+ $result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN backupmx {BOOLEAN} AFTER transport;", TRUE);
}
}
@@ -1310,14 +1310,10 @@
db_query_parsed(_add_index('log', 'domain_timestamp', 'domain,timestamp'));
}
-function upgrade_1283_mysql() {
+function upgrade_1283() {
_db_add_field('admin', 'superadmin', '{BOOLEAN}', 'password');
}
-function upgrade_1283_pgsql() { /* postgresql doesn't like adding columns which can't be null when there is data already there. */
- _db_add_field('admin', 'superadmin', "{BOOLEAN} DEFAULT '{BOOL_TRUE}'", 'password');
-}
-
function upgrade_1284() {
# migrate the ALL domain to the superadmin column
# Note: The ALL domain is not (yet) deleted to stay backwards-compatible for now (will be done in a later upgrade function)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|