mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Fix Bug #46285 (drop index patch by Paul) - i hope the re-addition of the FULLTEXT index works. :o
If someone wants to try? :) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9930 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
2c6e4d7e80
commit
d0e9e4189c
1 changed files with 19 additions and 1 deletions
|
@ -40,13 +40,18 @@ $row = $db->sql_fetchrow($result);
|
|||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$mysql_indexer = false;
|
||||
$mysql_indexer = $drop_index = false;
|
||||
|
||||
if (strtolower($row['Type']) === 'mediumtext')
|
||||
{
|
||||
$mysql_indexer = true;
|
||||
}
|
||||
|
||||
if (strtolower($row['Key']) === 'mul')
|
||||
{
|
||||
$drop_index = true;
|
||||
}
|
||||
|
||||
echo "USE $dbname;$newline$newline";
|
||||
|
||||
|
||||
|
@ -124,6 +129,13 @@ foreach ($schema_data as $table_name => $table_data)
|
|||
// Create Table statement
|
||||
$generator = $textimage = false;
|
||||
|
||||
// Do we need to DROP a fulltext index before we alter the table?
|
||||
if ($table_name == ($prefix . 'posts') && $drop_index)
|
||||
{
|
||||
echo "ALTER TABLE {$table_name}{$newline}";
|
||||
echo "DROP INDEX post_text,{$newline}DROP INDEX post_subject,{$newline}DROP INDEX post_content;{$newline}{$newline}";
|
||||
}
|
||||
|
||||
$line = "ALTER TABLE {$table_name} $newline";
|
||||
|
||||
// Table specific so we don't get overlap
|
||||
|
@ -236,6 +248,12 @@ foreach ($schema_data as $table_name => $table_data)
|
|||
$line .= "\tDEFAULT CHARSET=utf8 COLLATE=utf8_bin;$newline$newline";
|
||||
|
||||
echo $line . "$newline";
|
||||
|
||||
// Do we now need to re-add the fulltext index? ;)
|
||||
if ($table_name == ($prefix . 'posts') && $drop_index)
|
||||
{
|
||||
echo "ALTER TABLE $table_name ADD FULLTEXT (post_subject), ADD FULLTEXT (post_text), ADD FULLTEXT post_content (post_subject, post_text){$newline}";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue