From d2451b90653a0265092af984e01138db08ada071 Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 3 Jul 2007 05:12:59 +0000 Subject: #12947 git-svn-id: file:///svn/phpbb/trunk@7826 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'phpBB/install/database_update.php') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index f4ec7bb566..352c88f0d6 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -332,6 +332,16 @@ $database_update_info = array( ), ), ), + // Changes from 3.0.RC2 to the next version + '3.0.RC2' => array( + // Remove the following keys + 'change_columns' => array( + BANLIST_TABLE => array( + 'ban_reason' => array('VCHAR_UNI', ''), + 'ban_give_reason' => array('VCHAR_UNI', ''), + ), + ), + ), ); // Determine mapping database type @@ -1406,7 +1416,16 @@ function sql_column_change($dbms, $table_name, $column_name, $column_data) break; case 'postgres': - $sql = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET ' . $column_data['column_type_sql']; + $default_pos = strpos($column_data['column_type_sql'], ' DEFAULT'); + + if ($default_pos === false) + { + $sql = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' TYPE ' . $column_data['column_type_sql']; + } + else + { + $sql = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' TYPE ' . substr($column_data['column_type_sql'], 0, $default_pos) . ', ALTER COLUMN ' . $column_name . ' SET ' . substr($column_data['column_type_sql'], $default_pos + 1); + } _sql($sql, $errored, $error_ary); break; -- cgit v1.2.1