diff options
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r-- | phpBB/install/database_update.php | 70 |
1 files changed, 68 insertions, 2 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 665db1f2f0..594397c815 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1027,7 +1027,7 @@ function database_update_info() // this column was removed from the database updater // after 3.0.9-RC3 was released. It might still exist // in 3.0.9-RCX installations and has to be dropped in - // 3.0.11 after the db_tools class is capable of properly + // 3.0.12 after the db_tools class is capable of properly // removing a primary key. // 'attempt_id' => array('UINT', NULL, 'auto_increment'), 'attempt_ip' => array('VCHAR:40', ''), @@ -1072,7 +1072,7 @@ function database_update_info() // No changes from 3.0.10 to 3.0.11-RC1 '3.0.10' => array(), - /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.11-RC1 */ + /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.12-RC1 */ // Changes from 3.1.0-dev to 3.1.0-A1 '3.1.0-dev' => array( @@ -2164,6 +2164,44 @@ function change_database_data(&$no_updates, $version) _sql($sql, $errored, $error_ary); } + // Delete orphan private messages + $batch_size = 500; + + $sql_array = array( + 'SELECT' => 'p.msg_id', + 'FROM' => array( + PRIVMSGS_TABLE => 'p', + ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(PRIVMSGS_TO_TABLE => 't'), + 'ON' => 'p.msg_id = t.msg_id', + ), + ), + 'WHERE' => 't.user_id IS NULL', + ); + $sql = $db->sql_build_query('SELECT', $sql_array); + + do + { + $result = $db->sql_query_limit($sql, $batch_size); + + $delete_pms = array(); + while ($row = $db->sql_fetchrow($result)) + { + $delete_pms[] = (int) $row['msg_id']; + } + $db->sql_freeresult($result); + + if (!empty($delete_pms)) + { + $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', $delete_pms); + _sql($sql, $errored, $error_ary); + } + } + while (sizeof($delete_pms) == $batch_size); + $no_updates = false; break; @@ -2207,6 +2245,21 @@ function change_database_data(&$no_updates, $version) set_config('search_type', 'phpbb_search_' . $config['search_type']); } + if (!isset($config['fulltext_postgres_ts_name'])) + { + set_config('fulltext_postgres_ts_name', 'simple'); + } + + if (!isset($config['fulltext_postgres_min_word_len'])) + { + set_config('fulltext_postgres_min_word_len', 4); + } + + if (!isset($config['fulltext_postgres_max_word_len'])) + { + set_config('fulltext_postgres_max_word_len', 254); + } + if (!isset($config['load_jquery_cdn'])) { set_config('load_jquery_cdn', 0); @@ -2305,6 +2358,13 @@ function change_database_data(&$no_updates, $version) 'auth' => 'acl_a_styles', 'cat' => 'ACP_STYLE_MANAGEMENT', ), + 'autologin_keys' => array( + 'base' => 'ucp_profile', + 'class' => 'ucp', + 'title' => 'UCP_PROFILE_AUTOLOGIN_KEYS', + 'auth' => '', + 'cat' => 'UCP_PROFILE', + ), ); _add_modules($modules_to_install); @@ -2534,6 +2594,12 @@ function change_database_data(&$no_updates, $version) } } + // Create config value for displaying last subject on forum list + if (!isset($config['display_last_subject'])) + { + $config->set('display_last_subject', '1'); + } + $no_updates = false; if (!isset($config['assets_version'])) |