mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
the end of an era...
- MySQL < 4.1.3 support is removed - renamed mysql4 to mysql, no need to cause confusion - changed the cfg cacher, reduces file system lookups and include count by two on every page load git-svn-id: file:///svn/phpbb/trunk@8307 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
f0dea06097
commit
57645ad5bc
20 changed files with 131 additions and 1455 deletions
|
@ -25,7 +25,7 @@ if (!is_writable($schema_path))
|
|||
|
||||
$schema_data = get_schema_struct();
|
||||
$dbms_type_map = array(
|
||||
'mysql_41' => array(
|
||||
'mysql' => array(
|
||||
'INT:' => 'int(%d)',
|
||||
'BINT' => 'bigint(20)',
|
||||
'UINT' => 'mediumint(8) UNSIGNED',
|
||||
|
@ -55,36 +55,6 @@ $dbms_type_map = array(
|
|||
'VARBINARY' => 'varbinary(255)',
|
||||
),
|
||||
|
||||
'mysql_40' => array(
|
||||
'INT:' => 'int(%d)',
|
||||
'BINT' => 'bigint(20)',
|
||||
'UINT' => 'mediumint(8) UNSIGNED',
|
||||
'UINT:' => 'int(%d) UNSIGNED',
|
||||
'TINT:' => 'tinyint(%d)',
|
||||
'USINT' => 'smallint(4) UNSIGNED',
|
||||
'BOOL' => 'tinyint(1) UNSIGNED',
|
||||
'VCHAR' => 'varbinary(255)',
|
||||
'VCHAR:' => 'varbinary(%d)',
|
||||
'CHAR:' => 'binary(%d)',
|
||||
'XSTEXT' => 'blob',
|
||||
'XSTEXT_UNI'=> 'blob',
|
||||
'STEXT' => 'blob',
|
||||
'STEXT_UNI' => 'blob',
|
||||
'TEXT' => 'blob',
|
||||
'TEXT_UNI' => 'blob',
|
||||
'MTEXT' => 'mediumblob',
|
||||
'MTEXT_UNI' => 'mediumblob',
|
||||
'TIMESTAMP' => 'int(11) UNSIGNED',
|
||||
'DECIMAL' => 'decimal(5,2)',
|
||||
'DECIMAL:' => 'decimal(%d,2)',
|
||||
'PDECIMAL' => 'decimal(6,3)',
|
||||
'PDECIMAL:' => 'decimal(%d,3)',
|
||||
'VCHAR_UNI' => 'blob',
|
||||
'VCHAR_UNI:'=> array('varbinary(%d)', 'limit' => array('mult', 3, 255, 'blob')),
|
||||
'VCHAR_CI' => 'blob',
|
||||
'VARBINARY' => 'varbinary(255)',
|
||||
),
|
||||
|
||||
'firebird' => array(
|
||||
'INT:' => 'INTEGER',
|
||||
'BINT' => 'DOUBLE PRECISION',
|
||||
|
@ -238,7 +208,7 @@ $dbms_type_map = array(
|
|||
|
||||
// A list of types being unsigned for better reference in some db's
|
||||
$unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP');
|
||||
$supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite');
|
||||
$supported_dbms = array('firebird', 'mssql', 'mysql', 'oracle', 'postgres', 'sqlite');
|
||||
|
||||
foreach ($supported_dbms as $dbms)
|
||||
{
|
||||
|
@ -249,8 +219,7 @@ foreach ($supported_dbms as $dbms)
|
|||
// Write Header
|
||||
switch ($dbms)
|
||||
{
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$line = "#\n# \$I" . "d: $\n#\n\n";
|
||||
break;
|
||||
|
||||
|
@ -288,8 +257,7 @@ foreach ($supported_dbms as $dbms)
|
|||
// Write comment about table
|
||||
switch ($dbms)
|
||||
{
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
case 'firebird':
|
||||
case 'sqlite':
|
||||
fwrite($fp, "# Table: '{$table_name}'\n");
|
||||
|
@ -308,8 +276,7 @@ foreach ($supported_dbms as $dbms)
|
|||
|
||||
switch ($dbms)
|
||||
{
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
case 'firebird':
|
||||
case 'oracle':
|
||||
case 'sqlite':
|
||||
|
@ -389,8 +356,7 @@ foreach ($supported_dbms as $dbms)
|
|||
|
||||
switch ($dbms)
|
||||
{
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$line .= "\t{$column_name} {$column_type} ";
|
||||
|
||||
// For hexadecimal values do not use single quotes
|
||||
|
@ -406,7 +372,7 @@ foreach ($supported_dbms as $dbms)
|
|||
{
|
||||
$line .= ' auto_increment';
|
||||
}
|
||||
else if ($dbms === 'mysql_41' && $column_data[2] == 'true_sort')
|
||||
else if ($column_data[2] == 'true_sort')
|
||||
{
|
||||
$line .= ' COLLATE utf8_unicode_ci';
|
||||
}
|
||||
|
@ -551,8 +517,7 @@ foreach ($supported_dbms as $dbms)
|
|||
|
||||
switch ($dbms)
|
||||
{
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
case 'postgres':
|
||||
$line .= "\tPRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . "),\n";
|
||||
break;
|
||||
|
@ -633,8 +598,7 @@ foreach ($supported_dbms as $dbms)
|
|||
|
||||
switch ($dbms)
|
||||
{
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$line .= ($key_data[0] == 'INDEX') ? "\tKEY" : '';
|
||||
$line .= ($key_data[0] == 'UNIQUE') ? "\tUNIQUE" : '';
|
||||
foreach ($key_data[1] as $key => $col_name)
|
||||
|
@ -698,13 +662,7 @@ foreach ($supported_dbms as $dbms)
|
|||
|
||||
switch ($dbms)
|
||||
{
|
||||
case 'mysql_40':
|
||||
// Remove last line delimiter...
|
||||
$line = substr($line, 0, -2);
|
||||
$line .= "\n);\n\n";
|
||||
break;
|
||||
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
// Remove last line delimiter...
|
||||
$line = substr($line, 0, -2);
|
||||
$line .= "\n) CHARACTER SET `utf8` COLLATE `utf8_bin`;\n\n";
|
||||
|
|
|
@ -89,7 +89,6 @@ class acp_database
|
|||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mysqli':
|
||||
case 'mysql4':
|
||||
case 'mysql':
|
||||
$extractor = new mysql_extractor($download, $store, $format, $filename, $time);
|
||||
break;
|
||||
|
@ -317,7 +316,6 @@ class acp_database
|
|||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
case 'mysqli':
|
||||
case 'sqlite':
|
||||
while (($sql = $fgetd($fp, ";\n", $read, $seek, $eof)) !== false)
|
||||
|
@ -592,28 +590,16 @@ class mysql_extractor extends base_extractor
|
|||
function write_table($table_name)
|
||||
{
|
||||
global $db;
|
||||
static $new_extract;
|
||||
|
||||
if ($new_extract === null)
|
||||
{
|
||||
if ($db->sql_layer === 'mysqli' || version_compare($db->mysql_version, '3.23.20', '>='))
|
||||
{
|
||||
$new_extract = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$new_extract = false;
|
||||
}
|
||||
}
|
||||
$sql = 'SHOW CREATE TABLE ' . $table_name;
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
|
||||
if ($new_extract)
|
||||
{
|
||||
$this->new_write_table($table_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->old_write_table($table_name);
|
||||
}
|
||||
$sql_data = '# Table: ' . $table_name . "\n";
|
||||
$sql_data .= "DROP TABLE IF EXISTS $table_name;\n";
|
||||
$this->flush($sql_data . $row['Create Table'] . ";\n\n");
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
function write_data($table_name)
|
||||
|
@ -791,113 +777,6 @@ class mysql_extractor extends base_extractor
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
function new_write_table($table_name)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql = 'SHOW CREATE TABLE ' . $table_name;
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
|
||||
$sql_data = '# Table: ' . $table_name . "\n";
|
||||
$sql_data .= "DROP TABLE IF EXISTS $table_name;\n";
|
||||
$this->flush($sql_data . $row['Create Table'] . ";\n\n");
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
function old_write_table($table_name)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql_data = '# Table: ' . $table_name . "\n";
|
||||
$sql_data .= "DROP TABLE IF EXISTS $table_name;\n";
|
||||
$sql_data .= "CREATE TABLE $table_name(\n";
|
||||
$rows = array();
|
||||
|
||||
$sql = "SHOW FIELDS
|
||||
FROM $table_name";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$line = ' ' . $row['Field'] . ' ' . $row['Type'];
|
||||
|
||||
if (!is_null($row['Default']))
|
||||
{
|
||||
$line .= " DEFAULT '{$row['Default']}'";
|
||||
}
|
||||
|
||||
if ($row['Null'] != 'YES')
|
||||
{
|
||||
$line .= ' NOT NULL';
|
||||
}
|
||||
|
||||
if ($row['Extra'] != '')
|
||||
{
|
||||
$line .= ' ' . $row['Extra'];
|
||||
}
|
||||
|
||||
$rows[] = $line;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = "SHOW KEYS
|
||||
FROM $table_name";
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$index = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$kname = $row['Key_name'];
|
||||
|
||||
if ($kname != 'PRIMARY')
|
||||
{
|
||||
if ($row['Non_unique'] == 0)
|
||||
{
|
||||
$kname = "UNIQUE|$kname";
|
||||
}
|
||||
}
|
||||
|
||||
if ($row['Sub_part'])
|
||||
{
|
||||
$row['Column_name'] .= '(' . $row['Sub_part'] . ')';
|
||||
}
|
||||
$index[$kname][] = $row['Column_name'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
foreach ($index as $key => $columns)
|
||||
{
|
||||
$line = ' ';
|
||||
|
||||
if ($key == 'PRIMARY')
|
||||
{
|
||||
$line .= 'PRIMARY KEY (' . implode(', ', $columns) . ')';
|
||||
}
|
||||
else if (strpos($key, 'UNIQUE') === 0)
|
||||
{
|
||||
$line .= 'UNIQUE ' . substr($key, 7) . ' (' . implode(', ', $columns) . ')';
|
||||
}
|
||||
else if (strpos($key, 'FULLTEXT') === 0)
|
||||
{
|
||||
$line .= 'FULLTEXT ' . substr($key, 9) . ' (' . implode(', ', $columns) . ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$line .= "KEY $key (" . implode(', ', $columns) . ')';
|
||||
}
|
||||
|
||||
$rows[] = $line;
|
||||
}
|
||||
|
||||
$sql_data .= implode(",\n", $rows);
|
||||
$sql_data .= "\n);\n\n";
|
||||
|
||||
$this->flush($sql_data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1649,7 +1649,7 @@ class acp_forums
|
|||
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mysql4':
|
||||
case 'mysql':
|
||||
case 'mysqli':
|
||||
|
||||
// Delete everything else and thank MySQL for offering multi-table deletion
|
||||
|
|
|
@ -1351,7 +1351,6 @@ class acp_profile
|
|||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
case 'mysqli':
|
||||
|
||||
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
|
||||
|
|
|
@ -1782,8 +1782,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
$theme_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['theme_name'], $style_row['theme_copyright'], $config['version']), $this->theme_cfg);
|
||||
|
||||
// Read old cfg file
|
||||
$items = cache::obtain_cfg_items($style_row);
|
||||
$items = $items['theme'];
|
||||
$items = cache::obtain_cfg_item($style_row, 'theme');
|
||||
|
||||
if (!isset($items['parse_css_file']))
|
||||
{
|
||||
|
|
|
@ -1141,7 +1141,6 @@ class acp_users
|
|||
break;
|
||||
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
case 'mysqli':
|
||||
$right_delim = $left_delim = '`';
|
||||
break;
|
||||
|
|
|
@ -316,51 +316,46 @@ class cache
|
|||
|
||||
/**
|
||||
* Obtain cfg file data
|
||||
*
|
||||
* @param array $theme An array containing the path to the item
|
||||
*
|
||||
* @param string $item The specific item to get: 'theme', 'template', or 'imageset'
|
||||
*
|
||||
*/
|
||||
public static function obtain_cfg_items($theme)
|
||||
public static function obtain_cfg_item($theme, $item = 'theme')
|
||||
{
|
||||
global $config, $phpbb_root_path, $cache;
|
||||
|
||||
$parsed_items = array(
|
||||
'theme' => array(),
|
||||
'template' => array(),
|
||||
'imageset' => array()
|
||||
);
|
||||
$parsed_array = $cache->get('_cfg_' . $item . '_' . $theme[$item . '_path']);
|
||||
|
||||
foreach ($parsed_items as $key => $parsed_array)
|
||||
if ($parsed_array === false)
|
||||
{
|
||||
$parsed_array = $cache->get('_cfg_' . $key . '_' . $theme[$key . '_path']);
|
||||
|
||||
if ($parsed_array === false)
|
||||
{
|
||||
$parsed_array = array();
|
||||
}
|
||||
|
||||
$reparse = false;
|
||||
$filename = $phpbb_root_path . 'styles/' . $theme[$key . '_path'] . '/' . $key . '/' . $key . '.cfg';
|
||||
|
||||
if (!file_exists($filename))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($parsed_array['filetime']) || (($config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime'])))
|
||||
{
|
||||
$reparse = true;
|
||||
}
|
||||
|
||||
// Re-parse cfg file
|
||||
if ($reparse)
|
||||
{
|
||||
$parsed_array = parse_cfg_file($filename);
|
||||
$parsed_array['filetime'] = @filemtime($filename);
|
||||
|
||||
$cache->put('_cfg_' . $key . '_' . $theme[$key . '_path'], $parsed_array);
|
||||
}
|
||||
$parsed_items[$key] = $parsed_array;
|
||||
$parsed_array = array();
|
||||
}
|
||||
|
||||
return $parsed_items;
|
||||
$reparse = false;
|
||||
$filename = $phpbb_root_path . 'styles/' . $theme[$item . '_path'] . '/' . $item . '/' . $item . '.cfg';
|
||||
|
||||
if (!file_exists($filename))
|
||||
{
|
||||
return $parsed_array;
|
||||
}
|
||||
|
||||
if (!isset($parsed_array['filetime']) || (($config['load_tplcompile'] && @filemtime($filename) > $parsed_array['filetime'])))
|
||||
{
|
||||
$reparse = true;
|
||||
}
|
||||
|
||||
// Re-parse cfg file
|
||||
if ($reparse)
|
||||
{
|
||||
$parsed_array = parse_cfg_file($filename);
|
||||
$parsed_array['filetime'] = @filemtime($filename);
|
||||
|
||||
$cache->put('_cfg_' . $item . '_' . $theme[$item . '_path'], $parsed_array);
|
||||
}
|
||||
|
||||
return $parsed_array;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,7 +31,7 @@ class phpbb_db_tools
|
|||
var $sql_layer = '';
|
||||
|
||||
var $dbms_type_map = array(
|
||||
'mysql_41' => array(
|
||||
'mysql' => array(
|
||||
'INT:' => 'int(%d)',
|
||||
'BINT' => 'bigint(20)',
|
||||
'UINT' => 'mediumint(8) UNSIGNED',
|
||||
|
@ -61,36 +61,6 @@ class phpbb_db_tools
|
|||
'VARBINARY' => 'varbinary(255)',
|
||||
),
|
||||
|
||||
'mysql_40' => array(
|
||||
'INT:' => 'int(%d)',
|
||||
'BINT' => 'bigint(20)',
|
||||
'UINT' => 'mediumint(8) UNSIGNED',
|
||||
'UINT:' => 'int(%d) UNSIGNED',
|
||||
'TINT:' => 'tinyint(%d)',
|
||||
'USINT' => 'smallint(4) UNSIGNED',
|
||||
'BOOL' => 'tinyint(1) UNSIGNED',
|
||||
'VCHAR' => 'varbinary(255)',
|
||||
'VCHAR:' => 'varbinary(%d)',
|
||||
'CHAR:' => 'binary(%d)',
|
||||
'XSTEXT' => 'blob',
|
||||
'XSTEXT_UNI'=> 'blob',
|
||||
'STEXT' => 'blob',
|
||||
'STEXT_UNI' => 'blob',
|
||||
'TEXT' => 'blob',
|
||||
'TEXT_UNI' => 'blob',
|
||||
'MTEXT' => 'mediumblob',
|
||||
'MTEXT_UNI' => 'mediumblob',
|
||||
'TIMESTAMP' => 'int(11) UNSIGNED',
|
||||
'DECIMAL' => 'decimal(5,2)',
|
||||
'DECIMAL:' => 'decimal(%d,2)',
|
||||
'PDECIMAL' => 'decimal(6,3)',
|
||||
'PDECIMAL:' => 'decimal(%d,3)',
|
||||
'VCHAR_UNI' => 'blob',
|
||||
'VCHAR_UNI:'=> array('varbinary(%d)', 'limit' => array('mult', 3, 255, 'blob')),
|
||||
'VCHAR_CI' => 'blob',
|
||||
'VARBINARY' => 'varbinary(255)',
|
||||
),
|
||||
|
||||
'firebird' => array(
|
||||
'INT:' => 'INTEGER',
|
||||
'BINT' => 'DOUBLE PRECISION',
|
||||
|
@ -244,7 +214,7 @@ class phpbb_db_tools
|
|||
|
||||
// A list of types being unsigned for better reference in some db's
|
||||
var $unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP');
|
||||
var $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite');
|
||||
var $supported_dbms = array('firebird', 'mssql', 'mysql', 'oracle', 'postgres', 'sqlite');
|
||||
|
||||
/**
|
||||
* Set this to true if you only want to return the 'to-be-executed' SQL statement(s) (as an array).
|
||||
|
@ -260,26 +230,10 @@ class phpbb_db_tools
|
|||
// Determine mapping database type
|
||||
switch ($this->db->sql_layer)
|
||||
{
|
||||
case 'mysql':
|
||||
$this->sql_layer = 'mysql_40';
|
||||
break;
|
||||
|
||||
case 'mysql4':
|
||||
if (version_compare($this->db->mysql_version, '4.1.3', '>='))
|
||||
{
|
||||
$this->sql_layer = 'mysql_41';
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->sql_layer = 'mysql_40';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'mysqli':
|
||||
$this->sql_layer = 'mysql_41';
|
||||
$this->sql_layer = 'mysql';
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
case 'mssql_odbc':
|
||||
$this->sql_layer = 'mssql';
|
||||
break;
|
||||
|
@ -453,8 +407,7 @@ class phpbb_db_tools
|
|||
{
|
||||
switch ($this->sql_layer)
|
||||
{
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
|
||||
$sql = "SHOW COLUMNS FROM $table";
|
||||
$result = $this->db->sql_query($sql);
|
||||
|
@ -731,8 +684,7 @@ class phpbb_db_tools
|
|||
$return_array['column_type_sql_default'] = $sql_default;
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$sql .= " {$column_type} ";
|
||||
|
||||
// For hexadecimal values do not use single quotes
|
||||
|
@ -748,7 +700,7 @@ class phpbb_db_tools
|
|||
{
|
||||
$sql .= ' auto_increment';
|
||||
}
|
||||
else if ($this->sql_layer === 'mysql_41' && $column_data[2] == 'true_sort')
|
||||
else if ($column_data[2] == 'true_sort')
|
||||
{
|
||||
$sql .= ' COLLATE utf8_unicode_ci';
|
||||
}
|
||||
|
@ -835,8 +787,7 @@ class phpbb_db_tools
|
|||
$statements[] = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql_default'];
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$statements[] = 'ALTER TABLE `' . $table_name . '` ADD COLUMN `' . $column_name . '` ' . $column_data['column_type_sql'];
|
||||
break;
|
||||
|
||||
|
@ -927,8 +878,7 @@ class phpbb_db_tools
|
|||
$statements[] = 'ALTER TABLE [' . $table_name . '] DROP COLUMN [' . $column_name . ']';
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$statements[] = 'ALTER TABLE `' . $table_name . '` DROP COLUMN `' . $column_name . '`';
|
||||
break;
|
||||
|
||||
|
@ -1015,8 +965,7 @@ class phpbb_db_tools
|
|||
$statements[] = 'DROP INDEX ' . $table_name . '.' . $index_name;
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$statements[] = 'DROP INDEX ' . $index_name . ' ON ' . $table_name;
|
||||
break;
|
||||
|
||||
|
@ -1054,8 +1003,7 @@ class phpbb_db_tools
|
|||
$statements[] = $sql;
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')';
|
||||
break;
|
||||
|
||||
|
@ -1132,8 +1080,7 @@ class phpbb_db_tools
|
|||
$statements[] = 'CREATE UNIQUE INDEX ' . $table_name . '_' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$statements[] = 'CREATE UNIQUE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
|
||||
break;
|
||||
|
||||
|
@ -1161,8 +1108,7 @@ class phpbb_db_tools
|
|||
$statements[] = 'CREATE INDEX ' . $table_name . '_' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$statements[] = 'CREATE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
|
||||
break;
|
||||
|
||||
|
@ -1221,8 +1167,7 @@ class phpbb_db_tools
|
|||
$col = 'index_name';
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$sql = 'SHOW KEYS
|
||||
FROM ' . $table_name;
|
||||
$col = 'Key_name';
|
||||
|
@ -1244,7 +1189,7 @@ class phpbb_db_tools
|
|||
$result = $this->db->sql_query($sql);
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
if (($this->sql_layer == 'mysql_40' || $this->sql_layer == 'mysql_41') && !$row['Non_unique'])
|
||||
if ($this->sql_layer == 'mysql' && !$row['Non_unique'])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -1286,8 +1231,7 @@ class phpbb_db_tools
|
|||
$statements[] = 'ALTER TABLE [' . $table_name . '] ALTER COLUMN [' . $column_name . '] ' . $column_data['column_type_sql'];
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$statements[] = 'ALTER TABLE `' . $table_name . '` CHANGE `' . $column_name . '` `' . $column_name . '` ' . $column_data['column_type_sql'];
|
||||
break;
|
||||
|
||||
|
|
|
@ -19,21 +19,18 @@ if (!defined('IN_PHPBB'))
|
|||
include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
|
||||
|
||||
/**
|
||||
* MySQL4 Database Abstraction Layer
|
||||
* MySQL Database Abstraction Layer
|
||||
* Compatible with:
|
||||
* MySQL 3.23+
|
||||
* MySQL 4.0+
|
||||
* MySQL 4.1+
|
||||
* MySQL 5.0+
|
||||
* @package dbal
|
||||
*/
|
||||
class dbal_mysql extends dbal
|
||||
{
|
||||
var $mysql_version;
|
||||
var $multi_insert = true;
|
||||
|
||||
// Supports multiple table deletion
|
||||
var $multi_table_deletion = false;
|
||||
var $multi_table_deletion = true;
|
||||
|
||||
/**
|
||||
* Connect to server
|
||||
|
@ -46,49 +43,37 @@ class dbal_mysql extends dbal
|
|||
$this->server = $sqlserver . (($port) ? ':' . $port : '');
|
||||
$this->dbname = $database;
|
||||
|
||||
$this->sql_layer = 'mysql4';
|
||||
|
||||
$this->db_connect_id = ($this->persistency) ? @mysql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mysql_connect($this->server, $this->user, $sqlpassword, $new_link);
|
||||
|
||||
if ($this->db_connect_id && $this->dbname != '')
|
||||
{
|
||||
if (@mysql_select_db($this->dbname, $this->db_connect_id))
|
||||
{
|
||||
// Determine what version we are using and if it natively supports UNICODE
|
||||
$this->mysql_version = mysql_get_server_info($this->db_connect_id);
|
||||
|
||||
if (version_compare($this->mysql_version, '4.1.3', '>='))
|
||||
@mysql_query("SET NAMES 'utf8'", $this->db_connect_id);
|
||||
// enforce strict mode on databases that support it
|
||||
if (version_compare(mysql_get_server_info($this->db_connect_id), '5.0.2', '>='))
|
||||
{
|
||||
@mysql_query("SET NAMES 'utf8'", $this->db_connect_id);
|
||||
// enforce strict mode on databases that support it
|
||||
if (version_compare($this->mysql_version, '5.0.2', '>='))
|
||||
$result = @mysql_query('SELECT @@session.sql_mode AS sql_mode', $this->db_connect_id);
|
||||
$row = @mysql_fetch_assoc($result);
|
||||
@mysql_free_result($result);
|
||||
$modes = array_map('trim', explode(',', $row['sql_mode']));
|
||||
|
||||
// TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES
|
||||
if (!in_array('TRADITIONAL', $modes))
|
||||
{
|
||||
$result = @mysql_query('SELECT @@session.sql_mode AS sql_mode', $this->db_connect_id);
|
||||
$row = @mysql_fetch_assoc($result);
|
||||
@mysql_free_result($result);
|
||||
$modes = array_map('trim', explode(',', $row['sql_mode']));
|
||||
|
||||
// TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES
|
||||
if (!in_array('TRADITIONAL', $modes))
|
||||
if (!in_array('STRICT_ALL_TABLES', $modes))
|
||||
{
|
||||
if (!in_array('STRICT_ALL_TABLES', $modes))
|
||||
{
|
||||
$modes[] = 'STRICT_ALL_TABLES';
|
||||
}
|
||||
|
||||
if (!in_array('STRICT_TRANS_TABLES', $modes))
|
||||
{
|
||||
$modes[] = 'STRICT_TRANS_TABLES';
|
||||
}
|
||||
$modes[] = 'STRICT_ALL_TABLES';
|
||||
}
|
||||
|
||||
$mode = implode(',', $modes);
|
||||
@mysql_query("SET SESSION sql_mode='{$mode}'", $this->db_connect_id);
|
||||
if (!in_array('STRICT_TRANS_TABLES', $modes))
|
||||
{
|
||||
$modes[] = 'STRICT_TRANS_TABLES';
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (version_compare($this->mysql_version, '4.0.0', '<'))
|
||||
{
|
||||
$this->sql_layer = 'mysql';
|
||||
|
||||
$mode = implode(',', $modes);
|
||||
@mysql_query("SET SESSION sql_mode='{$mode}'", $this->db_connect_id);
|
||||
}
|
||||
|
||||
return $this->db_connect_id;
|
||||
|
@ -103,7 +88,7 @@ class dbal_mysql extends dbal
|
|||
*/
|
||||
function sql_server_info()
|
||||
{
|
||||
return 'MySQL ' . $this->mysql_version;
|
||||
return 'MySQL ' . mysql_get_server_info($this->db_connect_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,8 +20,9 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
|
|||
|
||||
/**
|
||||
* MySQLi Database Abstraction Layer
|
||||
* mysqli-extension has to be compiled with:
|
||||
* MySQL 4.1+ or MySQL 5.0+
|
||||
* Compatible with:
|
||||
* MySQL 4.1+
|
||||
* MySQL 5.0+
|
||||
* @package dbal
|
||||
*/
|
||||
class dbal_mysqli extends dbal
|
||||
|
@ -29,7 +30,7 @@ class dbal_mysqli extends dbal
|
|||
var $multi_insert = true;
|
||||
|
||||
// Supports multiple table deletion
|
||||
var $multi_table_deletion = false;
|
||||
var $multi_table_deletion = true;
|
||||
|
||||
/**
|
||||
* Connect to server
|
||||
|
|
|
@ -1238,7 +1238,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
|
|||
case 'topic_approved':
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mysql4':
|
||||
case 'mysql':
|
||||
case 'mysqli':
|
||||
$sql = 'UPDATE ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
|
||||
SET t.topic_approved = p.post_approved
|
||||
|
@ -2739,7 +2739,6 @@ function view_warned_users(&$users, &$user_count, $limit = 0, $offset = 0, $limi
|
|||
|
||||
/**
|
||||
* Get database size
|
||||
* Currently only mysql and mssql are supported
|
||||
*/
|
||||
function get_database_size()
|
||||
{
|
||||
|
@ -2751,7 +2750,6 @@ function get_database_size()
|
|||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
case 'mysqli':
|
||||
$sql = 'SELECT VERSION() AS mysql_version';
|
||||
$result = $db->sql_query($sql);
|
||||
|
|
|
@ -44,7 +44,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
|||
),
|
||||
'mysqli' => array(
|
||||
'LABEL' => 'MySQL with MySQLi Extension',
|
||||
'SCHEMA' => 'mysql_41',
|
||||
'SCHEMA' => 'mysql',
|
||||
'MODULE' => 'mysqli',
|
||||
'DELIM' => ';',
|
||||
'COMMENTS' => 'remove_remarks',
|
||||
|
@ -194,7 +194,6 @@ function get_tables($db)
|
|||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
case 'mysqli':
|
||||
$sql = 'SHOW TABLES';
|
||||
break;
|
||||
|
@ -346,6 +345,13 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
|
|||
// Make sure that the user has selected a sensible DBAL for the DBMS actually installed
|
||||
switch ($dbms_details['DRIVER'])
|
||||
{
|
||||
case 'mysql':
|
||||
if (version_compare(mysql_get_server_info($db->db_connect_id), '4.1.3', '<'))
|
||||
{
|
||||
$error[] = $lang['INST_ERR_DB_NO_MYSQL'];
|
||||
}
|
||||
break;
|
||||
|
||||
case 'mysqli':
|
||||
if (version_compare(mysqli_get_server_info($db->db_connect_id), '4.1.3', '<'))
|
||||
{
|
||||
|
@ -432,11 +438,10 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
|
|||
{
|
||||
$error[] = $lang['INST_ERR_DB_NO_FIREBIRD_PS'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Kill the old table
|
||||
$db->sql_query('DROP TABLE ' . $final . ';');
|
||||
}
|
||||
|
||||
// Kill the old table
|
||||
$db->sql_query('DROP TABLE ' . $final . ';');
|
||||
|
||||
unset($final);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -50,11 +50,6 @@ class fulltext_mysql extends search_backend
|
|||
{
|
||||
global $db, $user;
|
||||
|
||||
if ($db->sql_layer != 'mysql4' && $db->sql_layer != 'mysqli')
|
||||
{
|
||||
return $user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_VERSION'];
|
||||
}
|
||||
|
||||
$result = $db->sql_query('SHOW TABLE STATUS LIKE \'' . POSTS_TABLE . '\'');
|
||||
$info = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
@ -628,27 +623,12 @@ class fulltext_mysql extends search_backend
|
|||
|
||||
if (!isset($this->stats['post_subject']))
|
||||
{
|
||||
if ($db->sql_layer == 'mysqli' || version_compare($db->mysql_version, '4.1.3', '>='))
|
||||
{
|
||||
//$alter[] = 'MODIFY post_subject varchar(100) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL';
|
||||
}
|
||||
else
|
||||
{
|
||||
$alter[] = 'MODIFY post_subject text NOT NULL';
|
||||
}
|
||||
$alter[] = 'ADD FULLTEXT (post_subject)';
|
||||
}
|
||||
|
||||
if (!isset($this->stats['post_text']))
|
||||
{
|
||||
if ($db->sql_layer == 'mysqli' || version_compare($db->mysql_version, '4.1.3', '>='))
|
||||
{
|
||||
$alter[] = 'MODIFY post_text mediumtext COLLATE utf8_unicode_ci NOT NULL';
|
||||
}
|
||||
else
|
||||
{
|
||||
$alter[] = 'MODIFY post_text mediumtext NOT NULL';
|
||||
}
|
||||
$alter[] = 'MODIFY post_text mediumtext COLLATE utf8_unicode_ci NOT NULL';
|
||||
$alter[] = 'ADD FULLTEXT (post_text)';
|
||||
}
|
||||
|
||||
|
|
|
@ -642,10 +642,8 @@ class fulltext_native extends search_backend
|
|||
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mysql4':
|
||||
case 'mysql':
|
||||
case 'mysqli':
|
||||
|
||||
// 3.x does not support SQL_CALC_FOUND_ROWS
|
||||
$sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT'];
|
||||
$is_mysql = true;
|
||||
|
||||
|
@ -844,7 +842,7 @@ class fulltext_native extends search_backend
|
|||
{
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mysql4':
|
||||
case 'mysql':
|
||||
case 'mysqli':
|
||||
$select = 'SQL_CALC_FOUND_ROWS ' . $select;
|
||||
$is_mysql = true;
|
||||
|
|
|
@ -1402,11 +1402,9 @@ class user extends session
|
|||
trigger_error('Could not get style data', E_USER_ERROR);
|
||||
}
|
||||
|
||||
// Now parse the cfg file and cache it
|
||||
$parsed_items = cache::obtain_cfg_items($this->theme);
|
||||
|
||||
// We are only interested in the theme configuration for now
|
||||
$parsed_items = $parsed_items['theme'];
|
||||
// Now parse the cfg file and cache it,
|
||||
// we are only interested in the theme configuration for now
|
||||
$parsed_items = cache::obtain_cfg_item($this->theme, 'theme');
|
||||
|
||||
$check_for = array(
|
||||
'parse_css_file' => (int) 0,
|
||||
|
|
|
@ -142,7 +142,7 @@ $inline_update = (request_var('type', 0)) ? true : false;
|
|||
|
||||
// Database column types mapping
|
||||
$dbms_type_map = array(
|
||||
'mysql_41' => array(
|
||||
'mysql' => array(
|
||||
'INT:' => 'int(%d)',
|
||||
'BINT' => 'bigint(20)',
|
||||
'UINT' => 'mediumint(8) UNSIGNED',
|
||||
|
@ -169,33 +169,6 @@ $dbms_type_map = array(
|
|||
'VARBINARY' => 'varbinary(255)',
|
||||
),
|
||||
|
||||
'mysql_40' => array(
|
||||
'INT:' => 'int(%d)',
|
||||
'BINT' => 'bigint(20)',
|
||||
'UINT' => 'mediumint(8) UNSIGNED',
|
||||
'UINT:' => 'int(%d) UNSIGNED',
|
||||
'TINT:' => 'tinyint(%d)',
|
||||
'USINT' => 'smallint(4) UNSIGNED',
|
||||
'BOOL' => 'tinyint(1) UNSIGNED',
|
||||
'VCHAR' => 'varbinary(255)',
|
||||
'VCHAR:' => 'varbinary(%d)',
|
||||
'CHAR:' => 'binary(%d)',
|
||||
'XSTEXT' => 'blob',
|
||||
'XSTEXT_UNI'=> 'blob',
|
||||
'STEXT' => 'blob',
|
||||
'STEXT_UNI' => 'blob',
|
||||
'TEXT' => 'blob',
|
||||
'TEXT_UNI' => 'blob',
|
||||
'MTEXT' => 'mediumblob',
|
||||
'MTEXT_UNI' => 'mediumblob',
|
||||
'TIMESTAMP' => 'int(11) UNSIGNED',
|
||||
'DECIMAL' => 'decimal(5,2)',
|
||||
'VCHAR_UNI' => 'blob',
|
||||
'VCHAR_UNI:'=> array('varbinary(%d)', 'limit' => array('mult', 3, 255, 'blob')),
|
||||
'VCHAR_CI' => 'blob',
|
||||
'VARBINARY' => 'varbinary(255)',
|
||||
),
|
||||
|
||||
'firebird' => array(
|
||||
'INT:' => 'INTEGER',
|
||||
'BINT' => 'DOUBLE PRECISION',
|
||||
|
@ -342,26 +315,11 @@ $database_update_info = array(
|
|||
// Determine mapping database type
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mysql':
|
||||
$map_dbms = 'mysql_40';
|
||||
break;
|
||||
|
||||
case 'mysql4':
|
||||
if (version_compare($db->mysql_version, '4.1.3', '>='))
|
||||
{
|
||||
$map_dbms = 'mysql_41';
|
||||
}
|
||||
else
|
||||
{
|
||||
$map_dbms = 'mysql_40';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'mysqli':
|
||||
$map_dbms = 'mysql_41';
|
||||
$map_dbms = 'mysql';
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
case 'mssql_odbc':
|
||||
$map_dbms = 'mssql';
|
||||
break;
|
||||
|
@ -643,7 +601,6 @@ switch ($db->sql_layer)
|
|||
{
|
||||
case 'mysql':
|
||||
case 'mysqli':
|
||||
case 'mysql4':
|
||||
$sql = 'OPTIMIZE TABLE ' . $table_prefix . 'auth_access, ' . $table_prefix . 'banlist, ' . $table_prefix . 'categories, ' . $table_prefix . 'config, ' . $table_prefix . 'disallow, ' . $table_prefix . 'forum_prune, ' . $table_prefix . 'forums, ' . $table_prefix . 'groups, ' . $table_prefix . 'posts, ' . $table_prefix . 'posts_text, ' . $table_prefix . 'privmsgs, ' . $table_prefix . 'privmsgs_text, ' . $table_prefix . 'ranks, ' . $table_prefix . 'search_results, ' . $table_prefix . 'search_wordlist, ' . $table_prefix . 'search_wordmatch, ' . $table_prefix . 'sessions_keys' . $table_prefix . 'smilies, ' . $table_prefix . 'themes, ' . $table_prefix . 'themes_name, ' . $table_prefix . 'topics, ' . $table_prefix . 'topics_watch, ' . $table_prefix . 'user_group, ' . $table_prefix . 'users, ' . $table_prefix . 'vote_desc, ' . $table_prefix . 'vote_results, ' . $table_prefix . 'vote_voters, ' . $table_prefix . 'words';
|
||||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
@ -792,8 +749,7 @@ function column_exists($dbms, $table, $column_name)
|
|||
|
||||
switch ($dbms)
|
||||
{
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$sql = "SHOW COLUMNS
|
||||
FROM $table";
|
||||
$result = $db->sql_query($sql);
|
||||
|
@ -1037,8 +993,7 @@ function prepare_column_data($dbms, $column_data, $table_name, $column_name)
|
|||
$return_array['column_type_sql_default'] = $sql_default;
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$sql .= " {$column_type} ";
|
||||
|
||||
// For hexadecimal values do not use single quotes
|
||||
|
@ -1054,7 +1009,7 @@ function prepare_column_data($dbms, $column_data, $table_name, $column_name)
|
|||
{
|
||||
$sql .= ' auto_increment';
|
||||
}
|
||||
else if ($dbms === 'mysql_41' && $column_data[2] == 'true_sort')
|
||||
else if ($column_data[2] == 'true_sort')
|
||||
{
|
||||
$sql .= ' COLLATE utf8_unicode_ci';
|
||||
}
|
||||
|
@ -1144,8 +1099,7 @@ function sql_column_add($dbms, $table_name, $column_name, $column_data)
|
|||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$sql = 'ALTER TABLE `' . $table_name . '` ADD COLUMN `' . $column_name . '` ' . $column_data['column_type_sql'];
|
||||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
@ -1241,8 +1195,7 @@ function sql_column_remove($dbms, $table_name, $column_name)
|
|||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$sql = 'ALTER TABLE `' . $table_name . '` DROP COLUMN `' . $column_name . '`';
|
||||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
@ -1331,8 +1284,7 @@ function sql_index_drop($dbms, $index_name, $table_name)
|
|||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$sql = 'DROP INDEX ' . $index_name . ' ON ' . $table_name;
|
||||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
@ -1368,8 +1320,7 @@ function sql_create_primary_key($dbms, $table_name, $column)
|
|||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$sql = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')';
|
||||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
@ -1445,8 +1396,7 @@ function sql_create_unique_index($dbms, $index_name, $table_name, $column)
|
|||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$sql = 'CREATE UNIQUE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
|
||||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
@ -1473,8 +1423,7 @@ function sql_create_index($dbms, $index_name, $table_name, $column)
|
|||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$sql = 'CREATE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
|
||||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
@ -1534,8 +1483,7 @@ function sql_list_index($dbms, $table_name)
|
|||
$col = 'index_name';
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$sql = 'SHOW KEYS
|
||||
FROM ' . $table_name;
|
||||
$col = 'Key_name';
|
||||
|
@ -1557,7 +1505,7 @@ function sql_list_index($dbms, $table_name)
|
|||
$result = $db->sql_query($sql);
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if (($dbms == 'mysql_40' || $dbms == 'mysql_41') && !$row['Non_unique'])
|
||||
if ($dbms == 'mysql' && !$row['Non_unique'])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -1628,8 +1576,7 @@ function sql_list_fake($dbms, $table_name)
|
|||
$col = 'index_name';
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$sql = 'SHOW KEYS
|
||||
FROM ' . $table_name;
|
||||
$col = 'Key_name';
|
||||
|
@ -1651,7 +1598,7 @@ function sql_list_fake($dbms, $table_name)
|
|||
$result = $db->sql_query($sql);
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if (($dbms == 'mysql_40' || $dbms == 'mysql_41') && !$row['Non_unique'])
|
||||
if ($dbms == 'mysql' && !$row['Non_unique'])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -1687,8 +1634,7 @@ function sql_column_change($dbms, $table_name, $column_name, $column_data)
|
|||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'mysql':
|
||||
$sql = 'ALTER TABLE `' . $table_name . '` CHANGE `' . $column_name . '` `' . $column_name . '` ' . $column_data['column_type_sql'];
|
||||
_sql($sql, $errored, $error_ary);
|
||||
break;
|
||||
|
|
|
@ -1158,19 +1158,6 @@ class install_install extends module
|
|||
// NOTE: trigger_error does not work here.
|
||||
$db->sql_return_on_error(true);
|
||||
|
||||
// If mysql is chosen, we need to adjust the schema filename slightly to reflect the correct version. ;)
|
||||
if ($data['dbms'] == 'mysql')
|
||||
{
|
||||
if (version_compare($db->mysql_version, '4.1.3', '>='))
|
||||
{
|
||||
$available_dbms[$data['dbms']]['SCHEMA'] .= '_41';
|
||||
}
|
||||
else
|
||||
{
|
||||
$available_dbms[$data['dbms']]['SCHEMA'] .= '_40';
|
||||
}
|
||||
}
|
||||
|
||||
// Ok we have the db info go ahead and read in the relevant schema
|
||||
// and work on building the table
|
||||
$dbms_schema = 'schemas/' . $available_dbms[$data['dbms']]['SCHEMA'] . '_schema.sql';
|
||||
|
|
|
@ -1,996 +0,0 @@
|
|||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
# Table: 'phpbb_attachments'
|
||||
CREATE TABLE phpbb_attachments (
|
||||
attach_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
post_msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
in_message tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
is_orphan tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
physical_filename varbinary(255) DEFAULT '' NOT NULL,
|
||||
real_filename varbinary(255) DEFAULT '' NOT NULL,
|
||||
download_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
attach_comment blob NOT NULL,
|
||||
extension varbinary(100) DEFAULT '' NOT NULL,
|
||||
mimetype varbinary(100) DEFAULT '' NOT NULL,
|
||||
filesize int(20) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
filetime int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
thumbnail tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (attach_id),
|
||||
KEY filetime (filetime),
|
||||
KEY post_msg_id (post_msg_id),
|
||||
KEY topic_id (topic_id),
|
||||
KEY poster_id (poster_id),
|
||||
KEY is_orphan (is_orphan)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_acl_groups'
|
||||
CREATE TABLE phpbb_acl_groups (
|
||||
group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
auth_setting tinyint(2) DEFAULT '0' NOT NULL,
|
||||
KEY group_id (group_id),
|
||||
KEY auth_opt_id (auth_option_id),
|
||||
KEY auth_role_id (auth_role_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_acl_options'
|
||||
CREATE TABLE phpbb_acl_options (
|
||||
auth_option_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
auth_option varbinary(50) DEFAULT '' NOT NULL,
|
||||
is_global tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
is_local tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
founder_only tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (auth_option_id),
|
||||
KEY auth_option (auth_option)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_acl_roles'
|
||||
CREATE TABLE phpbb_acl_roles (
|
||||
role_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
role_name blob NOT NULL,
|
||||
role_description blob NOT NULL,
|
||||
role_type varbinary(10) DEFAULT '' NOT NULL,
|
||||
role_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (role_id),
|
||||
KEY role_type (role_type),
|
||||
KEY role_order (role_order)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_acl_roles_data'
|
||||
CREATE TABLE phpbb_acl_roles_data (
|
||||
role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
auth_setting tinyint(2) DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (role_id, auth_option_id),
|
||||
KEY ath_op_id (auth_option_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_acl_users'
|
||||
CREATE TABLE phpbb_acl_users (
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
auth_setting tinyint(2) DEFAULT '0' NOT NULL,
|
||||
KEY user_id (user_id),
|
||||
KEY auth_option_id (auth_option_id),
|
||||
KEY auth_role_id (auth_role_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_banlist'
|
||||
CREATE TABLE phpbb_banlist (
|
||||
ban_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
ban_userid mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
ban_ip varbinary(40) DEFAULT '' NOT NULL,
|
||||
ban_email blob NOT NULL,
|
||||
ban_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
ban_end int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
ban_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
ban_reason blob NOT NULL,
|
||||
ban_give_reason blob NOT NULL,
|
||||
PRIMARY KEY (ban_id),
|
||||
KEY ban_end (ban_end),
|
||||
KEY ban_user (ban_userid, ban_exclude),
|
||||
KEY ban_email (ban_email(255), ban_exclude),
|
||||
KEY ban_ip (ban_ip, ban_exclude)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_bbcodes'
|
||||
CREATE TABLE phpbb_bbcodes (
|
||||
bbcode_id tinyint(3) DEFAULT '0' NOT NULL,
|
||||
bbcode_tag varbinary(16) DEFAULT '' NOT NULL,
|
||||
bbcode_helpline blob NOT NULL,
|
||||
display_on_posting tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
bbcode_match blob NOT NULL,
|
||||
bbcode_tpl mediumblob NOT NULL,
|
||||
first_pass_match mediumblob NOT NULL,
|
||||
first_pass_replace mediumblob NOT NULL,
|
||||
second_pass_match mediumblob NOT NULL,
|
||||
second_pass_replace mediumblob NOT NULL,
|
||||
PRIMARY KEY (bbcode_id),
|
||||
KEY display_on_post (display_on_posting)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_bookmarks'
|
||||
CREATE TABLE phpbb_bookmarks (
|
||||
topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (topic_id, user_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_bots'
|
||||
CREATE TABLE phpbb_bots (
|
||||
bot_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
bot_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
bot_name blob NOT NULL,
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
bot_agent varbinary(255) DEFAULT '' NOT NULL,
|
||||
bot_ip varbinary(255) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (bot_id),
|
||||
KEY bot_active (bot_active)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_config'
|
||||
CREATE TABLE phpbb_config (
|
||||
config_name varbinary(255) DEFAULT '' NOT NULL,
|
||||
config_value blob NOT NULL,
|
||||
is_dynamic tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (config_name),
|
||||
KEY is_dynamic (is_dynamic)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_confirm'
|
||||
CREATE TABLE phpbb_confirm (
|
||||
confirm_id binary(32) DEFAULT '' NOT NULL,
|
||||
session_id binary(32) DEFAULT '' NOT NULL,
|
||||
confirm_type tinyint(3) DEFAULT '0' NOT NULL,
|
||||
code varbinary(8) DEFAULT '' NOT NULL,
|
||||
seed int(10) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (session_id, confirm_id),
|
||||
KEY confirm_type (confirm_type)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_disallow'
|
||||
CREATE TABLE phpbb_disallow (
|
||||
disallow_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
disallow_username blob NOT NULL,
|
||||
PRIMARY KEY (disallow_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_drafts'
|
||||
CREATE TABLE phpbb_drafts (
|
||||
draft_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
save_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
draft_subject blob NOT NULL,
|
||||
draft_message mediumblob NOT NULL,
|
||||
PRIMARY KEY (draft_id),
|
||||
KEY save_time (save_time)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_extensions'
|
||||
CREATE TABLE phpbb_extensions (
|
||||
extension_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
extension varbinary(100) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (extension_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_extension_groups'
|
||||
CREATE TABLE phpbb_extension_groups (
|
||||
group_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
group_name blob NOT NULL,
|
||||
cat_id tinyint(2) DEFAULT '0' NOT NULL,
|
||||
allow_group tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
download_mode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
upload_icon varbinary(255) DEFAULT '' NOT NULL,
|
||||
max_filesize int(20) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
allowed_forums blob NOT NULL,
|
||||
allow_in_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (group_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_forums'
|
||||
CREATE TABLE phpbb_forums (
|
||||
forum_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_parents mediumblob NOT NULL,
|
||||
forum_name blob NOT NULL,
|
||||
forum_desc blob NOT NULL,
|
||||
forum_desc_bitfield varbinary(255) DEFAULT '' NOT NULL,
|
||||
forum_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
|
||||
forum_desc_uid varbinary(8) DEFAULT '' NOT NULL,
|
||||
forum_link blob NOT NULL,
|
||||
forum_password varbinary(120) DEFAULT '' NOT NULL,
|
||||
forum_style smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_image varbinary(255) DEFAULT '' NOT NULL,
|
||||
forum_rules blob NOT NULL,
|
||||
forum_rules_link blob NOT NULL,
|
||||
forum_rules_bitfield varbinary(255) DEFAULT '' NOT NULL,
|
||||
forum_rules_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
|
||||
forum_rules_uid varbinary(8) DEFAULT '' NOT NULL,
|
||||
forum_topics_per_page tinyint(4) DEFAULT '0' NOT NULL,
|
||||
forum_type tinyint(4) DEFAULT '0' NOT NULL,
|
||||
forum_status tinyint(4) DEFAULT '0' NOT NULL,
|
||||
forum_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_topics mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_topics_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_last_post_subject blob NOT NULL,
|
||||
forum_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_last_poster_name blob NOT NULL,
|
||||
forum_last_poster_colour varbinary(6) DEFAULT '' NOT NULL,
|
||||
forum_flags tinyint(4) DEFAULT '32' NOT NULL,
|
||||
display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
prune_next int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
prune_days mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
prune_viewed mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
prune_freq mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (forum_id),
|
||||
KEY left_right_id (left_id, right_id),
|
||||
KEY forum_lastpost_id (forum_last_post_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_forums_access'
|
||||
CREATE TABLE phpbb_forums_access (
|
||||
forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
session_id binary(32) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (forum_id, user_id, session_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_forums_track'
|
||||
CREATE TABLE phpbb_forums_track (
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (user_id, forum_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_forums_watch'
|
||||
CREATE TABLE phpbb_forums_watch (
|
||||
forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
KEY forum_id (forum_id),
|
||||
KEY user_id (user_id),
|
||||
KEY notify_stat (notify_status)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_groups'
|
||||
CREATE TABLE phpbb_groups (
|
||||
group_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
group_type tinyint(4) DEFAULT '1' NOT NULL,
|
||||
group_founder_manage tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
group_name blob NOT NULL,
|
||||
group_desc blob NOT NULL,
|
||||
group_desc_bitfield varbinary(255) DEFAULT '' NOT NULL,
|
||||
group_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
|
||||
group_desc_uid varbinary(8) DEFAULT '' NOT NULL,
|
||||
group_display tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
group_avatar varbinary(255) DEFAULT '' NOT NULL,
|
||||
group_avatar_type tinyint(2) DEFAULT '0' NOT NULL,
|
||||
group_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
group_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
group_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
group_colour varbinary(6) DEFAULT '' NOT NULL,
|
||||
group_sig_chars mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
group_legend tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
PRIMARY KEY (group_id),
|
||||
KEY group_legend (group_legend)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_icons'
|
||||
CREATE TABLE phpbb_icons (
|
||||
icons_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
icons_url varbinary(255) DEFAULT '' NOT NULL,
|
||||
icons_width tinyint(4) DEFAULT '0' NOT NULL,
|
||||
icons_height tinyint(4) DEFAULT '0' NOT NULL,
|
||||
icons_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
PRIMARY KEY (icons_id),
|
||||
KEY display_on_posting (display_on_posting)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_lang'
|
||||
CREATE TABLE phpbb_lang (
|
||||
lang_id tinyint(4) NOT NULL auto_increment,
|
||||
lang_iso varbinary(30) DEFAULT '' NOT NULL,
|
||||
lang_dir varbinary(30) DEFAULT '' NOT NULL,
|
||||
lang_english_name blob NOT NULL,
|
||||
lang_local_name blob NOT NULL,
|
||||
lang_author blob NOT NULL,
|
||||
PRIMARY KEY (lang_id),
|
||||
KEY lang_iso (lang_iso)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_log'
|
||||
CREATE TABLE phpbb_log (
|
||||
log_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
log_type tinyint(4) DEFAULT '0' NOT NULL,
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
reportee_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
log_ip varbinary(40) DEFAULT '' NOT NULL,
|
||||
log_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
log_operation blob NOT NULL,
|
||||
log_data mediumblob NOT NULL,
|
||||
PRIMARY KEY (log_id),
|
||||
KEY log_type (log_type),
|
||||
KEY forum_id (forum_id),
|
||||
KEY topic_id (topic_id),
|
||||
KEY reportee_id (reportee_id),
|
||||
KEY user_id (user_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_moderator_cache'
|
||||
CREATE TABLE phpbb_moderator_cache (
|
||||
forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
username blob NOT NULL,
|
||||
group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
group_name blob NOT NULL,
|
||||
display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
KEY disp_idx (display_on_index),
|
||||
KEY forum_id (forum_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_modules'
|
||||
CREATE TABLE phpbb_modules (
|
||||
module_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
module_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
module_display tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
module_basename varbinary(255) DEFAULT '' NOT NULL,
|
||||
module_class varbinary(10) DEFAULT '' NOT NULL,
|
||||
parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
module_langname varbinary(255) DEFAULT '' NOT NULL,
|
||||
module_mode varbinary(255) DEFAULT '' NOT NULL,
|
||||
module_auth varbinary(255) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (module_id),
|
||||
KEY left_right_id (left_id, right_id),
|
||||
KEY module_enabled (module_enabled),
|
||||
KEY class_left_id (module_class, left_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_poll_options'
|
||||
CREATE TABLE phpbb_poll_options (
|
||||
poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
|
||||
topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
poll_option_text blob NOT NULL,
|
||||
poll_option_total mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
KEY poll_opt_id (poll_option_id),
|
||||
KEY topic_id (topic_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_poll_votes'
|
||||
CREATE TABLE phpbb_poll_votes (
|
||||
topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
|
||||
vote_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
vote_user_ip varbinary(40) DEFAULT '' NOT NULL,
|
||||
KEY topic_id (topic_id),
|
||||
KEY vote_user_id (vote_user_id),
|
||||
KEY vote_user_ip (vote_user_ip)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_posts'
|
||||
CREATE TABLE phpbb_posts (
|
||||
post_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
poster_ip varbinary(40) DEFAULT '' NOT NULL,
|
||||
post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
post_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
post_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
post_username blob NOT NULL,
|
||||
post_subject blob NOT NULL,
|
||||
post_text mediumblob NOT NULL,
|
||||
post_checksum varbinary(32) DEFAULT '' NOT NULL,
|
||||
post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
bbcode_bitfield varbinary(255) DEFAULT '' NOT NULL,
|
||||
bbcode_uid varbinary(8) DEFAULT '' NOT NULL,
|
||||
post_postcount tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
post_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
post_edit_reason blob NOT NULL,
|
||||
post_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
post_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
post_edit_locked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (post_id),
|
||||
KEY forum_id (forum_id),
|
||||
KEY topic_id (topic_id),
|
||||
KEY poster_ip (poster_ip),
|
||||
KEY poster_id (poster_id),
|
||||
KEY post_approved (post_approved),
|
||||
KEY tid_post_time (topic_id, post_time)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_privmsgs'
|
||||
CREATE TABLE phpbb_privmsgs (
|
||||
msg_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
root_level mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
author_ip varbinary(40) DEFAULT '' NOT NULL,
|
||||
message_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
message_subject blob NOT NULL,
|
||||
message_text mediumblob NOT NULL,
|
||||
message_edit_reason blob NOT NULL,
|
||||
message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
message_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
bbcode_bitfield varbinary(255) DEFAULT '' NOT NULL,
|
||||
bbcode_uid varbinary(8) DEFAULT '' NOT NULL,
|
||||
message_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
message_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
to_address blob NOT NULL,
|
||||
bcc_address blob NOT NULL,
|
||||
PRIMARY KEY (msg_id),
|
||||
KEY author_ip (author_ip),
|
||||
KEY message_time (message_time),
|
||||
KEY author_id (author_id),
|
||||
KEY root_level (root_level)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_privmsgs_folder'
|
||||
CREATE TABLE phpbb_privmsgs_folder (
|
||||
folder_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
folder_name blob NOT NULL,
|
||||
pm_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (folder_id),
|
||||
KEY user_id (user_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_privmsgs_rules'
|
||||
CREATE TABLE phpbb_privmsgs_rules (
|
||||
rule_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
rule_check mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
rule_connection mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
rule_string blob NOT NULL,
|
||||
rule_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
rule_group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
rule_action mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
rule_folder_id int(11) DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (rule_id),
|
||||
KEY user_id (user_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_privmsgs_to'
|
||||
CREATE TABLE phpbb_privmsgs_to (
|
||||
msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
pm_deleted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
pm_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
pm_unread tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
pm_replied tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
pm_marked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
pm_forwarded tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
folder_id int(11) DEFAULT '0' NOT NULL,
|
||||
KEY msg_id (msg_id),
|
||||
KEY author_id (author_id),
|
||||
KEY usr_flder_id (user_id, folder_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_profile_fields'
|
||||
CREATE TABLE phpbb_profile_fields (
|
||||
field_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
field_name blob NOT NULL,
|
||||
field_type tinyint(4) DEFAULT '0' NOT NULL,
|
||||
field_ident varbinary(20) DEFAULT '' NOT NULL,
|
||||
field_length varbinary(20) DEFAULT '' NOT NULL,
|
||||
field_minlen varbinary(255) DEFAULT '' NOT NULL,
|
||||
field_maxlen varbinary(255) DEFAULT '' NOT NULL,
|
||||
field_novalue blob NOT NULL,
|
||||
field_default_value blob NOT NULL,
|
||||
field_validation varbinary(60) DEFAULT '' NOT NULL,
|
||||
field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
field_hide tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
field_no_view tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
field_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
field_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (field_id),
|
||||
KEY fld_type (field_type),
|
||||
KEY fld_ordr (field_order)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_profile_fields_data'
|
||||
CREATE TABLE phpbb_profile_fields_data (
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (user_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_profile_fields_lang'
|
||||
CREATE TABLE phpbb_profile_fields_lang (
|
||||
field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
field_type tinyint(4) DEFAULT '0' NOT NULL,
|
||||
lang_value blob NOT NULL,
|
||||
PRIMARY KEY (field_id, lang_id, option_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_profile_lang'
|
||||
CREATE TABLE phpbb_profile_lang (
|
||||
field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
lang_name blob NOT NULL,
|
||||
lang_explain blob NOT NULL,
|
||||
lang_default_value blob NOT NULL,
|
||||
PRIMARY KEY (field_id, lang_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_ranks'
|
||||
CREATE TABLE phpbb_ranks (
|
||||
rank_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
rank_title blob NOT NULL,
|
||||
rank_min mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
rank_special tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
rank_image varbinary(255) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (rank_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_reports'
|
||||
CREATE TABLE phpbb_reports (
|
||||
report_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
reason_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
report_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
report_text mediumblob NOT NULL,
|
||||
PRIMARY KEY (report_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_reports_reasons'
|
||||
CREATE TABLE phpbb_reports_reasons (
|
||||
reason_id smallint(4) UNSIGNED NOT NULL auto_increment,
|
||||
reason_title blob NOT NULL,
|
||||
reason_description mediumblob NOT NULL,
|
||||
reason_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (reason_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_search_results'
|
||||
CREATE TABLE phpbb_search_results (
|
||||
search_key varbinary(32) DEFAULT '' NOT NULL,
|
||||
search_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
search_keywords mediumblob NOT NULL,
|
||||
search_authors mediumblob NOT NULL,
|
||||
PRIMARY KEY (search_key)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_search_wordlist'
|
||||
CREATE TABLE phpbb_search_wordlist (
|
||||
word_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
word_text blob NOT NULL,
|
||||
word_common tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
word_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (word_id),
|
||||
UNIQUE wrd_txt (word_text(255)),
|
||||
KEY wrd_cnt (word_count)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_search_wordmatch'
|
||||
CREATE TABLE phpbb_search_wordmatch (
|
||||
post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
word_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
title_match tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
UNIQUE unq_mtch (word_id, post_id, title_match),
|
||||
KEY word_id (word_id),
|
||||
KEY post_id (post_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_sessions'
|
||||
CREATE TABLE phpbb_sessions (
|
||||
session_id binary(32) DEFAULT '' NOT NULL,
|
||||
session_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
session_last_visit int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
session_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
session_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
session_ip varbinary(40) DEFAULT '' NOT NULL,
|
||||
session_browser varbinary(150) DEFAULT '' NOT NULL,
|
||||
session_forwarded_for varbinary(255) DEFAULT '' NOT NULL,
|
||||
session_page blob NOT NULL,
|
||||
session_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
session_autologin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
session_admin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (session_id),
|
||||
KEY session_time (session_time),
|
||||
KEY session_user_id (session_user_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_sessions_keys'
|
||||
CREATE TABLE phpbb_sessions_keys (
|
||||
key_id binary(32) DEFAULT '' NOT NULL,
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
last_ip varbinary(40) DEFAULT '' NOT NULL,
|
||||
last_login int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (key_id, user_id),
|
||||
KEY last_login (last_login)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_sitelist'
|
||||
CREATE TABLE phpbb_sitelist (
|
||||
site_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
site_ip varbinary(40) DEFAULT '' NOT NULL,
|
||||
site_hostname varbinary(255) DEFAULT '' NOT NULL,
|
||||
ip_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (site_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_smilies'
|
||||
CREATE TABLE phpbb_smilies (
|
||||
smiley_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
code varbinary(150) DEFAULT '' NOT NULL,
|
||||
emotion varbinary(150) DEFAULT '' NOT NULL,
|
||||
smiley_url varbinary(50) DEFAULT '' NOT NULL,
|
||||
smiley_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
smiley_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
smiley_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
PRIMARY KEY (smiley_id),
|
||||
KEY display_on_post (display_on_posting)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_styles'
|
||||
CREATE TABLE phpbb_styles (
|
||||
style_id smallint(4) UNSIGNED NOT NULL auto_increment,
|
||||
style_name blob NOT NULL,
|
||||
style_copyright blob NOT NULL,
|
||||
style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
template_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
theme_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
imageset_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (style_id),
|
||||
UNIQUE style_name (style_name(255)),
|
||||
KEY template_id (template_id),
|
||||
KEY theme_id (theme_id),
|
||||
KEY imageset_id (imageset_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_styles_template'
|
||||
CREATE TABLE phpbb_styles_template (
|
||||
template_id smallint(4) UNSIGNED NOT NULL auto_increment,
|
||||
template_name blob NOT NULL,
|
||||
template_copyright blob NOT NULL,
|
||||
template_path varbinary(100) DEFAULT '' NOT NULL,
|
||||
bbcode_bitfield varbinary(255) DEFAULT 'kNg=' NOT NULL,
|
||||
template_storedb tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (template_id),
|
||||
UNIQUE tmplte_nm (template_name(255))
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_styles_template_data'
|
||||
CREATE TABLE phpbb_styles_template_data (
|
||||
template_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
template_filename varbinary(100) DEFAULT '' NOT NULL,
|
||||
template_included blob NOT NULL,
|
||||
template_mtime int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
template_data mediumblob NOT NULL,
|
||||
KEY tid (template_id),
|
||||
KEY tfn (template_filename)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_styles_theme'
|
||||
CREATE TABLE phpbb_styles_theme (
|
||||
theme_id smallint(4) UNSIGNED NOT NULL auto_increment,
|
||||
theme_name blob NOT NULL,
|
||||
theme_copyright blob NOT NULL,
|
||||
theme_path varbinary(100) DEFAULT '' NOT NULL,
|
||||
theme_storedb tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
theme_mtime int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
theme_data mediumblob NOT NULL,
|
||||
PRIMARY KEY (theme_id),
|
||||
UNIQUE theme_name (theme_name(255))
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_styles_imageset'
|
||||
CREATE TABLE phpbb_styles_imageset (
|
||||
imageset_id smallint(4) UNSIGNED NOT NULL auto_increment,
|
||||
imageset_name blob NOT NULL,
|
||||
imageset_copyright blob NOT NULL,
|
||||
imageset_path varbinary(100) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (imageset_id),
|
||||
UNIQUE imgset_nm (imageset_name(255))
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_styles_imageset_data'
|
||||
CREATE TABLE phpbb_styles_imageset_data (
|
||||
image_id smallint(4) UNSIGNED NOT NULL auto_increment,
|
||||
image_name varbinary(200) DEFAULT '' NOT NULL,
|
||||
image_filename varbinary(200) DEFAULT '' NOT NULL,
|
||||
image_lang varbinary(30) DEFAULT '' NOT NULL,
|
||||
image_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
image_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
imageset_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (image_id),
|
||||
KEY i_d (imageset_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_topics'
|
||||
CREATE TABLE phpbb_topics (
|
||||
topic_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
topic_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_title blob NOT NULL,
|
||||
topic_poster mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_time_limit int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_views mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_replies mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_replies_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_status tinyint(3) DEFAULT '0' NOT NULL,
|
||||
topic_type tinyint(3) DEFAULT '0' NOT NULL,
|
||||
topic_first_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_first_poster_name blob NOT NULL,
|
||||
topic_first_poster_colour varbinary(6) DEFAULT '' NOT NULL,
|
||||
topic_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_last_poster_name blob NOT NULL,
|
||||
topic_last_poster_colour varbinary(6) DEFAULT '' NOT NULL,
|
||||
topic_last_post_subject blob NOT NULL,
|
||||
topic_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_last_view_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_moved_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_bumped tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_bumper mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
poll_title blob NOT NULL,
|
||||
poll_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
poll_length int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
poll_max_options tinyint(4) DEFAULT '1' NOT NULL,
|
||||
poll_last_vote int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
poll_vote_change tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (topic_id),
|
||||
KEY forum_id (forum_id),
|
||||
KEY forum_id_type (forum_id, topic_type),
|
||||
KEY last_post_time (topic_last_post_time),
|
||||
KEY topic_approved (topic_approved),
|
||||
KEY forum_appr_last (forum_id, topic_approved, topic_last_post_id),
|
||||
KEY fid_time_moved (forum_id, topic_last_post_time, topic_moved_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_topics_track'
|
||||
CREATE TABLE phpbb_topics_track (
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (user_id, topic_id),
|
||||
KEY forum_id (forum_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_topics_posted'
|
||||
CREATE TABLE phpbb_topics_posted (
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
topic_posted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (user_id, topic_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_topics_watch'
|
||||
CREATE TABLE phpbb_topics_watch (
|
||||
topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
KEY topic_id (topic_id),
|
||||
KEY user_id (user_id),
|
||||
KEY notify_stat (notify_status)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_user_group'
|
||||
CREATE TABLE phpbb_user_group (
|
||||
group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
group_leader tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_pending tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
KEY group_id (group_id),
|
||||
KEY user_id (user_id),
|
||||
KEY group_leader (group_leader)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_users'
|
||||
CREATE TABLE phpbb_users (
|
||||
user_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
user_type tinyint(2) DEFAULT '0' NOT NULL,
|
||||
group_id mediumint(8) UNSIGNED DEFAULT '3' NOT NULL,
|
||||
user_permissions mediumblob NOT NULL,
|
||||
user_perm_from mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_ip varbinary(40) DEFAULT '' NOT NULL,
|
||||
user_regdate int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
username blob NOT NULL,
|
||||
username_clean blob NOT NULL,
|
||||
user_password varbinary(120) DEFAULT '' NOT NULL,
|
||||
user_passchg int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_pass_convert tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_email blob NOT NULL,
|
||||
user_email_hash bigint(20) DEFAULT '0' NOT NULL,
|
||||
user_birthday varbinary(10) DEFAULT '' NOT NULL,
|
||||
user_lastvisit int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_lastmark int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_lastpost_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_lastpage blob NOT NULL,
|
||||
user_last_confirm_key varbinary(10) DEFAULT '' NOT NULL,
|
||||
user_last_search int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_warnings tinyint(4) DEFAULT '0' NOT NULL,
|
||||
user_last_warning int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_login_attempts tinyint(4) DEFAULT '0' NOT NULL,
|
||||
user_inactive_reason tinyint(2) DEFAULT '0' NOT NULL,
|
||||
user_inactive_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_lang varbinary(30) DEFAULT '' NOT NULL,
|
||||
user_timezone decimal(5,2) DEFAULT '0' NOT NULL,
|
||||
user_dst tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_dateformat varbinary(90) DEFAULT 'd M Y H:i' NOT NULL,
|
||||
user_style smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_colour varbinary(6) DEFAULT '' NOT NULL,
|
||||
user_new_privmsg int(4) DEFAULT '0' NOT NULL,
|
||||
user_unread_privmsg int(4) DEFAULT '0' NOT NULL,
|
||||
user_last_privmsg int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_message_rules tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_full_folder int(11) DEFAULT '-3' NOT NULL,
|
||||
user_emailtime int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_topic_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_topic_sortby_type varbinary(1) DEFAULT 't' NOT NULL,
|
||||
user_topic_sortby_dir varbinary(1) DEFAULT 'd' NOT NULL,
|
||||
user_post_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_post_sortby_type varbinary(1) DEFAULT 't' NOT NULL,
|
||||
user_post_sortby_dir varbinary(1) DEFAULT 'a' NOT NULL,
|
||||
user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_notify_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
user_notify_type tinyint(4) DEFAULT '0' NOT NULL,
|
||||
user_allow_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
user_allow_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
user_allow_viewemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
user_allow_massemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
user_options int(11) UNSIGNED DEFAULT '895' NOT NULL,
|
||||
user_avatar varbinary(255) DEFAULT '' NOT NULL,
|
||||
user_avatar_type tinyint(2) DEFAULT '0' NOT NULL,
|
||||
user_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
user_sig mediumblob NOT NULL,
|
||||
user_sig_bbcode_uid varbinary(8) DEFAULT '' NOT NULL,
|
||||
user_sig_bbcode_bitfield varbinary(255) DEFAULT '' NOT NULL,
|
||||
user_from blob NOT NULL,
|
||||
user_icq varbinary(15) DEFAULT '' NOT NULL,
|
||||
user_aim blob NOT NULL,
|
||||
user_yim blob NOT NULL,
|
||||
user_msnm blob NOT NULL,
|
||||
user_jabber blob NOT NULL,
|
||||
user_website blob NOT NULL,
|
||||
user_occ blob NOT NULL,
|
||||
user_interests blob NOT NULL,
|
||||
user_actkey varbinary(32) DEFAULT '' NOT NULL,
|
||||
user_newpasswd varbinary(120) DEFAULT '' NOT NULL,
|
||||
user_form_salt varbinary(96) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (user_id),
|
||||
KEY user_birthday (user_birthday),
|
||||
KEY user_email_hash (user_email_hash),
|
||||
KEY user_type (user_type),
|
||||
UNIQUE username_clean (username_clean(255))
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_warnings'
|
||||
CREATE TABLE phpbb_warnings (
|
||||
warning_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
log_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
warning_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (warning_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_words'
|
||||
CREATE TABLE phpbb_words (
|
||||
word_id mediumint(8) UNSIGNED NOT NULL auto_increment,
|
||||
word blob NOT NULL,
|
||||
replacement blob NOT NULL,
|
||||
PRIMARY KEY (word_id)
|
||||
);
|
||||
|
||||
|
||||
# Table: 'phpbb_zebra'
|
||||
CREATE TABLE phpbb_zebra (
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
zebra_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
friend tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
foe tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (user_id, zebra_id)
|
||||
);
|
||||
|
||||
|
|
@ -205,7 +205,7 @@ $lang = array_merge($lang, array(
|
|||
|
||||
<p>phpBB3 supports the following databases:</p>
|
||||
<ul>
|
||||
<li>MySQL 3.23 or above (MySQLi supported)</li>
|
||||
<li>MySQL 4.1 or above (MySQLi supported)</li>
|
||||
<li>PostgreSQL 7.3+</li>
|
||||
<li>SQLite 2.8.2+</li>
|
||||
<li>Firebird 2.0+</li>
|
||||
|
@ -227,6 +227,7 @@ $lang = array_merge($lang, array(
|
|||
'INST_ERR_DB_CONNECT' => 'Could not connect to the database, see error message below.',
|
||||
'INST_ERR_DB_FORUM_PATH' => 'The database file specified is within your board directory tree. You should put this file in a non web-accessible location.',
|
||||
'INST_ERR_DB_NO_ERROR' => 'No error message given.',
|
||||
'INST_ERR_DB_NO_MYSQL' => 'The version of MySQL installed on the target server must be at least 4.1, phpBB 3.1 cannot be installed on an older version.',
|
||||
'INST_ERR_DB_NO_MYSQLI' => 'The version of MySQL installed on this machine is incompatible with the “MySQL with MySQLi Extension” option you have selected. Please try the “MySQL” option instead.',
|
||||
'INST_ERR_DB_NO_SQLITE' => 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 2.8.2.',
|
||||
'INST_ERR_DB_NO_ORACLE' => 'The version of Oracle installed on this machine requires you to set the <var>NLS_CHARACTERSET</var> parameter to <var>UTF8</var>. Either upgrade your installation to 9.2+ or change the parameter.',
|
||||
|
@ -294,7 +295,7 @@ $lang = array_merge($lang, array(
|
|||
'PHP_REGISTER_GLOBALS_EXPLAIN' => 'phpBB will still run if this setting is enabled, but if possible, it is recommended that register_globals is disabled on your PHP install for security reasons.',
|
||||
'PHP_SAFE_MODE' => 'Safe mode',
|
||||
'PHP_SETTINGS' => 'PHP version and settings',
|
||||
'PHP_SETTINGS_EXPLAIN' => '<strong>Required</strong> - You must be running at least version 4.3.3 of PHP in order to install phpBB. If <var>safe mode</var> is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.',
|
||||
'PHP_SETTINGS_EXPLAIN' => '<strong>Required</strong> - You must be running at least version 5.1.0 of PHP in order to install phpBB. If <var>safe mode</var> is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.',
|
||||
'PHP_URL_FOPEN_SUPPORT' => 'PHP setting <var>allow_url_fopen</var> is enabled',
|
||||
'PHP_URL_FOPEN_SUPPORT_EXPLAIN' => '<strong>Optional</strong> - This setting is optional, however certain phpBB functions like off-site avatars will not work properly without it. ',
|
||||
'PHP_VERSION_REQD' => 'PHP version >= 5.1.0',
|
||||
|
|
Loading…
Add table
Reference in a new issue