This should end some issues we have been having regarding the proper binary encoding of stuff. :D

Acyd Burn: quit breaking the schema :P


git-svn-id: file:///svn/phpbb/trunk@6238 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M 2006-08-06 05:52:41 +00:00
parent b4b901b825
commit 2f901a5203
13 changed files with 250 additions and 817 deletions

View file

@ -919,72 +919,8 @@ class acp_forums
$forum_id = $forum_data_sql['forum_id']; $forum_id = $forum_data_sql['forum_id'];
unset($forum_data_sql['forum_id']); unset($forum_data_sql['forum_id']);
$query = '';
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$values = array();
foreach ($forum_data_sql as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'forum_desc_bitfield' && $key != 'forum_rules_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
case 'sqlite':
$values = array();
foreach ($forum_data_sql as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'forum_desc_bitfield' && $key != 'forum_rules_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = '" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
default:
$query = $db->sql_build_array('UPDATE', $forum_data_sql);
break;
}
$sql = 'UPDATE ' . FORUMS_TABLE . ' $sql = 'UPDATE ' . FORUMS_TABLE . '
SET ' . $query . ' SET ' . $db->sql_build_array('UPDATE', $forum_data_sql) . '
WHERE forum_id = ' . $forum_id; WHERE forum_id = ' . $forum_id;
$db->sql_query($sql); $db->sql_query($sql);

View file

@ -2949,78 +2949,10 @@ pagination_sep = \'{PAGINATION_SEP}\'
unset($cfg_data); unset($cfg_data);
} }
$query = '';
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$fields = array();
foreach ($sql_ary as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
case 'sqlite':
$fields = array();
foreach ($sql_ary as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "'" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
default:
$query = $db->sql_build_array('INSERT', $sql_ary);
break;
}
$db->sql_transaction('begin'); $db->sql_transaction('begin');
$sql = "INSERT INTO $sql_from $sql = "INSERT INTO $sql_from
" . $query; " . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql); $db->sql_query($sql);
$id = $db->sql_nextid(); $id = $db->sql_nextid();

View file

@ -198,9 +198,16 @@ class dbal
$values[] = 'NULL'; $values[] = 'NULL';
} }
else if (is_string($var)) else if (is_string($var))
{
if (strpos($key, 'bitfield') === false)
{ {
$values[] = "'" . $this->sql_escape($var) . "'"; $values[] = "'" . $this->sql_escape($var) . "'";
} }
else
{
$values[] = $this->sql_escape_binary($var);
}
}
else if (is_array($var) && is_string($var[0])) else if (is_array($var) && is_string($var[0]))
{ {
// This is used for INSERT_SELECT(s) // This is used for INSERT_SELECT(s)
@ -227,10 +234,17 @@ class dbal
$values[] = 'NULL'; $values[] = 'NULL';
} }
else if (is_string($var)) else if (is_string($var))
{
if (strpos($key, 'bitfield') === false)
{ {
$values[] = "'" . $this->sql_escape($var) . "'"; $values[] = "'" . $this->sql_escape($var) . "'";
} }
else else
{
$values[] = $this->sql_escape_binary($var);
}
}
else
{ {
$values[] = (is_bool($var)) ? intval($var) : $var; $values[] = (is_bool($var)) ? intval($var) : $var;
} }
@ -250,10 +264,17 @@ class dbal
$values[] = "$key = NULL"; $values[] = "$key = NULL";
} }
else if (is_string($var)) else if (is_string($var))
{
if (strpos($key, 'bitfield') === false)
{ {
$values[] = "$key = '" . $this->sql_escape($var) . "'"; $values[] = "$key = '" . $this->sql_escape($var) . "'";
} }
else else
{
$values[] = "$key = " . $this->sql_escape_binary($var);
}
}
else
{ {
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var"; $values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
} }
@ -264,6 +285,11 @@ class dbal
return $query; return $query;
} }
function sql_escape_binary($msg)
{
return "'" . $this->sql_escape($msg) . "'";
}
/** /**
* Build sql statement from array for select and select distinct statements * Build sql statement from array for select and select distinct statements
* *

View file

@ -369,6 +369,14 @@ class dbal_mssql extends dbal
return str_replace("'", "''", $msg); return str_replace("'", "''", $msg);
} }
/**
* Escape string used in sql query
*/
function sql_escape_binary($msg)
{
return "CAST('" . $msg . "' AS varbinary)";
}
/** /**
* return sql error array * return sql error array
* @access: private * @access: private

View file

@ -379,6 +379,14 @@ class dbal_mssql_odbc extends dbal
return str_replace("'", "''", $msg); return str_replace("'", "''", $msg);
} }
/**
* Escape string used in sql query
*/
function sql_escape_binary($msg)
{
return "CAST('" . $msg . "' AS varbinary)";
}
/** /**
* Build db-specific query data * Build db-specific query data
* @access: private * @access: private

View file

@ -258,7 +258,16 @@ class dbal_postgres extends dbal
return $cache->sql_fetchrow($query_id); return $cache->sql_fetchrow($query_id);
} }
return ($query_id) ? @pg_fetch_assoc($query_id, NULL) : false; $row = @pg_fetch_assoc($query_id, null);
if ($row)
{
foreach ($row as $key => $value)
{
$row[$key] = (strpos($key, 'bitfield') === false) ? $value : pg_unescape_bytea($value);
}
}
return ($query_id) ? $row : false;
} }
/** /**
@ -378,6 +387,14 @@ class dbal_postgres extends dbal
return @pg_escape_string($msg); return @pg_escape_string($msg);
} }
/**
* Escape string used in sql query
*/
function sql_escape_binary($msg)
{
return "'" . @pg_escape_bytea($msg) . "'";
}
/** /**
* return sql error array * return sql error array
* @access: private * @access: private

View file

@ -216,7 +216,16 @@ class dbal_sqlite extends dbal
return $cache->sql_fetchrow($query_id); return $cache->sql_fetchrow($query_id);
} }
return ($query_id) ? @sqlite_fetch_array($query_id, SQLITE_ASSOC) : false; $row = @sqlite_fetch_array($query_id, SQLITE_ASSOC);
if ($row)
{
foreach ($row as $key => $value)
{
$row[$key] = (strpos($key, 'bitfield') === false) ? $value : sqlite_udf_decode_binary($value);
}
}
return $row;
} }
/** /**
@ -307,6 +316,14 @@ class dbal_sqlite extends dbal
return @sqlite_escape_string($msg); return @sqlite_escape_string($msg);
} }
/**
* Escape string used in sql query
*/
function sql_escape_binary($msg)
{
return "'" . @sqlite_udf_encode_binary($msg) . "'";
}
/** /**
* return sql error array * return sql error array
* @access: private * @access: private

View file

@ -1549,76 +1549,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
); );
} }
$query = ''; $sql = 'INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_data[POSTS_TABLE]['sql']);
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$fields = array();
foreach ($sql_data[POSTS_TABLE]['sql'] as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
case 'sqlite':
$fields = array();
foreach ($sql_data[POSTS_TABLE]['sql'] as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "'" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
default:
$query = $db->sql_build_array('INSERT', $sql_data[POSTS_TABLE]['sql']);
break;
}
$sql = 'INSERT INTO ' . POSTS_TABLE . ' ' . $query;
$db->sql_query($sql); $db->sql_query($sql);
$data['post_id'] = $db->sql_nextid(); $data['post_id'] = $db->sql_nextid();
@ -1694,70 +1625,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
// Update the posts table // Update the posts table
if (isset($sql_data[POSTS_TABLE]['sql'])) if (isset($sql_data[POSTS_TABLE]['sql']))
{ {
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$values = array();
foreach ($sql_data[POSTS_TABLE]['sql'] as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
case 'sqlite':
$values = array();
foreach ($sql_data[POSTS_TABLE]['sql'] as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key ='" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
default:
$query = $db->sql_build_array('UPDATE', $sql_data[POSTS_TABLE]['sql']);
break;
}
$sql = 'UPDATE ' . POSTS_TABLE . ' $sql = 'UPDATE ' . POSTS_TABLE . '
SET ' . $query . ' SET ' . $db->sql_build_array('UPDATE', $sql_data[POSTS_TABLE]['sql']) . '
WHERE post_id = ' . $data['post_id']; WHERE post_id = ' . $data['post_id'];
$db->sql_query($sql); $db->sql_query($sql);
} }

View file

@ -1316,141 +1316,13 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr
if ($mode == 'post' || $mode == 'reply' || $mode == 'quote' || $mode == 'quotepost' || $mode == 'forward') if ($mode == 'post' || $mode == 'reply' || $mode == 'quote' || $mode == 'quotepost' || $mode == 'forward')
{ {
switch (SQL_LAYER) $db->sql_query('INSERT INTO ' . PRIVMSGS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_data));
{
case 'mssql':
case 'mssql_odbc':
$fields = array();
foreach ($sql_data as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
case 'sqlite':
$fields = array();
foreach ($sql_data as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "'" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
default:
$query = $db->sql_build_array('INSERT', $sql_data);
break;
}
$db->sql_query('INSERT INTO ' . PRIVMSGS_TABLE . ' ' . $query);
$data['msg_id'] = $db->sql_nextid(); $data['msg_id'] = $db->sql_nextid();
} }
else if ($mode == 'edit') else if ($mode == 'edit')
{ {
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$values = array();
foreach ($sql_data as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'forum_desc_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
case 'sqlite':
$values = array();
foreach ($sql_data as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'forum_desc_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = '" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
default:
$query = $db->sql_build_array('UPDATE', $sql_data);
break;
}
$sql = 'UPDATE ' . PRIVMSGS_TABLE . ' $sql = 'UPDATE ' . PRIVMSGS_TABLE . '
SET message_edit_count = message_edit_count + 1, ' . $query . ' SET message_edit_count = message_edit_count + 1, ' . $db->sql_build_array('UPDATE', $sql_data) . '
WHERE msg_id = ' . $data['msg_id']; WHERE msg_id = ' . $data['msg_id'];
$db->sql_query($sql); $db->sql_query($sql);
} }

View file

@ -207,75 +207,7 @@ function user_add($user_row, $cp_data = false)
} }
} }
$query = ''; $sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$fields = array();
foreach ($sql_ary as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'user_sig_bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
case 'sqlite':
$fields = array();
foreach ($sql_ary as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'user_sig_bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "'" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
default:
$query = $db->sql_build_array('INSERT', $sql_ary);
break;
}
$sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $query;
$db->sql_query($sql); $db->sql_query($sql);
$user_id = $db->sql_nextid(); $user_id = $db->sql_nextid();
@ -1495,140 +1427,13 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
if ($group_id) if ($group_id)
{ {
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$values = array();
foreach ($sql_ary as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'group_desc_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
case 'sqlite':
$values = array();
foreach ($sql_ary as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'group_desc_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = '" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
default:
$query = $db->sql_build_array('UPDATE', $sql_ary);
break;
}
$sql = 'UPDATE ' . GROUPS_TABLE . ' $sql = 'UPDATE ' . GROUPS_TABLE . '
SET ' . $query . " SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
WHERE group_id = $group_id"; WHERE group_id = $group_id";
} }
else else
{ {
switch (SQL_LAYER) $sql = 'INSERT INTO ' . GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
{
case 'mssql':
case 'mssql_odbc':
$fields = array();
foreach ($sql_ary as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
case 'sqlite':
$fields = array();
foreach ($sql_ary as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "'" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
default:
$query = $db->sql_build_array('INSERT', $sql_ary);
break;
}
$sql = 'INSERT INTO ' . GROUPS_TABLE . ' ' . $query;
} }
$db->sql_query($sql); $db->sql_query($sql);

View file

@ -440,72 +440,8 @@ class ucp_profile
'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield 'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield
); );
$query = '';
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$values = array();
foreach ($sql_ary as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'user_sig_bbcode_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
case 'sqlite':
$values = array();
foreach ($sql_ary as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'user_sig_bbcode_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = '" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
default:
$query = $db->sql_build_array('UPDATE', $sql_ary);
break;
}
$sql = 'UPDATE ' . USERS_TABLE . ' $sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $query . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id']; WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql); $db->sql_query($sql);

View file

@ -1881,7 +1881,7 @@ class install_install extends module
'LABEL' => 'SQLite', 'LABEL' => 'SQLite',
'SCHEMA' => 'sqlite', 'SCHEMA' => 'sqlite',
'MODULE' => 'sqlite', 'MODULE' => 'sqlite',
'DELIM' => ';', 'DELIM' => ';;',
'COMMENTS' => 'remove_remarks' 'COMMENTS' => 'remove_remarks'
), ),
); );

View file

@ -4,7 +4,7 @@
# $Id$ # $Id$
# #
BEGIN TRANSACTION; BEGIN TRANSACTION;;
# Table: 'phpbb_attachments' # Table: 'phpbb_attachments'
CREATE TABLE phpbb_attachments ( CREATE TABLE phpbb_attachments (
@ -22,13 +22,13 @@ CREATE TABLE phpbb_attachments (
filesize INTEGER UNSIGNED NOT NULL DEFAULT '0', filesize INTEGER UNSIGNED NOT NULL DEFAULT '0',
filetime INTEGER UNSIGNED NOT NULL DEFAULT '0', filetime INTEGER UNSIGNED NOT NULL DEFAULT '0',
thumbnail INTEGER UNSIGNED NOT NULL DEFAULT '0' thumbnail INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments (filetime); CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments (filetime);;
CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments (post_msg_id); CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments (post_msg_id);;
CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments (topic_id); CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments (topic_id);;
CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id); CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id);;
CREATE INDEX phpbb_attachments_filesize ON phpbb_attachments (filesize); CREATE INDEX phpbb_attachments_filesize ON phpbb_attachments (filesize);;
# Table: 'phpbb_acl_groups' # Table: 'phpbb_acl_groups'
CREATE TABLE phpbb_acl_groups ( CREATE TABLE phpbb_acl_groups (
@ -37,10 +37,10 @@ CREATE TABLE phpbb_acl_groups (
auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0', auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
auth_role_id INTEGER UNSIGNED NOT NULL DEFAULT '0', auth_role_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
auth_setting tinyint(2) NOT NULL DEFAULT '0' auth_setting tinyint(2) NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups (group_id); CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups (group_id);;
CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups (auth_option_id); CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups (auth_option_id);;
# Table: 'phpbb_acl_options' # Table: 'phpbb_acl_options'
CREATE TABLE phpbb_acl_options ( CREATE TABLE phpbb_acl_options (
@ -49,9 +49,9 @@ CREATE TABLE phpbb_acl_options (
is_global INTEGER UNSIGNED NOT NULL DEFAULT '0', is_global INTEGER UNSIGNED NOT NULL DEFAULT '0',
is_local INTEGER UNSIGNED NOT NULL DEFAULT '0', is_local INTEGER UNSIGNED NOT NULL DEFAULT '0',
founder_only INTEGER UNSIGNED NOT NULL DEFAULT '0' founder_only INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options (auth_option); CREATE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options (auth_option);;
# Table: 'phpbb_acl_roles' # Table: 'phpbb_acl_roles'
CREATE TABLE phpbb_acl_roles ( CREATE TABLE phpbb_acl_roles (
@ -60,10 +60,10 @@ CREATE TABLE phpbb_acl_roles (
role_description text(65535) NOT NULL DEFAULT '', role_description text(65535) NOT NULL DEFAULT '',
role_type varchar(10) NOT NULL DEFAULT '', role_type varchar(10) NOT NULL DEFAULT '',
role_order INTEGER UNSIGNED NOT NULL DEFAULT '0' role_order INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles (role_type); CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles (role_type);;
CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles (role_order); CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles (role_order);;
# Table: 'phpbb_acl_roles_data' # Table: 'phpbb_acl_roles_data'
CREATE TABLE phpbb_acl_roles_data ( CREATE TABLE phpbb_acl_roles_data (
@ -71,7 +71,7 @@ CREATE TABLE phpbb_acl_roles_data (
auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0', auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
auth_setting tinyint(2) NOT NULL DEFAULT '0', auth_setting tinyint(2) NOT NULL DEFAULT '0',
PRIMARY KEY (role_id, auth_option_id) PRIMARY KEY (role_id, auth_option_id)
); );;
# Table: 'phpbb_acl_users' # Table: 'phpbb_acl_users'
@ -81,10 +81,10 @@ CREATE TABLE phpbb_acl_users (
auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0', auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
auth_role_id INTEGER UNSIGNED NOT NULL DEFAULT '0', auth_role_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
auth_setting tinyint(2) NOT NULL DEFAULT '0' auth_setting tinyint(2) NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users (user_id); CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users (user_id);;
CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users (auth_option_id); CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users (auth_option_id);;
# Table: 'phpbb_banlist' # Table: 'phpbb_banlist'
CREATE TABLE phpbb_banlist ( CREATE TABLE phpbb_banlist (
@ -97,7 +97,7 @@ CREATE TABLE phpbb_banlist (
ban_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0', ban_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0',
ban_reason text(65535) NOT NULL DEFAULT '', ban_reason text(65535) NOT NULL DEFAULT '',
ban_give_reason text(65535) NOT NULL DEFAULT '' ban_give_reason text(65535) NOT NULL DEFAULT ''
); );;
# Table: 'phpbb_bbcodes' # Table: 'phpbb_bbcodes'
@ -113,19 +113,19 @@ CREATE TABLE phpbb_bbcodes (
second_pass_match varchar(255) NOT NULL DEFAULT '', second_pass_match varchar(255) NOT NULL DEFAULT '',
second_pass_replace mediumtext(16777215) NOT NULL DEFAULT '', second_pass_replace mediumtext(16777215) NOT NULL DEFAULT '',
PRIMARY KEY (bbcode_id) PRIMARY KEY (bbcode_id)
); );;
CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting); CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting);;
# Table: 'phpbb_bookmarks' # Table: 'phpbb_bookmarks'
CREATE TABLE phpbb_bookmarks ( CREATE TABLE phpbb_bookmarks (
topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
order_id INTEGER UNSIGNED NOT NULL DEFAULT '0' order_id INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_bookmarks_order_id ON phpbb_bookmarks (order_id); CREATE INDEX phpbb_bookmarks_order_id ON phpbb_bookmarks (order_id);;
CREATE INDEX phpbb_bookmarks_topic_user_id ON phpbb_bookmarks (topic_id, user_id); CREATE INDEX phpbb_bookmarks_topic_user_id ON phpbb_bookmarks (topic_id, user_id);;
# Table: 'phpbb_bots' # Table: 'phpbb_bots'
CREATE TABLE phpbb_bots ( CREATE TABLE phpbb_bots (
@ -135,9 +135,9 @@ CREATE TABLE phpbb_bots (
user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
bot_agent varchar(255) NOT NULL DEFAULT '', bot_agent varchar(255) NOT NULL DEFAULT '',
bot_ip varchar(255) NOT NULL DEFAULT '' bot_ip varchar(255) NOT NULL DEFAULT ''
); );;
CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active); CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active);;
# Table: 'phpbb_config' # Table: 'phpbb_config'
CREATE TABLE phpbb_config ( CREATE TABLE phpbb_config (
@ -145,9 +145,9 @@ CREATE TABLE phpbb_config (
config_value varchar(255) NOT NULL DEFAULT '', config_value varchar(255) NOT NULL DEFAULT '',
is_dynamic INTEGER UNSIGNED NOT NULL DEFAULT '0', is_dynamic INTEGER UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (config_name) PRIMARY KEY (config_name)
); );;
CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic); CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic);;
# Table: 'phpbb_confirm' # Table: 'phpbb_confirm'
CREATE TABLE phpbb_confirm ( CREATE TABLE phpbb_confirm (
@ -156,14 +156,14 @@ CREATE TABLE phpbb_confirm (
confirm_type tinyint(3) NOT NULL DEFAULT '0', confirm_type tinyint(3) NOT NULL DEFAULT '0',
code varchar(8) NOT NULL DEFAULT '', code varchar(8) NOT NULL DEFAULT '',
PRIMARY KEY (session_id, confirm_id) PRIMARY KEY (session_id, confirm_id)
); );;
# Table: 'phpbb_disallow' # Table: 'phpbb_disallow'
CREATE TABLE phpbb_disallow ( CREATE TABLE phpbb_disallow (
disallow_id INTEGER PRIMARY KEY NOT NULL , disallow_id INTEGER PRIMARY KEY NOT NULL ,
disallow_username varchar(252) NOT NULL DEFAULT '' disallow_username varchar(252) NOT NULL DEFAULT ''
); );;
# Table: 'phpbb_drafts' # Table: 'phpbb_drafts'
@ -175,16 +175,16 @@ CREATE TABLE phpbb_drafts (
save_time INTEGER UNSIGNED NOT NULL DEFAULT '0', save_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
draft_subject text(65535) NOT NULL DEFAULT '', draft_subject text(65535) NOT NULL DEFAULT '',
draft_message mediumtext(16777215) NOT NULL DEFAULT '' draft_message mediumtext(16777215) NOT NULL DEFAULT ''
); );;
CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time); CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time);;
# Table: 'phpbb_extensions' # Table: 'phpbb_extensions'
CREATE TABLE phpbb_extensions ( CREATE TABLE phpbb_extensions (
extension_id INTEGER PRIMARY KEY NOT NULL , extension_id INTEGER PRIMARY KEY NOT NULL ,
group_id INTEGER UNSIGNED NOT NULL DEFAULT '0', group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
extension varchar(100) NOT NULL DEFAULT '' extension varchar(100) NOT NULL DEFAULT ''
); );;
# Table: 'phpbb_extension_groups' # Table: 'phpbb_extension_groups'
@ -198,7 +198,7 @@ CREATE TABLE phpbb_extension_groups (
max_filesize INTEGER UNSIGNED NOT NULL DEFAULT '0', max_filesize INTEGER UNSIGNED NOT NULL DEFAULT '0',
allowed_forums text(65535) NOT NULL DEFAULT '', allowed_forums text(65535) NOT NULL DEFAULT '',
allow_in_pm INTEGER UNSIGNED NOT NULL DEFAULT '0' allow_in_pm INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
# Table: 'phpbb_forums' # Table: 'phpbb_forums'
@ -241,10 +241,10 @@ CREATE TABLE phpbb_forums (
prune_days tinyint(4) NOT NULL DEFAULT '0', prune_days tinyint(4) NOT NULL DEFAULT '0',
prune_viewed tinyint(4) NOT NULL DEFAULT '0', prune_viewed tinyint(4) NOT NULL DEFAULT '0',
prune_freq tinyint(4) NOT NULL DEFAULT '0' prune_freq tinyint(4) NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums (left_id, right_id); CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums (left_id, right_id);;
CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums (forum_last_post_id); CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums (forum_last_post_id);;
# Table: 'phpbb_forums_access' # Table: 'phpbb_forums_access'
CREATE TABLE phpbb_forums_access ( CREATE TABLE phpbb_forums_access (
@ -252,7 +252,7 @@ CREATE TABLE phpbb_forums_access (
user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
session_id char(32) NOT NULL DEFAULT '', session_id char(32) NOT NULL DEFAULT '',
PRIMARY KEY (forum_id, user_id, session_id) PRIMARY KEY (forum_id, user_id, session_id)
); );;
# Table: 'phpbb_forums_track' # Table: 'phpbb_forums_track'
@ -261,7 +261,7 @@ CREATE TABLE phpbb_forums_track (
forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0', forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
mark_time INTEGER UNSIGNED NOT NULL DEFAULT '0', mark_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (user_id, forum_id) PRIMARY KEY (user_id, forum_id)
); );;
# Table: 'phpbb_forums_watch' # Table: 'phpbb_forums_watch'
@ -269,11 +269,11 @@ CREATE TABLE phpbb_forums_watch (
forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0', forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
notify_status INTEGER UNSIGNED NOT NULL DEFAULT '0' notify_status INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch (forum_id); CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch (forum_id);;
CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch (user_id); CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch (user_id);;
CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch (notify_status); CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch (notify_status);;
# Table: 'phpbb_groups' # Table: 'phpbb_groups'
CREATE TABLE phpbb_groups ( CREATE TABLE phpbb_groups (
@ -295,9 +295,9 @@ CREATE TABLE phpbb_groups (
group_receive_pm INTEGER UNSIGNED NOT NULL DEFAULT '0', group_receive_pm INTEGER UNSIGNED NOT NULL DEFAULT '0',
group_message_limit INTEGER UNSIGNED NOT NULL DEFAULT '0', group_message_limit INTEGER UNSIGNED NOT NULL DEFAULT '0',
group_legend INTEGER UNSIGNED NOT NULL DEFAULT '1' group_legend INTEGER UNSIGNED NOT NULL DEFAULT '1'
); );;
CREATE INDEX phpbb_groups_group_legend ON phpbb_groups (group_legend); CREATE INDEX phpbb_groups_group_legend ON phpbb_groups (group_legend);;
# Table: 'phpbb_icons' # Table: 'phpbb_icons'
CREATE TABLE phpbb_icons ( CREATE TABLE phpbb_icons (
@ -307,9 +307,9 @@ CREATE TABLE phpbb_icons (
icons_height tinyint(4) NOT NULL DEFAULT '0', icons_height tinyint(4) NOT NULL DEFAULT '0',
icons_order INTEGER UNSIGNED NOT NULL DEFAULT '0', icons_order INTEGER UNSIGNED NOT NULL DEFAULT '0',
display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '1' display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '1'
); );;
CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons (display_on_posting); CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons (display_on_posting);;
# Table: 'phpbb_lang' # Table: 'phpbb_lang'
CREATE TABLE phpbb_lang ( CREATE TABLE phpbb_lang (
@ -319,9 +319,9 @@ CREATE TABLE phpbb_lang (
lang_english_name varchar(100) NOT NULL DEFAULT '', lang_english_name varchar(100) NOT NULL DEFAULT '',
lang_local_name varchar(255) NOT NULL DEFAULT '', lang_local_name varchar(255) NOT NULL DEFAULT '',
lang_author varchar(255) NOT NULL DEFAULT '' lang_author varchar(255) NOT NULL DEFAULT ''
); );;
CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang (lang_iso); CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang (lang_iso);;
# Table: 'phpbb_log' # Table: 'phpbb_log'
CREATE TABLE phpbb_log ( CREATE TABLE phpbb_log (
@ -335,13 +335,13 @@ CREATE TABLE phpbb_log (
log_time INTEGER UNSIGNED NOT NULL DEFAULT '0', log_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
log_operation text(65535) NOT NULL DEFAULT '', log_operation text(65535) NOT NULL DEFAULT '',
log_data mediumtext(16777215) NOT NULL DEFAULT '' log_data mediumtext(16777215) NOT NULL DEFAULT ''
); );;
CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type); CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type);;
CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id); CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id);;
CREATE INDEX phpbb_log_topic_id ON phpbb_log (topic_id); CREATE INDEX phpbb_log_topic_id ON phpbb_log (topic_id);;
CREATE INDEX phpbb_log_reportee_id ON phpbb_log (reportee_id); CREATE INDEX phpbb_log_reportee_id ON phpbb_log (reportee_id);;
CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id); CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id);;
# Table: 'phpbb_moderator_cache' # Table: 'phpbb_moderator_cache'
CREATE TABLE phpbb_moderator_cache ( CREATE TABLE phpbb_moderator_cache (
@ -351,10 +351,10 @@ CREATE TABLE phpbb_moderator_cache (
group_id INTEGER UNSIGNED NOT NULL DEFAULT '0', group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
group_name varchar(255) NOT NULL DEFAULT '', group_name varchar(255) NOT NULL DEFAULT '',
display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1' display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1'
); );;
CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache (display_on_index); CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache (display_on_index);;
CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache (forum_id); CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache (forum_id);;
# Table: 'phpbb_modules' # Table: 'phpbb_modules'
CREATE TABLE phpbb_modules ( CREATE TABLE phpbb_modules (
@ -369,11 +369,11 @@ CREATE TABLE phpbb_modules (
module_langname varchar(255) NOT NULL DEFAULT '', module_langname varchar(255) NOT NULL DEFAULT '',
module_mode varchar(255) NOT NULL DEFAULT '', module_mode varchar(255) NOT NULL DEFAULT '',
module_auth varchar(255) NOT NULL DEFAULT '' module_auth varchar(255) NOT NULL DEFAULT ''
); );;
CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id); CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id);;
CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled); CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled);;
CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id); CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id);;
# Table: 'phpbb_poll_options' # Table: 'phpbb_poll_options'
CREATE TABLE phpbb_poll_options ( CREATE TABLE phpbb_poll_options (
@ -381,10 +381,10 @@ CREATE TABLE phpbb_poll_options (
topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
poll_option_text text(65535) NOT NULL DEFAULT '', poll_option_text text(65535) NOT NULL DEFAULT '',
poll_option_total INTEGER UNSIGNED NOT NULL DEFAULT '0' poll_option_total INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options (poll_option_id); CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options (poll_option_id);;
CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options (topic_id); CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options (topic_id);;
# Table: 'phpbb_poll_votes' # Table: 'phpbb_poll_votes'
CREATE TABLE phpbb_poll_votes ( CREATE TABLE phpbb_poll_votes (
@ -392,11 +392,11 @@ CREATE TABLE phpbb_poll_votes (
poll_option_id tinyint(4) NOT NULL DEFAULT '0', poll_option_id tinyint(4) NOT NULL DEFAULT '0',
vote_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', vote_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
vote_user_ip varchar(40) NOT NULL DEFAULT '' vote_user_ip varchar(40) NOT NULL DEFAULT ''
); );;
CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes (topic_id); CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes (topic_id);;
CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes (vote_user_id); CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes (vote_user_id);;
CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes (vote_user_ip); CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes (vote_user_ip);;
# Table: 'phpbb_posts' # Table: 'phpbb_posts'
CREATE TABLE phpbb_posts ( CREATE TABLE phpbb_posts (
@ -427,15 +427,15 @@ CREATE TABLE phpbb_posts (
post_edit_user INTEGER UNSIGNED NOT NULL DEFAULT '0', post_edit_user INTEGER UNSIGNED NOT NULL DEFAULT '0',
post_edit_count INTEGER UNSIGNED NOT NULL DEFAULT '0', post_edit_count INTEGER UNSIGNED NOT NULL DEFAULT '0',
post_edit_locked INTEGER UNSIGNED NOT NULL DEFAULT '0' post_edit_locked INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_posts_forum_id ON phpbb_posts (forum_id); CREATE INDEX phpbb_posts_forum_id ON phpbb_posts (forum_id);;
CREATE INDEX phpbb_posts_topic_id ON phpbb_posts (topic_id); CREATE INDEX phpbb_posts_topic_id ON phpbb_posts (topic_id);;
CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip); CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip);;
CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id); CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id);;
CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved); CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved);;
CREATE INDEX phpbb_posts_post_postcount ON phpbb_posts (post_postcount); CREATE INDEX phpbb_posts_post_postcount ON phpbb_posts (post_postcount);;
CREATE INDEX phpbb_posts_post_time ON phpbb_posts (post_time); CREATE INDEX phpbb_posts_post_time ON phpbb_posts (post_time);;
# Table: 'phpbb_privmsgs' # Table: 'phpbb_privmsgs'
CREATE TABLE phpbb_privmsgs ( CREATE TABLE phpbb_privmsgs (
@ -461,12 +461,12 @@ CREATE TABLE phpbb_privmsgs (
message_edit_count INTEGER UNSIGNED NOT NULL DEFAULT '0', message_edit_count INTEGER UNSIGNED NOT NULL DEFAULT '0',
to_address text(65535) NOT NULL DEFAULT '', to_address text(65535) NOT NULL DEFAULT '',
bcc_address text(65535) NOT NULL DEFAULT '' bcc_address text(65535) NOT NULL DEFAULT ''
); );;
CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs (author_ip); CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs (author_ip);;
CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs (message_time); CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs (message_time);;
CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs (author_id); CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs (author_id);;
CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs (root_level); CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs (root_level);;
# Table: 'phpbb_privmsgs_folder' # Table: 'phpbb_privmsgs_folder'
CREATE TABLE phpbb_privmsgs_folder ( CREATE TABLE phpbb_privmsgs_folder (
@ -474,9 +474,9 @@ CREATE TABLE phpbb_privmsgs_folder (
user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
folder_name varchar(255) NOT NULL DEFAULT '', folder_name varchar(255) NOT NULL DEFAULT '',
pm_count INTEGER UNSIGNED NOT NULL DEFAULT '0' pm_count INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id); CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id);;
# Table: 'phpbb_privmsgs_rules' # Table: 'phpbb_privmsgs_rules'
CREATE TABLE phpbb_privmsgs_rules ( CREATE TABLE phpbb_privmsgs_rules (
@ -489,7 +489,7 @@ CREATE TABLE phpbb_privmsgs_rules (
rule_group_id INTEGER UNSIGNED NOT NULL DEFAULT '0', rule_group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
rule_action INTEGER UNSIGNED NOT NULL DEFAULT '0', rule_action INTEGER UNSIGNED NOT NULL DEFAULT '0',
rule_folder_id int(4) NOT NULL DEFAULT '0' rule_folder_id int(4) NOT NULL DEFAULT '0'
); );;
# Table: 'phpbb_privmsgs_to' # Table: 'phpbb_privmsgs_to'
@ -504,10 +504,10 @@ CREATE TABLE phpbb_privmsgs_to (
pm_marked INTEGER UNSIGNED NOT NULL DEFAULT '0', pm_marked INTEGER UNSIGNED NOT NULL DEFAULT '0',
pm_forwarded INTEGER UNSIGNED NOT NULL DEFAULT '0', pm_forwarded INTEGER UNSIGNED NOT NULL DEFAULT '0',
folder_id int(4) NOT NULL DEFAULT '0' folder_id int(4) NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id); CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id);;
CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folder_id); CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folder_id);;
# Table: 'phpbb_profile_fields' # Table: 'phpbb_profile_fields'
CREATE TABLE phpbb_profile_fields ( CREATE TABLE phpbb_profile_fields (
@ -527,16 +527,16 @@ CREATE TABLE phpbb_profile_fields (
field_no_view INTEGER UNSIGNED NOT NULL DEFAULT '0', field_no_view INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_active INTEGER UNSIGNED NOT NULL DEFAULT '0', field_active INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_order INTEGER UNSIGNED NOT NULL DEFAULT '0' field_order INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields (field_type); CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields (field_type);;
CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields (field_order); CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields (field_order);;
# Table: 'phpbb_profile_fields_data' # Table: 'phpbb_profile_fields_data'
CREATE TABLE phpbb_profile_fields_data ( CREATE TABLE phpbb_profile_fields_data (
user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (user_id) PRIMARY KEY (user_id)
); );;
# Table: 'phpbb_profile_fields_lang' # Table: 'phpbb_profile_fields_lang'
@ -547,7 +547,7 @@ CREATE TABLE phpbb_profile_fields_lang (
field_type tinyint(4) NOT NULL DEFAULT '0', field_type tinyint(4) NOT NULL DEFAULT '0',
lang_value varchar(255) NOT NULL DEFAULT '', lang_value varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (field_id, lang_id, option_id) PRIMARY KEY (field_id, lang_id, option_id)
); );;
# Table: 'phpbb_profile_lang' # Table: 'phpbb_profile_lang'
@ -558,7 +558,7 @@ CREATE TABLE phpbb_profile_lang (
lang_explain text(65535) NOT NULL DEFAULT '', lang_explain text(65535) NOT NULL DEFAULT '',
lang_default_value varchar(255) NOT NULL DEFAULT '', lang_default_value varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (field_id, lang_id) PRIMARY KEY (field_id, lang_id)
); );;
# Table: 'phpbb_ranks' # Table: 'phpbb_ranks'
@ -568,7 +568,7 @@ CREATE TABLE phpbb_ranks (
rank_min INTEGER UNSIGNED NOT NULL DEFAULT '0', rank_min INTEGER UNSIGNED NOT NULL DEFAULT '0',
rank_special INTEGER UNSIGNED NOT NULL DEFAULT '0', rank_special INTEGER UNSIGNED NOT NULL DEFAULT '0',
rank_image varchar(255) NOT NULL DEFAULT '' rank_image varchar(255) NOT NULL DEFAULT ''
); );;
# Table: 'phpbb_reports' # Table: 'phpbb_reports'
@ -581,7 +581,7 @@ CREATE TABLE phpbb_reports (
report_closed INTEGER UNSIGNED NOT NULL DEFAULT '0', report_closed INTEGER UNSIGNED NOT NULL DEFAULT '0',
report_time INTEGER UNSIGNED NOT NULL DEFAULT '0', report_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
report_text mediumtext(16777215) NOT NULL DEFAULT '' report_text mediumtext(16777215) NOT NULL DEFAULT ''
); );;
# Table: 'phpbb_reports_reasons' # Table: 'phpbb_reports_reasons'
@ -590,7 +590,7 @@ CREATE TABLE phpbb_reports_reasons (
reason_title varchar(255) NOT NULL DEFAULT '', reason_title varchar(255) NOT NULL DEFAULT '',
reason_description mediumtext(16777215) NOT NULL DEFAULT '', reason_description mediumtext(16777215) NOT NULL DEFAULT '',
reason_order INTEGER UNSIGNED NOT NULL DEFAULT '0' reason_order INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
# Table: 'phpbb_search_results' # Table: 'phpbb_search_results'
@ -600,7 +600,7 @@ CREATE TABLE phpbb_search_results (
search_keywords mediumtext(16777215) NOT NULL DEFAULT '', search_keywords mediumtext(16777215) NOT NULL DEFAULT '',
search_authors mediumtext(16777215) NOT NULL DEFAULT '', search_authors mediumtext(16777215) NOT NULL DEFAULT '',
PRIMARY KEY (search_key) PRIMARY KEY (search_key)
); );;
# Table: 'phpbb_search_wordlist' # Table: 'phpbb_search_wordlist'
@ -608,18 +608,18 @@ CREATE TABLE phpbb_search_wordlist (
word_id INTEGER PRIMARY KEY NOT NULL , word_id INTEGER PRIMARY KEY NOT NULL ,
word_text varchar(252) NOT NULL DEFAULT '', word_text varchar(252) NOT NULL DEFAULT '',
word_common INTEGER UNSIGNED NOT NULL DEFAULT '0' word_common INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist (word_text); CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist (word_text);;
# Table: 'phpbb_search_wordmatch' # Table: 'phpbb_search_wordmatch'
CREATE TABLE phpbb_search_wordmatch ( CREATE TABLE phpbb_search_wordmatch (
post_id INTEGER UNSIGNED NOT NULL DEFAULT '0', post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
word_id INTEGER UNSIGNED NOT NULL DEFAULT '0', word_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
title_match INTEGER UNSIGNED NOT NULL DEFAULT '0' title_match INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id); CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id);;
# Table: 'phpbb_sessions' # Table: 'phpbb_sessions'
CREATE TABLE phpbb_sessions ( CREATE TABLE phpbb_sessions (
@ -635,10 +635,10 @@ CREATE TABLE phpbb_sessions (
session_autologin INTEGER UNSIGNED NOT NULL DEFAULT '0', session_autologin INTEGER UNSIGNED NOT NULL DEFAULT '0',
session_admin INTEGER UNSIGNED NOT NULL DEFAULT '0', session_admin INTEGER UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (session_id) PRIMARY KEY (session_id)
); );;
CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions (session_time); CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions (session_time);;
CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions (session_user_id); CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions (session_user_id);;
# Table: 'phpbb_sessions_keys' # Table: 'phpbb_sessions_keys'
CREATE TABLE phpbb_sessions_keys ( CREATE TABLE phpbb_sessions_keys (
@ -647,9 +647,9 @@ CREATE TABLE phpbb_sessions_keys (
last_ip varchar(40) NOT NULL DEFAULT '', last_ip varchar(40) NOT NULL DEFAULT '',
last_login INTEGER UNSIGNED NOT NULL DEFAULT '0', last_login INTEGER UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (key_id, user_id) PRIMARY KEY (key_id, user_id)
); );;
CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login); CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login);;
# Table: 'phpbb_sitelist' # Table: 'phpbb_sitelist'
CREATE TABLE phpbb_sitelist ( CREATE TABLE phpbb_sitelist (
@ -657,7 +657,7 @@ CREATE TABLE phpbb_sitelist (
site_ip varchar(40) NOT NULL DEFAULT '', site_ip varchar(40) NOT NULL DEFAULT '',
site_hostname varchar(255) NOT NULL DEFAULT '', site_hostname varchar(255) NOT NULL DEFAULT '',
ip_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0' ip_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
# Table: 'phpbb_smilies' # Table: 'phpbb_smilies'
@ -670,9 +670,9 @@ CREATE TABLE phpbb_smilies (
smiley_height tinyint(4) NOT NULL DEFAULT '0', smiley_height tinyint(4) NOT NULL DEFAULT '0',
smiley_order INTEGER UNSIGNED NOT NULL DEFAULT '0', smiley_order INTEGER UNSIGNED NOT NULL DEFAULT '0',
display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '1' display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '1'
); );;
CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting); CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting);;
# Table: 'phpbb_styles' # Table: 'phpbb_styles'
CREATE TABLE phpbb_styles ( CREATE TABLE phpbb_styles (
@ -683,12 +683,12 @@ CREATE TABLE phpbb_styles (
template_id tinyint(4) NOT NULL DEFAULT '0', template_id tinyint(4) NOT NULL DEFAULT '0',
theme_id tinyint(4) NOT NULL DEFAULT '0', theme_id tinyint(4) NOT NULL DEFAULT '0',
imageset_id tinyint(4) NOT NULL DEFAULT '0' imageset_id tinyint(4) NOT NULL DEFAULT '0'
); );;
CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name); CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name);;
CREATE INDEX phpbb_styles_template_id ON phpbb_styles (template_id); CREATE INDEX phpbb_styles_template_id ON phpbb_styles (template_id);;
CREATE INDEX phpbb_styles_theme_id ON phpbb_styles (theme_id); CREATE INDEX phpbb_styles_theme_id ON phpbb_styles (theme_id);;
CREATE INDEX phpbb_styles_imageset_id ON phpbb_styles (imageset_id); CREATE INDEX phpbb_styles_imageset_id ON phpbb_styles (imageset_id);;
# Table: 'phpbb_styles_template' # Table: 'phpbb_styles_template'
CREATE TABLE phpbb_styles_template ( CREATE TABLE phpbb_styles_template (
@ -698,9 +698,16 @@ CREATE TABLE phpbb_styles_template (
template_path varchar(100) NOT NULL DEFAULT '', template_path varchar(100) NOT NULL DEFAULT '',
bbcode_bitfield blob NOT NULL DEFAULT '', bbcode_bitfield blob NOT NULL DEFAULT '',
template_storedb INTEGER UNSIGNED NOT NULL DEFAULT '0' template_storedb INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
CREATE UNIQUE INDEX phpbb_styles_template_tmplte_nm ON phpbb_styles_template (template_name); CREATE UNIQUE INDEX phpbb_styles_template_tmplte_nm ON phpbb_styles_template (template_name);;
CREATE TRIGGER "t_phpbb_styles_template"
AFTER INSERT ON "phpbb_styles_template"
FOR EACH ROW WHEN NEW.bbcode_bitfield = ''
BEGIN
UPDATE phpbb_styles_template SET bbcode_bitfield = binary_insert(1) WHERE template_id = NEW.template_id;
END;;
# Table: 'phpbb_styles_template_data' # Table: 'phpbb_styles_template_data'
CREATE TABLE phpbb_styles_template_data ( CREATE TABLE phpbb_styles_template_data (
@ -709,10 +716,10 @@ CREATE TABLE phpbb_styles_template_data (
template_included text(65535) NOT NULL DEFAULT '', template_included text(65535) NOT NULL DEFAULT '',
template_mtime INTEGER UNSIGNED NOT NULL DEFAULT '0', template_mtime INTEGER UNSIGNED NOT NULL DEFAULT '0',
template_data mediumtext(16777215) NOT NULL DEFAULT '' template_data mediumtext(16777215) NOT NULL DEFAULT ''
); );;
CREATE INDEX phpbb_styles_template_data_tid ON phpbb_styles_template_data (template_id); CREATE INDEX phpbb_styles_template_data_tid ON phpbb_styles_template_data (template_id);;
CREATE INDEX phpbb_styles_template_data_tfn ON phpbb_styles_template_data (template_filename); CREATE INDEX phpbb_styles_template_data_tfn ON phpbb_styles_template_data (template_filename);;
# Table: 'phpbb_styles_theme' # Table: 'phpbb_styles_theme'
CREATE TABLE phpbb_styles_theme ( CREATE TABLE phpbb_styles_theme (
@ -723,9 +730,9 @@ CREATE TABLE phpbb_styles_theme (
theme_storedb INTEGER UNSIGNED NOT NULL DEFAULT '0', theme_storedb INTEGER UNSIGNED NOT NULL DEFAULT '0',
theme_mtime INTEGER UNSIGNED NOT NULL DEFAULT '0', theme_mtime INTEGER UNSIGNED NOT NULL DEFAULT '0',
theme_data mediumtext(16777215) NOT NULL DEFAULT '' theme_data mediumtext(16777215) NOT NULL DEFAULT ''
); );;
CREATE UNIQUE INDEX phpbb_styles_theme_theme_name ON phpbb_styles_theme (theme_name); CREATE UNIQUE INDEX phpbb_styles_theme_theme_name ON phpbb_styles_theme (theme_name);;
# Table: 'phpbb_styles_imageset' # Table: 'phpbb_styles_imageset'
CREATE TABLE phpbb_styles_imageset ( CREATE TABLE phpbb_styles_imageset (
@ -827,9 +834,9 @@ CREATE TABLE phpbb_styles_imageset (
user_icon8 varchar(200) NOT NULL DEFAULT '', user_icon8 varchar(200) NOT NULL DEFAULT '',
user_icon9 varchar(200) NOT NULL DEFAULT '', user_icon9 varchar(200) NOT NULL DEFAULT '',
user_icon10 varchar(200) NOT NULL DEFAULT '' user_icon10 varchar(200) NOT NULL DEFAULT ''
); );;
CREATE UNIQUE INDEX phpbb_styles_imageset_imgset_nm ON phpbb_styles_imageset (imageset_name); CREATE UNIQUE INDEX phpbb_styles_imageset_imgset_nm ON phpbb_styles_imageset (imageset_name);;
# Table: 'phpbb_topics' # Table: 'phpbb_topics'
CREATE TABLE phpbb_topics ( CREATE TABLE phpbb_topics (
@ -864,11 +871,11 @@ CREATE TABLE phpbb_topics (
poll_max_options tinyint(4) NOT NULL DEFAULT '1', poll_max_options tinyint(4) NOT NULL DEFAULT '1',
poll_last_vote INTEGER UNSIGNED NOT NULL DEFAULT '0', poll_last_vote INTEGER UNSIGNED NOT NULL DEFAULT '0',
poll_vote_change INTEGER UNSIGNED NOT NULL DEFAULT '0' poll_vote_change INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_topics_forum_id ON phpbb_topics (forum_id); CREATE INDEX phpbb_topics_forum_id ON phpbb_topics (forum_id);;
CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics (forum_id, topic_type); CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics (forum_id, topic_type);;
CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics (topic_last_post_time); CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics (topic_last_post_time);;
# Table: 'phpbb_topics_track' # Table: 'phpbb_topics_track'
CREATE TABLE phpbb_topics_track ( CREATE TABLE phpbb_topics_track (
@ -877,9 +884,9 @@ CREATE TABLE phpbb_topics_track (
forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0', forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
mark_time INTEGER UNSIGNED NOT NULL DEFAULT '0', mark_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (user_id, topic_id) PRIMARY KEY (user_id, topic_id)
); );;
CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id); CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id);;
# Table: 'phpbb_topics_posted' # Table: 'phpbb_topics_posted'
CREATE TABLE phpbb_topics_posted ( CREATE TABLE phpbb_topics_posted (
@ -887,7 +894,7 @@ CREATE TABLE phpbb_topics_posted (
topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
topic_posted INTEGER UNSIGNED NOT NULL DEFAULT '0', topic_posted INTEGER UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (user_id, topic_id) PRIMARY KEY (user_id, topic_id)
); );;
# Table: 'phpbb_topics_watch' # Table: 'phpbb_topics_watch'
@ -895,11 +902,11 @@ CREATE TABLE phpbb_topics_watch (
topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
notify_status INTEGER UNSIGNED NOT NULL DEFAULT '0' notify_status INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch (topic_id); CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch (topic_id);;
CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch (user_id); CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch (user_id);;
CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status); CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status);;
# Table: 'phpbb_user_group' # Table: 'phpbb_user_group'
CREATE TABLE phpbb_user_group ( CREATE TABLE phpbb_user_group (
@ -907,11 +914,11 @@ CREATE TABLE phpbb_user_group (
user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
group_leader INTEGER UNSIGNED NOT NULL DEFAULT '0', group_leader INTEGER UNSIGNED NOT NULL DEFAULT '0',
user_pending INTEGER UNSIGNED NOT NULL DEFAULT '1' user_pending INTEGER UNSIGNED NOT NULL DEFAULT '1'
); );;
CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group (group_id); CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group (group_id);;
CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group (user_id); CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group (user_id);;
CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group (group_leader); CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group (group_leader);;
# Table: 'phpbb_users' # Table: 'phpbb_users'
CREATE TABLE phpbb_users ( CREATE TABLE phpbb_users (
@ -984,12 +991,12 @@ CREATE TABLE phpbb_users (
user_interests text(65535) NOT NULL DEFAULT '', user_interests text(65535) NOT NULL DEFAULT '',
user_actkey varchar(32) NOT NULL DEFAULT '', user_actkey varchar(32) NOT NULL DEFAULT '',
user_newpasswd varchar(32) NOT NULL DEFAULT '' user_newpasswd varchar(32) NOT NULL DEFAULT ''
); );;
CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday); CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday);;
CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash); CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash);;
CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type); CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type);;
CREATE INDEX phpbb_users_username ON phpbb_users (username); CREATE INDEX phpbb_users_username ON phpbb_users (username);;
# Table: 'phpbb_warnings' # Table: 'phpbb_warnings'
CREATE TABLE phpbb_warnings ( CREATE TABLE phpbb_warnings (
@ -998,7 +1005,7 @@ CREATE TABLE phpbb_warnings (
post_id INTEGER UNSIGNED NOT NULL DEFAULT '0', post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
log_id INTEGER UNSIGNED NOT NULL DEFAULT '0', log_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
warning_time INTEGER UNSIGNED NOT NULL DEFAULT '0' warning_time INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
# Table: 'phpbb_words' # Table: 'phpbb_words'
@ -1006,7 +1013,7 @@ CREATE TABLE phpbb_words (
word_id INTEGER PRIMARY KEY NOT NULL , word_id INTEGER PRIMARY KEY NOT NULL ,
word varchar(255) NOT NULL DEFAULT '', word varchar(255) NOT NULL DEFAULT '',
replacement varchar(255) NOT NULL DEFAULT '' replacement varchar(255) NOT NULL DEFAULT ''
); );;
# Table: 'phpbb_zebra' # Table: 'phpbb_zebra'
@ -1015,10 +1022,10 @@ CREATE TABLE phpbb_zebra (
zebra_id INTEGER UNSIGNED NOT NULL DEFAULT '0', zebra_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
friend INTEGER UNSIGNED NOT NULL DEFAULT '0', friend INTEGER UNSIGNED NOT NULL DEFAULT '0',
foe INTEGER UNSIGNED NOT NULL DEFAULT '0' foe INTEGER UNSIGNED NOT NULL DEFAULT '0'
); );;
CREATE INDEX phpbb_zebra_user_id ON phpbb_zebra (user_id); CREATE INDEX phpbb_zebra_user_id ON phpbb_zebra (user_id);;
CREATE INDEX phpbb_zebra_zebra_id ON phpbb_zebra (zebra_id); CREATE INDEX phpbb_zebra_zebra_id ON phpbb_zebra (zebra_id);;
COMMIT; COMMIT;;