upgrade.php : fix postgres complaining about addition of boolean not null field when existing data exists and no default is specified

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1626 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
David Goodwin 11 years ago
parent c7bceb77cb
commit fa984a5b5f

@ -1310,10 +1310,14 @@ function upgrade_1050() {
db_query_parsed(_add_index('log', 'domain_timestamp', 'domain,timestamp'));
}
function upgrade_1283() {
function upgrade_1283_mysql() {
_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)

Loading…
Cancel
Save