mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Nearly there
git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3190 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
38a044ceea
commit
33da2184e9
1 changed files with 100 additions and 70 deletions
|
@ -30,7 +30,6 @@ function _sql($sql, &$errored, &$error_ary, $echo_dot = true)
|
|||
$error_ary['error_code'][] = $db->sql_error();
|
||||
}
|
||||
|
||||
//echo "\n\n<br /><br />\n\n$sql\n\n<br /><br />\n\n";
|
||||
if ($echo_dot)
|
||||
{
|
||||
echo ". \n";
|
||||
|
@ -138,6 +137,9 @@ switch ( $row['config_value'] )
|
|||
|
||||
echo 'Updated version :: <b>2' . $updates_to_version . '</b></p>' ."\n";
|
||||
|
||||
//
|
||||
// Schema updates
|
||||
//
|
||||
switch ($row['config_value'])
|
||||
{
|
||||
case '':
|
||||
|
@ -456,8 +458,6 @@ switch ( $row['config_value'] )
|
|||
|
||||
case '.0.3':
|
||||
|
||||
if (empty($batch))
|
||||
{
|
||||
// Add indexes to post_id in search match table (+ word_id for MS Access)
|
||||
switch (SQL_LAYER)
|
||||
{
|
||||
|
@ -492,12 +492,24 @@ switch ( $row['config_value'] )
|
|||
|
||||
// Modify user_timezone to decimal(5,2) for mysql ... mysql4/mssql/pgsql/msaccess
|
||||
// should be completely unaffected
|
||||
// Change default user_notify to 0
|
||||
switch (SQL_LAYER)
|
||||
{
|
||||
case 'mysql':
|
||||
$sql[] = "ALTER TABLE " . USERS_TABLE . " MODIFY COLUMN user_timezone decimal(5,2) DEFAULT '0' NOT NULL";
|
||||
$sql[] = "ALTER TABLE " . USERS_TABLE . "
|
||||
MODIFY COLUMN user_timezone decimal(5,2) DEFAULT '0' NOT NULL,
|
||||
MODIFY COLUMN user_notify tinyint(1) DEFAULT '0' NOT NULL";
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
case 'mssql-odbc':
|
||||
break;
|
||||
|
||||
case 'msaccess':
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -539,7 +551,7 @@ else
|
|||
}
|
||||
|
||||
//
|
||||
//
|
||||
// Data updates
|
||||
//
|
||||
unset($sql);
|
||||
$error_ary = array();
|
||||
|
@ -763,9 +775,6 @@ switch ( $row['config_value'] )
|
|||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// update post counts? Not sure about this ... will p**s a lot of users
|
||||
// off ...
|
||||
|
||||
// update pm counters
|
||||
$sql = "SELECT privmsgs_to_userid, COUNT(privmsgs_id) AS unread_count
|
||||
FROM " . PRIVMSGS_TABLE . "
|
||||
|
@ -823,6 +832,27 @@ switch ( $row['config_value'] )
|
|||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Remove superfluous watched topics
|
||||
$sql = "SELECT t.topic_id
|
||||
FROM " . TOPICS_TABLE . " t, " . TOPICS_WATCH_TABLE . " w
|
||||
WHERE w.topic_id = t.topic_id";
|
||||
$result = _sql($sql, $errored, $error_ary);
|
||||
|
||||
$topic_id_sql = '';
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$topic_id_sql .= (($topic_id_sql != '') ? ', ' : '') . $row['topic_id'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "
|
||||
WHERE topic_id NOT IN ($topic_id_sql)";
|
||||
_sql($sql, $errored, $error_ary);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Optimize/vacuum analyze the tables where appropriate
|
||||
switch (SQL_LAYER)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue