diff options
19 files changed, 4800 insertions, 11557 deletions
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index dcbe5ec66d..8e01b3c286 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -12,6 +12,15 @@ */ $schema_path = dirname(__FILE__) . '/../install/schemas/'; +$supported_dbms = array( + 'firebird', + 'mssql', + 'mysql_40', + 'mysql_41', + 'oracle', + 'postgres', + 'sqlite', +); if (!is_writable($schema_path)) { @@ -19,34 +28,30 @@ if (!is_writable($schema_path)) } define('IN_PHPBB', true); - -require(dirname(__FILE__) . '/../phpbb/db/tools.php'); - +define('IN_INSTALL', true); +$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); +include($phpbb_root_path . 'common.' . $phpEx); + +$classes = $phpbb_container->get('ext.manager') + ->get_finder() + ->core_path('phpbb/') + ->directory('db/migration/data') + ->get_classes(); +$db_tools = new \phpbb\db\tools($db, true); + +$schema_generator = new \phpbb\db\migration\schema_generator($classes, $config, $db, $db_tools, $phpbb_root_path, $phpEx, 'phpbb_'); +$schema_data = $schema_generator->get_schema(); $dbms_type_map = phpbb\db\tools::get_dbms_type_map(); -// 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'); +$fp = fopen($schema_path . 'schema.json', 'wb'); +fwrite($fp, json_encode($schema_data, JSON_PRETTY_PRINT)); +fclose($fp); foreach ($supported_dbms as $dbms) { - include(dirname(__FILE__) . '/../includes/db/schema_data.php'); - if ($dbms == 'mssql') - { - foreach ($schema_data as $table_name => $table_data) - { - if (!isset($table_data['PRIMARY_KEY'])) - { - $schema_data[$table_name]['COLUMNS']['mssqlindex'] = array('UINT', NULL, 'auto_increment'); - $schema_data[$table_name]['PRIMARY_KEY'] = 'mssqlindex'; - } - } - } - $fp = fopen($schema_path . $dbms . '_schema.sql', 'wb'); - $line = ''; - // Write Header switch ($dbms) { @@ -74,16 +79,9 @@ foreach ($supported_dbms as $dbms) break; } + $line = ''; switch ($dbms) { - case 'firebird': - $line .= custom_data('firebird') . "\n"; - break; - - case 'sqlite': - $line .= "BEGIN TRANSACTION;\n\n"; - break; - case 'oracle': $line .= custom_data('oracle') . "\n"; break; @@ -91,501 +89,7 @@ foreach ($supported_dbms as $dbms) case 'postgres': $line .= "BEGIN;\n\n"; $line .= custom_data('postgres') . "\n"; - break; - } - - fwrite($fp, $line); - - foreach ($schema_data as $table_name => $table_data) - { - // Write comment about table - switch ($dbms) - { - case 'mysql_40': - case 'mysql_41': - case 'firebird': - case 'sqlite': - fwrite($fp, "# Table: '{$table_name}'\n"); - break; - - case 'mssql': - case 'oracle': - case 'postgres': - fwrite($fp, "/*\n\tTable: '{$table_name}'\n*/\n"); - break; - } - - // Create Table statement - $generator = $textimage = false; - $line = ''; - - switch ($dbms) - { - case 'mysql_40': - case 'mysql_41': - case 'firebird': - case 'oracle': - case 'sqlite': - case 'postgres': - $line = "CREATE TABLE {$table_name} (\n"; - break; - - case 'mssql': - $line = "CREATE TABLE [{$table_name}] (\n"; - break; - } - - // Table specific so we don't get overlap - $modded_array = array(); - - // Write columns one by one... - foreach ($table_data['COLUMNS'] as $column_name => $column_data) - { - if (strlen($column_name) > 30) - { - trigger_error("Column name '$column_name' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR); - } - if (isset($column_data[2]) && $column_data[2] == 'auto_increment' && strlen($column_name) > 26) // "${column_name}_gen" - { - trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR); - } - - // Get type - if (strpos($column_data[0], ':') !== false) - { - list($orig_column_type, $column_length) = explode(':', $column_data[0]); - if (!is_array($dbms_type_map[$dbms][$orig_column_type . ':'])) - { - $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'], $column_length); - } - else - { - if (isset($dbms_type_map[$dbms][$orig_column_type . ':']['rule'])) - { - switch ($dbms_type_map[$dbms][$orig_column_type . ':']['rule'][0]) - { - case 'div': - $column_length /= $dbms_type_map[$dbms][$orig_column_type . ':']['rule'][1]; - $column_length = ceil($column_length); - $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'][0], $column_length); - break; - } - } - - if (isset($dbms_type_map[$dbms][$orig_column_type . ':']['limit'])) - { - switch ($dbms_type_map[$dbms][$orig_column_type . ':']['limit'][0]) - { - case 'mult': - $column_length *= $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][1]; - if ($column_length > $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][2]) - { - $column_type = $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][3]; - $modded_array[$column_name] = $column_type; - } - else - { - $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'][0], $column_length); - } - break; - } - } - } - $orig_column_type .= ':'; - } - else - { - $orig_column_type = $column_data[0]; - $column_type = $dbms_type_map[$dbms][$column_data[0]]; - if ($column_type == 'text' || $column_type == 'blob') - { - $modded_array[$column_name] = $column_type; - } - } - - // Adjust default value if db-dependent specified - if (is_array($column_data[1])) - { - $column_data[1] = (isset($column_data[1][$dbms])) ? $column_data[1][$dbms] : $column_data[1]['default']; - } - - switch ($dbms) - { - case 'mysql_40': - case 'mysql_41': - $line .= "\t{$column_name} {$column_type} "; - - // For hexadecimal values do not use single quotes - if (!is_null($column_data[1]) && substr($column_type, -4) !== 'text' && substr($column_type, -4) !== 'blob') - { - $line .= (strpos($column_data[1], '0x') === 0) ? "DEFAULT {$column_data[1]} " : "DEFAULT '{$column_data[1]}' "; - } - $line .= 'NOT NULL'; - - if (isset($column_data[2])) - { - if ($column_data[2] == 'auto_increment') - { - $line .= ' auto_increment'; - } - else if ($dbms === 'mysql_41' && $column_data[2] == 'true_sort') - { - $line .= ' COLLATE utf8_unicode_ci'; - } - } - - $line .= ",\n"; - break; - - case 'sqlite': - if (isset($column_data[2]) && $column_data[2] == 'auto_increment') - { - $line .= "\t{$column_name} INTEGER PRIMARY KEY "; - $generator = $column_name; - } - else - { - $line .= "\t{$column_name} {$column_type} "; - } - - $line .= 'NOT NULL '; - $line .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}'" : ''; - $line .= ",\n"; - break; - - case 'firebird': - $line .= "\t{$column_name} {$column_type} "; - - if (!is_null($column_data[1])) - { - $line .= 'DEFAULT ' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' '; - } - - $line .= 'NOT NULL'; - - // This is a UNICODE column and thus should be given it's fair share - if (preg_match('/^X?STEXT_UNI|VCHAR_(CI|UNI:?)/', $column_data[0])) - { - $line .= ' COLLATE UNICODE'; - } - - $line .= ",\n"; - - if (isset($column_data[2]) && $column_data[2] == 'auto_increment') - { - $generator = $column_name; - } - break; - - case 'mssql': - if ($column_type == '[text]') - { - $textimage = true; - } - - $line .= "\t[{$column_name}] {$column_type} "; - - if (!is_null($column_data[1])) - { - // For hexadecimal values do not use single quotes - if (strpos($column_data[1], '0x') === 0) - { - $line .= 'DEFAULT (' . $column_data[1] . ') '; - } - else - { - $line .= 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') '; - } - } - - if (isset($column_data[2]) && $column_data[2] == 'auto_increment') - { - $line .= 'IDENTITY (1, 1) '; - } - - $line .= 'NOT NULL'; - $line .= " ,\n"; - break; - - case 'oracle': - $line .= "\t{$column_name} {$column_type} "; - $line .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}' " : ''; - - // In Oracle empty strings ('') are treated as NULL. - // Therefore in oracle we allow NULL's for all DEFAULT '' entries - $line .= ($column_data[1] === '') ? ",\n" : "NOT NULL,\n"; - - if (isset($column_data[2]) && $column_data[2] == 'auto_increment') - { - $generator = $column_name; - } - break; - - case 'postgres': - $line .= "\t{$column_name} {$column_type} "; - - if (isset($column_data[2]) && $column_data[2] == 'auto_increment') - { - $line .= "DEFAULT nextval('{$table_name}_seq'),\n"; - - // Make sure the sequence will be created before creating the table - $line = "CREATE SEQUENCE {$table_name}_seq;\n\n" . $line; - } - else - { - $line .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}' " : ''; - $line .= "NOT NULL"; - - // Unsigned? Then add a CHECK contraint - if (in_array($orig_column_type, $unsigned_types)) - { - $line .= " CHECK ({$column_name} >= 0)"; - } - - $line .= ",\n"; - } - break; - } - } - - switch ($dbms) - { - case 'firebird': - // Remove last line delimiter... - $line = substr($line, 0, -2); - $line .= "\n);;\n\n"; - break; - - case 'mssql': - $line = substr($line, 0, -2); - $line .= "\n)";// ON [PRIMARY]" . (($textimage) ? ' TEXTIMAGE_ON [PRIMARY]' : '') . "\n"; - $line .= "GO\n\n"; - break; - } - - // Write primary key - if (isset($table_data['PRIMARY_KEY'])) - { - if (!is_array($table_data['PRIMARY_KEY'])) - { - $table_data['PRIMARY_KEY'] = array($table_data['PRIMARY_KEY']); - } - - switch ($dbms) - { - case 'mysql_40': - case 'mysql_41': - case 'postgres': - $line .= "\tPRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . "),\n"; - break; - - case 'firebird': - $line .= "ALTER TABLE {$table_name} ADD PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . ");;\n\n"; - break; - - case 'sqlite': - if ($generator === false || !in_array($generator, $table_data['PRIMARY_KEY'])) - { - $line .= "\tPRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . "),\n"; - } - break; - - case 'mssql': - $line .= "ALTER TABLE [{$table_name}] WITH NOCHECK ADD \n"; - $line .= "\tCONSTRAINT [PK_{$table_name}] PRIMARY KEY CLUSTERED \n"; - $line .= "\t(\n"; - $line .= "\t\t[" . implode("],\n\t\t[", $table_data['PRIMARY_KEY']) . "]\n"; - $line .= "\t)\n"; - $line .= "GO\n\n"; - break; - - case 'oracle': - $line .= "\tCONSTRAINT pk_{$table_name} PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . "),\n"; - break; - } - } - - switch ($dbms) - { - case 'oracle': - // UNIQUE contrains to be added? - if (isset($table_data['KEYS'])) - { - foreach ($table_data['KEYS'] as $key_name => $key_data) - { - if (!is_array($key_data[1])) - { - $key_data[1] = array($key_data[1]); - } - - if ($key_data[0] == 'UNIQUE') - { - $line .= "\tCONSTRAINT u_phpbb_{$key_name} UNIQUE (" . implode(', ', $key_data[1]) . "),\n"; - } - } - } - - // Remove last line delimiter... - $line = substr($line, 0, -2); - $line .= "\n)\n/\n\n"; - break; - - case 'postgres': - // Remove last line delimiter... - $line = substr($line, 0, -2); - $line .= "\n);\n\n"; - break; - - case 'sqlite': - // Remove last line delimiter... - $line = substr($line, 0, -2); - $line .= "\n);\n\n"; - break; - } - - // Write Keys - if (isset($table_data['KEYS'])) - { - foreach ($table_data['KEYS'] as $key_name => $key_data) - { - if (!is_array($key_data[1])) - { - $key_data[1] = array($key_data[1]); - } - - if (strlen($table_name . $key_name) > 30) - { - trigger_error("Index name '${table_name}_$key_name' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR); - } - - switch ($dbms) - { - case 'mysql_40': - case 'mysql_41': - $line .= ($key_data[0] == 'INDEX') ? "\tKEY" : ''; - $line .= ($key_data[0] == 'UNIQUE') ? "\tUNIQUE" : ''; - foreach ($key_data[1] as $key => $col_name) - { - if (isset($modded_array[$col_name])) - { - switch ($modded_array[$col_name]) - { - case 'text': - case 'blob': - $key_data[1][$key] = $col_name . '(255)'; - break; - } - } - } - $line .= ' ' . $key_name . ' (' . implode(', ', $key_data[1]) . "),\n"; - break; - - case 'firebird': - $line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : ''; - $line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : ''; - - $line .= ' ' . $table_name . '_' . $key_name . ' ON ' . $table_name . '(' . implode(', ', $key_data[1]) . ");;\n"; - break; - - case 'mssql': - $line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : ''; - $line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : ''; - $line .= " [{$key_name}] ON [{$table_name}]([" . implode('], [', $key_data[1]) . "])\n"; - $line .= "GO\n\n"; - break; - - case 'oracle': - if ($key_data[0] == 'UNIQUE') - { - continue; - } - - $line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : ''; - - $line .= " {$table_name}_{$key_name} ON {$table_name} (" . implode(', ', $key_data[1]) . ")\n"; - $line .= "/\n"; - break; - - case 'sqlite': - $line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : ''; - $line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : ''; - - $line .= " {$table_name}_{$key_name} ON {$table_name} (" . implode(', ', $key_data[1]) . ");\n"; - break; - - case 'postgres': - $line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : ''; - $line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : ''; - - $line .= " {$table_name}_{$key_name} ON {$table_name} (" . implode(', ', $key_data[1]) . ");\n"; - break; - } - } - } - - switch ($dbms) - { - case 'mysql_40': - // Remove last line delimiter... - $line = substr($line, 0, -2); - $line .= "\n);\n\n"; - break; - - case 'mysql_41': - // Remove last line delimiter... - $line = substr($line, 0, -2); - $line .= "\n) CHARACTER SET `utf8` COLLATE `utf8_bin`;\n\n"; - break; - - // Create Generator - case 'firebird': - if ($generator !== false) - { - $line .= "\nCREATE GENERATOR {$table_name}_gen;;\n"; - $line .= 'SET GENERATOR ' . $table_name . "_gen TO 0;;\n\n"; - - $line .= 'CREATE TRIGGER t_' . $table_name . ' FOR ' . $table_name . "\n"; - $line .= "BEFORE INSERT\nAS\nBEGIN\n"; - $line .= "\tNEW.{$generator} = GEN_ID({$table_name}_gen, 1);\nEND;;\n\n"; - } - break; - - case 'oracle': - if ($generator !== false) - { - $line .= "\nCREATE SEQUENCE {$table_name}_seq\n/\n\n"; - - $line .= "CREATE OR REPLACE TRIGGER t_{$table_name}\n"; - $line .= "BEFORE INSERT ON {$table_name}\n"; - $line .= "FOR EACH ROW WHEN (\n"; - $line .= "\tnew.{$generator} IS NULL OR new.{$generator} = 0\n"; - $line .= ")\nBEGIN\n"; - $line .= "\tSELECT {$table_name}_seq.nextval\n"; - $line .= "\tINTO :new.{$generator}\n"; - $line .= "\tFROM dual;\nEND;\n/\n\n"; - } - break; - } - - fwrite($fp, $line . "\n"); - } - - $line = ''; - - // Write custom function at the end for some db's - switch ($dbms) - { - case 'mssql': - // No need to do this, no transaction support for schema changes - //$line = "\nCOMMIT\nGO\n\n"; - break; - - case 'sqlite': - $line = "\nCOMMIT;"; - break; - - case 'postgres': - $line = "\nCOMMIT;"; + $line .= "COMMIT;\n\n"; break; } diff --git a/phpBB/includes/db/index.htm b/phpBB/includes/db/index.htm deleted file mode 100644 index ee1f723a7d..0000000000 --- a/phpBB/includes/db/index.htm +++ /dev/null @@ -1,10 +0,0 @@ -<html> -<head> -<title></title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</head> - -<body bgcolor="#FFFFFF" text="#000000"> - -</body> -</html> diff --git a/phpBB/includes/db/schema_data.php b/phpBB/includes/db/schema_data.php deleted file mode 100644 index 1a08149f66..0000000000 --- a/phpBB/includes/db/schema_data.php +++ /dev/null @@ -1,1223 +0,0 @@ -<?php -/** -* -* @package dbal -* @copyright (c) 2013 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 -* -*/ - -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -$schema_data = array(); - -/** -* Define the basic structure -* The format: -* array('{TABLE_NAME}' => {TABLE_DATA}) -* {TABLE_DATA}: -* COLUMNS = array({column_name} = array({column_type}, {default}, {auto_increment})) -* PRIMARY_KEY = {column_name(s)} -* KEYS = array({key_name} = array({key_type}, {column_name(s)})), -* -* Column Types: -* INT:x => SIGNED int(x) -* BINT => BIGINT -* UINT => mediumint(8) UNSIGNED -* UINT:x => int(x) UNSIGNED -* TINT:x => tinyint(x) -* USINT => smallint(4) UNSIGNED (for _order columns) -* BOOL => tinyint(1) UNSIGNED -* VCHAR => varchar(255) -* CHAR:x => char(x) -* XSTEXT_UNI => text for storing 100 characters (topic_title for example) -* STEXT_UNI => text for storing 255 characters (normal input field with a max of 255 single-byte chars) - same as VCHAR_UNI -* TEXT_UNI => text for storing 3000 characters (short text, descriptions, comments, etc.) -* MTEXT_UNI => mediumtext (post text, large text) -* VCHAR:x => varchar(x) -* TIMESTAMP => int(11) UNSIGNED -* DECIMAL => decimal number (5,2) -* DECIMAL: => decimal number (x,2) -* PDECIMAL => precision decimal number (6,3) -* PDECIMAL: => precision decimal number (x,3) -* VCHAR_UNI => varchar(255) BINARY -* VCHAR_CI => varchar_ci for postgresql, others VCHAR -*/ -$schema_data['phpbb_attachments'] = array( - 'COLUMNS' => array( - 'attach_id' => array('UINT', NULL, 'auto_increment'), - 'post_msg_id' => array('UINT', 0), - 'topic_id' => array('UINT', 0), - 'in_message' => array('BOOL', 0), - 'poster_id' => array('UINT', 0), - 'is_orphan' => array('BOOL', 1), - 'physical_filename' => array('VCHAR', ''), - 'real_filename' => array('VCHAR', ''), - 'download_count' => array('UINT', 0), - 'attach_comment' => array('TEXT_UNI', ''), - 'extension' => array('VCHAR:100', ''), - 'mimetype' => array('VCHAR:100', ''), - 'filesize' => array('UINT:20', 0), - 'filetime' => array('TIMESTAMP', 0), - 'thumbnail' => array('BOOL', 0), - ), - 'PRIMARY_KEY' => 'attach_id', - 'KEYS' => array( - 'filetime' => array('INDEX', 'filetime'), - 'post_msg_id' => array('INDEX', 'post_msg_id'), - 'topic_id' => array('INDEX', 'topic_id'), - 'poster_id' => array('INDEX', 'poster_id'), - 'is_orphan' => array('INDEX', 'is_orphan'), - ), -); - -$schema_data['phpbb_acl_groups'] = array( - 'COLUMNS' => array( - 'group_id' => array('UINT', 0), - 'forum_id' => array('UINT', 0), - 'auth_option_id' => array('UINT', 0), - 'auth_role_id' => array('UINT', 0), - 'auth_setting' => array('TINT:2', 0), - ), - 'KEYS' => array( - 'group_id' => array('INDEX', 'group_id'), - 'auth_opt_id' => array('INDEX', 'auth_option_id'), - 'auth_role_id' => array('INDEX', 'auth_role_id'), - ), -); - -$schema_data['phpbb_acl_options'] = array( - 'COLUMNS' => array( - 'auth_option_id' => array('UINT', NULL, 'auto_increment'), - 'auth_option' => array('VCHAR:50', ''), - 'is_global' => array('BOOL', 0), - 'is_local' => array('BOOL', 0), - 'founder_only' => array('BOOL', 0), - ), - 'PRIMARY_KEY' => 'auth_option_id', - 'KEYS' => array( - 'auth_option' => array('UNIQUE', 'auth_option'), - ), -); - -$schema_data['phpbb_acl_roles'] = array( - 'COLUMNS' => array( - 'role_id' => array('UINT', NULL, 'auto_increment'), - 'role_name' => array('VCHAR_UNI', ''), - 'role_description' => array('TEXT_UNI', ''), - 'role_type' => array('VCHAR:10', ''), - 'role_order' => array('USINT', 0), - ), - 'PRIMARY_KEY' => 'role_id', - 'KEYS' => array( - 'role_type' => array('INDEX', 'role_type'), - 'role_order' => array('INDEX', 'role_order'), - ), -); - -$schema_data['phpbb_acl_roles_data'] = array( - 'COLUMNS' => array( - 'role_id' => array('UINT', 0), - 'auth_option_id' => array('UINT', 0), - 'auth_setting' => array('TINT:2', 0), - ), - 'PRIMARY_KEY' => array('role_id', 'auth_option_id'), - 'KEYS' => array( - 'ath_op_id' => array('INDEX', 'auth_option_id'), - ), -); - -$schema_data['phpbb_acl_users'] = array( - 'COLUMNS' => array( - 'user_id' => array('UINT', 0), - 'forum_id' => array('UINT', 0), - 'auth_option_id' => array('UINT', 0), - 'auth_role_id' => array('UINT', 0), - 'auth_setting' => array('TINT:2', 0), - ), - 'KEYS' => array( - 'user_id' => array('INDEX', 'user_id'), - 'auth_option_id' => array('INDEX', 'auth_option_id'), - 'auth_role_id' => array('INDEX', 'auth_role_id'), - ), -); - -$schema_data['phpbb_banlist'] = array( - 'COLUMNS' => array( - 'ban_id' => array('UINT', NULL, 'auto_increment'), - 'ban_userid' => array('UINT', 0), - 'ban_ip' => array('VCHAR:40', ''), - 'ban_email' => array('VCHAR_UNI:100', ''), - 'ban_start' => array('TIMESTAMP', 0), - 'ban_end' => array('TIMESTAMP', 0), - 'ban_exclude' => array('BOOL', 0), - 'ban_reason' => array('VCHAR_UNI', ''), - 'ban_give_reason' => array('VCHAR_UNI', ''), - ), - 'PRIMARY_KEY' => 'ban_id', - 'KEYS' => array( - 'ban_end' => array('INDEX', 'ban_end'), - 'ban_user' => array('INDEX', array('ban_userid', 'ban_exclude')), - 'ban_email' => array('INDEX', array('ban_email', 'ban_exclude')), - 'ban_ip' => array('INDEX', array('ban_ip', 'ban_exclude')), - ), -); - -$schema_data['phpbb_bbcodes'] = array( - 'COLUMNS' => array( - 'bbcode_id' => array('USINT', 0), - 'bbcode_tag' => array('VCHAR:16', ''), - 'bbcode_helpline' => array('VCHAR_UNI', ''), - 'display_on_posting' => array('BOOL', 0), - 'bbcode_match' => array('TEXT_UNI', ''), - 'bbcode_tpl' => array('MTEXT_UNI', ''), - 'first_pass_match' => array('MTEXT_UNI', ''), - 'first_pass_replace' => array('MTEXT_UNI', ''), - 'second_pass_match' => array('MTEXT_UNI', ''), - 'second_pass_replace' => array('MTEXT_UNI', ''), - ), - 'PRIMARY_KEY' => 'bbcode_id', - 'KEYS' => array( - 'display_on_post' => array('INDEX', 'display_on_posting'), - ), -); - -$schema_data['phpbb_bookmarks'] = array( - 'COLUMNS' => array( - 'topic_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - ), - 'PRIMARY_KEY' => array('topic_id', 'user_id'), -); - -$schema_data['phpbb_bots'] = array( - 'COLUMNS' => array( - 'bot_id' => array('UINT', NULL, 'auto_increment'), - 'bot_active' => array('BOOL', 1), - 'bot_name' => array('STEXT_UNI', ''), - 'user_id' => array('UINT', 0), - 'bot_agent' => array('VCHAR', ''), - 'bot_ip' => array('VCHAR', ''), - ), - 'PRIMARY_KEY' => 'bot_id', - 'KEYS' => array( - 'bot_active' => array('INDEX', 'bot_active'), - ), -); - -$schema_data['phpbb_config'] = array( - 'COLUMNS' => array( - 'config_name' => array('VCHAR', ''), - 'config_value' => array('VCHAR_UNI', ''), - 'is_dynamic' => array('BOOL', 0), - ), - 'PRIMARY_KEY' => 'config_name', - 'KEYS' => array( - 'is_dynamic' => array('INDEX', 'is_dynamic'), - ), -); - -$schema_data['phpbb_config_text'] = array( - 'COLUMNS' => array( - 'config_name' => array('VCHAR', ''), - 'config_value' => array('MTEXT', ''), - ), - 'PRIMARY_KEY' => 'config_name', -); - -$schema_data['phpbb_confirm'] = array( - 'COLUMNS' => array( - 'confirm_id' => array('CHAR:32', ''), - 'session_id' => array('CHAR:32', ''), - 'confirm_type' => array('TINT:3', 0), - 'code' => array('VCHAR:8', ''), - 'seed' => array('UINT:10', 0), - 'attempts' => array('UINT', 0), - ), - 'PRIMARY_KEY' => array('session_id', 'confirm_id'), - 'KEYS' => array( - 'confirm_type' => array('INDEX', 'confirm_type'), - ), -); - -$schema_data['phpbb_disallow'] = array( - 'COLUMNS' => array( - 'disallow_id' => array('UINT', NULL, 'auto_increment'), - 'disallow_username' => array('VCHAR_UNI:255', ''), - ), - 'PRIMARY_KEY' => 'disallow_id', -); - -$schema_data['phpbb_drafts'] = array( - 'COLUMNS' => array( - 'draft_id' => array('UINT', NULL, 'auto_increment'), - 'user_id' => array('UINT', 0), - 'topic_id' => array('UINT', 0), - 'forum_id' => array('UINT', 0), - 'save_time' => array('TIMESTAMP', 0), - 'draft_subject' => array('STEXT_UNI', ''), - 'draft_message' => array('MTEXT_UNI', ''), - ), - 'PRIMARY_KEY' => 'draft_id', - 'KEYS' => array( - 'save_time' => array('INDEX', 'save_time'), - ), -); - -$schema_data['phpbb_ext'] = array( - 'COLUMNS' => array( - 'ext_name' => array('VCHAR', ''), - 'ext_active' => array('BOOL', 0), - 'ext_state' => array('TEXT', ''), - ), - 'KEYS' => array( - 'ext_name' => array('UNIQUE', 'ext_name'), - ), -); - -$schema_data['phpbb_extensions'] = array( - 'COLUMNS' => array( - 'extension_id' => array('UINT', NULL, 'auto_increment'), - 'group_id' => array('UINT', 0), - 'extension' => array('VCHAR:100', ''), - ), - 'PRIMARY_KEY' => 'extension_id', -); - -$schema_data['phpbb_extension_groups'] = array( - 'COLUMNS' => array( - 'group_id' => array('UINT', NULL, 'auto_increment'), - 'group_name' => array('VCHAR_UNI', ''), - 'cat_id' => array('TINT:2', 0), - 'allow_group' => array('BOOL', 0), - 'download_mode' => array('BOOL', 1), - 'upload_icon' => array('VCHAR', ''), - 'max_filesize' => array('UINT:20', 0), - 'allowed_forums' => array('TEXT', ''), - 'allow_in_pm' => array('BOOL', 0), - ), - 'PRIMARY_KEY' => 'group_id', -); - -$schema_data['phpbb_forums'] = array( - 'COLUMNS' => array( - 'forum_id' => array('UINT', NULL, 'auto_increment'), - 'parent_id' => array('UINT', 0), - 'left_id' => array('UINT', 0), - 'right_id' => array('UINT', 0), - 'forum_parents' => array('MTEXT', ''), - 'forum_name' => array('STEXT_UNI', ''), - 'forum_desc' => array('TEXT_UNI', ''), - 'forum_desc_bitfield' => array('VCHAR:255', ''), - 'forum_desc_options' => array('UINT:11', 7), - 'forum_desc_uid' => array('VCHAR:8', ''), - 'forum_link' => array('VCHAR_UNI', ''), - 'forum_password' => array('VCHAR_UNI', ''), - 'forum_style' => array('UINT', 0), - 'forum_image' => array('VCHAR', ''), - 'forum_rules' => array('TEXT_UNI', ''), - 'forum_rules_link' => array('VCHAR_UNI', ''), - 'forum_rules_bitfield' => array('VCHAR:255', ''), - 'forum_rules_options' => array('UINT:11', 7), - 'forum_rules_uid' => array('VCHAR:8', ''), - 'forum_topics_per_page' => array('TINT:4', 0), - 'forum_type' => array('TINT:4', 0), - 'forum_status' => array('TINT:4', 0), - 'forum_posts_approved' => array('UINT', 0), - 'forum_posts_unapproved' => array('UINT', 0), - 'forum_posts_softdeleted' => array('UINT', 0), - 'forum_topics_approved' => array('UINT', 0), - 'forum_topics_unapproved' => array('UINT', 0), - 'forum_topics_softdeleted' => array('UINT', 0), - 'forum_last_post_id' => array('UINT', 0), - 'forum_last_poster_id' => array('UINT', 0), - 'forum_last_post_subject' => array('STEXT_UNI', ''), - 'forum_last_post_time' => array('TIMESTAMP', 0), - 'forum_last_poster_name'=> array('VCHAR_UNI', ''), - 'forum_last_poster_colour'=> array('VCHAR:6', ''), - 'forum_flags' => array('TINT:4', 32), - 'forum_options' => array('UINT:20', 0), - 'display_subforum_list' => array('BOOL', 1), - 'display_on_index' => array('BOOL', 1), - 'enable_indexing' => array('BOOL', 1), - 'enable_icons' => array('BOOL', 1), - 'enable_prune' => array('BOOL', 0), - 'prune_next' => array('TIMESTAMP', 0), - 'prune_days' => array('UINT', 0), - 'prune_viewed' => array('UINT', 0), - 'prune_freq' => array('UINT', 0), - ), - 'PRIMARY_KEY' => 'forum_id', - 'KEYS' => array( - 'left_right_id' => array('INDEX', array('left_id', 'right_id')), - 'forum_lastpost_id' => array('INDEX', 'forum_last_post_id'), - ), -); - -$schema_data['phpbb_forums_access'] = array( - 'COLUMNS' => array( - 'forum_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'session_id' => array('CHAR:32', ''), - ), - 'PRIMARY_KEY' => array('forum_id', 'user_id', 'session_id'), -); - -$schema_data['phpbb_forums_track'] = array( - 'COLUMNS' => array( - 'user_id' => array('UINT', 0), - 'forum_id' => array('UINT', 0), - 'mark_time' => array('TIMESTAMP', 0), - ), - 'PRIMARY_KEY' => array('user_id', 'forum_id'), -); - -$schema_data['phpbb_forums_watch'] = array( - 'COLUMNS' => array( - 'forum_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'notify_status' => array('BOOL', 0), - ), - 'KEYS' => array( - 'forum_id' => array('INDEX', 'forum_id'), - 'user_id' => array('INDEX', 'user_id'), - 'notify_stat' => array('INDEX', 'notify_status'), - ), -); - -$schema_data['phpbb_groups'] = array( - 'COLUMNS' => array( - 'group_id' => array('UINT', NULL, 'auto_increment'), - 'group_type' => array('TINT:4', 1), - 'group_founder_manage' => array('BOOL', 0), - 'group_skip_auth' => array('BOOL', 0), - 'group_name' => array('VCHAR_CI', ''), - 'group_desc' => array('TEXT_UNI', ''), - 'group_desc_bitfield' => array('VCHAR:255', ''), - 'group_desc_options' => array('UINT:11', 7), - 'group_desc_uid' => array('VCHAR:8', ''), - 'group_display' => array('BOOL', 0), - 'group_avatar' => array('VCHAR', ''), - 'group_avatar_type' => array('VCHAR:255', ''), - 'group_avatar_width' => array('USINT', 0), - 'group_avatar_height' => array('USINT', 0), - 'group_rank' => array('UINT', 0), - 'group_colour' => array('VCHAR:6', ''), - 'group_sig_chars' => array('UINT', 0), - 'group_receive_pm' => array('BOOL', 0), - 'group_message_limit' => array('UINT', 0), - 'group_max_recipients' => array('UINT', 0), - 'group_legend' => array('UINT', 0), - ), - 'PRIMARY_KEY' => 'group_id', - 'KEYS' => array( - 'group_legend_name' => array('INDEX', array('group_legend', 'group_name')), - ), -); - -$schema_data['phpbb_icons'] = array( - 'COLUMNS' => array( - 'icons_id' => array('UINT', NULL, 'auto_increment'), - 'icons_url' => array('VCHAR', ''), - 'icons_width' => array('TINT:4', 0), - 'icons_height' => array('TINT:4', 0), - 'icons_order' => array('UINT', 0), - 'display_on_posting' => array('BOOL', 1), - ), - 'PRIMARY_KEY' => 'icons_id', - 'KEYS' => array( - 'display_on_posting' => array('INDEX', 'display_on_posting'), - ), -); - -$schema_data['phpbb_lang'] = array( - 'COLUMNS' => array( - 'lang_id' => array('TINT:4', NULL, 'auto_increment'), - 'lang_iso' => array('VCHAR:30', ''), - 'lang_dir' => array('VCHAR:30', ''), - 'lang_english_name' => array('VCHAR_UNI:100', ''), - 'lang_local_name' => array('VCHAR_UNI:255', ''), - 'lang_author' => array('VCHAR_UNI:255', ''), - ), - 'PRIMARY_KEY' => 'lang_id', - 'KEYS' => array( - 'lang_iso' => array('INDEX', 'lang_iso'), - ), -); - -$schema_data['phpbb_log'] = array( - 'COLUMNS' => array( - 'log_id' => array('UINT', NULL, 'auto_increment'), - 'log_type' => array('TINT:4', 0), - 'user_id' => array('UINT', 0), - 'forum_id' => array('UINT', 0), - 'topic_id' => array('UINT', 0), - 'reportee_id' => array('UINT', 0), - 'log_ip' => array('VCHAR:40', ''), - 'log_time' => array('TIMESTAMP', 0), - 'log_operation' => array('TEXT_UNI', ''), - 'log_data' => array('MTEXT_UNI', ''), - ), - 'PRIMARY_KEY' => 'log_id', - 'KEYS' => array( - 'log_type' => array('INDEX', 'log_type'), - 'log_time' => array('INDEX', 'log_time'), - 'forum_id' => array('INDEX', 'forum_id'), - 'topic_id' => array('INDEX', 'topic_id'), - 'reportee_id' => array('INDEX', 'reportee_id'), - 'user_id' => array('INDEX', 'user_id'), - ), -); - -$schema_data['phpbb_login_attempts'] = array( - 'COLUMNS' => array( - 'attempt_ip' => array('VCHAR:40', ''), - 'attempt_browser' => array('VCHAR:150', ''), - 'attempt_forwarded_for' => array('VCHAR:255', ''), - 'attempt_time' => array('TIMESTAMP', 0), - 'user_id' => array('UINT', 0), - 'username' => array('VCHAR_UNI:255', 0), - 'username_clean' => array('VCHAR_CI', 0), - ), - 'KEYS' => array( - 'att_ip' => array('INDEX', array('attempt_ip', 'attempt_time')), - 'att_for' => array('INDEX', array('attempt_forwarded_for', 'attempt_time')), - 'att_time' => array('INDEX', array('attempt_time')), - 'user_id' => array('INDEX', 'user_id'), - ), -); - -$schema_data['phpbb_moderator_cache'] = array( - 'COLUMNS' => array( - 'forum_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'username' => array('VCHAR_UNI:255', ''), - 'group_id' => array('UINT', 0), - 'group_name' => array('VCHAR_UNI', ''), - 'display_on_index' => array('BOOL', 1), - ), - 'KEYS' => array( - 'disp_idx' => array('INDEX', 'display_on_index'), - 'forum_id' => array('INDEX', 'forum_id'), - ), -); - -$schema_data['phpbb_migrations'] = array( - 'COLUMNS' => array( - 'migration_name' => array('VCHAR', ''), - 'migration_depends_on' => array('TEXT', ''), - 'migration_schema_done' => array('BOOL', 0), - 'migration_data_done' => array('BOOL', 0), - 'migration_data_state' => array('TEXT', ''), - 'migration_start_time' => array('TIMESTAMP', 0), - 'migration_end_time' => array('TIMESTAMP', 0), - ), - 'PRIMARY_KEY' => 'migration_name', -); - -$schema_data['phpbb_modules'] = array( - 'COLUMNS' => array( - 'module_id' => array('UINT', NULL, 'auto_increment'), - 'module_enabled' => array('BOOL', 1), - 'module_display' => array('BOOL', 1), - 'module_basename' => array('VCHAR', ''), - 'module_class' => array('VCHAR:10', ''), - 'parent_id' => array('UINT', 0), - 'left_id' => array('UINT', 0), - 'right_id' => array('UINT', 0), - 'module_langname' => array('VCHAR', ''), - 'module_mode' => array('VCHAR', ''), - 'module_auth' => array('VCHAR', ''), - ), - 'PRIMARY_KEY' => 'module_id', - 'KEYS' => array( - 'left_right_id' => array('INDEX', array('left_id', 'right_id')), - 'module_enabled' => array('INDEX', 'module_enabled'), - 'class_left_id' => array('INDEX', array('module_class', 'left_id')), - ), -); - -$schema_data['phpbb_notification_types'] = array( - 'COLUMNS' => array( - 'notification_type_id' => array('USINT', NULL, 'auto_increment'), - 'notification_type_name' => array('VCHAR:255', ''), - 'notification_type_enabled' => array('BOOL', 1), - ), - 'PRIMARY_KEY' => array('notification_type_id'), - 'KEYS' => array( - 'type' => array('UNIQUE', array('notification_type_name')), - ), -); - -$schema_data['phpbb_notifications'] = array( - 'COLUMNS' => array( - 'notification_id' => array('UINT:10', NULL, 'auto_increment'), - 'notification_type_id' => array('USINT', 0), - 'item_id' => array('UINT', 0), - 'item_parent_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'notification_read' => array('BOOL', 0), - 'notification_time' => array('TIMESTAMP', 1), - 'notification_data' => array('TEXT_UNI', ''), - ), - 'PRIMARY_KEY' => 'notification_id', - 'KEYS' => array( - 'item_ident' => array('INDEX', array('notification_type_id', 'item_id')), - 'user' => array('INDEX', array('user_id', 'notification_read')), - ), -); - -$schema_data['phpbb_oauth_accounts'] = array( - 'COLUMNS' => array( - 'user_id' => array('UINT', 0), - 'provider' => array('VCHAR', ''), - 'oauth_provider_id' => array('TEXT_UNI', ''), - ), - 'PRIMARY_KEY' => array( - 'user_id', - 'provider', - ), -); - -$schema_data['phpbb_oauth_tokens'] = array( - 'COLUMNS' => array( - 'user_id' => array('UINT', 0), // phpbb_users.user_id - 'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set - 'provider' => array('VCHAR', ''), // Name of the OAuth provider - 'oauth_token' => array('MTEXT', ''), // Serialized token - ), - 'KEYS' => array( - 'user_id' => array('INDEX', 'user_id'), - 'provider' => array('INDEX', 'provider'), - ), -); - -$schema_data['phpbb_poll_options'] = array( - 'COLUMNS' => array( - 'poll_option_id' => array('TINT:4', 0), - 'topic_id' => array('UINT', 0), - 'poll_option_text' => array('TEXT_UNI', ''), - 'poll_option_total' => array('UINT', 0), - ), - 'KEYS' => array( - 'poll_opt_id' => array('INDEX', 'poll_option_id'), - 'topic_id' => array('INDEX', 'topic_id'), - ), -); - -$schema_data['phpbb_poll_votes'] = array( - 'COLUMNS' => array( - 'topic_id' => array('UINT', 0), - 'poll_option_id' => array('TINT:4', 0), - 'vote_user_id' => array('UINT', 0), - 'vote_user_ip' => array('VCHAR:40', ''), - ), - 'KEYS' => array( - 'topic_id' => array('INDEX', 'topic_id'), - 'vote_user_id' => array('INDEX', 'vote_user_id'), - 'vote_user_ip' => array('INDEX', 'vote_user_ip'), - ), -); - -$schema_data['phpbb_posts'] = array( - 'COLUMNS' => array( - 'post_id' => array('UINT', NULL, 'auto_increment'), - 'topic_id' => array('UINT', 0), - 'forum_id' => array('UINT', 0), - 'poster_id' => array('UINT', 0), - 'icon_id' => array('UINT', 0), - 'poster_ip' => array('VCHAR:40', ''), - 'post_time' => array('TIMESTAMP', 0), - 'post_visibility' => array('TINT:3', 0), - 'post_reported' => array('BOOL', 0), - 'enable_bbcode' => array('BOOL', 1), - 'enable_smilies' => array('BOOL', 1), - 'enable_magic_url' => array('BOOL', 1), - 'enable_sig' => array('BOOL', 1), - 'post_username' => array('VCHAR_UNI:255', ''), - 'post_subject' => array('STEXT_UNI', '', 'true_sort'), - 'post_text' => array('MTEXT_UNI', ''), - 'post_checksum' => array('VCHAR:32', ''), - 'post_attachment' => array('BOOL', 0), - 'bbcode_bitfield' => array('VCHAR:255', ''), - 'bbcode_uid' => array('VCHAR:8', ''), - 'post_postcount' => array('BOOL', 1), - 'post_edit_time' => array('TIMESTAMP', 0), - 'post_edit_reason' => array('STEXT_UNI', ''), - 'post_edit_user' => array('UINT', 0), - 'post_edit_count' => array('USINT', 0), - 'post_edit_locked' => array('BOOL', 0), - 'post_delete_time' => array('TIMESTAMP', 0), - 'post_delete_reason' => array('STEXT_UNI', ''), - 'post_delete_user' => array('UINT', 0), - ), - 'PRIMARY_KEY' => 'post_id', - 'KEYS' => array( - 'forum_id' => array('INDEX', 'forum_id'), - 'topic_id' => array('INDEX', 'topic_id'), - 'poster_ip' => array('INDEX', 'poster_ip'), - 'poster_id' => array('INDEX', 'poster_id'), - 'post_visibility' => array('INDEX', 'post_visibility'), - 'post_username' => array('INDEX', 'post_username'), - 'tid_post_time' => array('INDEX', array('topic_id', 'post_time')), - ), -); - -$schema_data['phpbb_privmsgs'] = array( - 'COLUMNS' => array( - 'msg_id' => array('UINT', NULL, 'auto_increment'), - 'root_level' => array('UINT', 0), - 'author_id' => array('UINT', 0), - 'icon_id' => array('UINT', 0), - 'author_ip' => array('VCHAR:40', ''), - 'message_time' => array('TIMESTAMP', 0), - 'enable_bbcode' => array('BOOL', 1), - 'enable_smilies' => array('BOOL', 1), - 'enable_magic_url' => array('BOOL', 1), - 'enable_sig' => array('BOOL', 1), - 'message_subject' => array('STEXT_UNI', ''), - 'message_text' => array('MTEXT_UNI', ''), - 'message_edit_reason' => array('STEXT_UNI', ''), - 'message_edit_user' => array('UINT', 0), - 'message_attachment' => array('BOOL', 0), - 'bbcode_bitfield' => array('VCHAR:255', ''), - 'bbcode_uid' => array('VCHAR:8', ''), - 'message_edit_time' => array('TIMESTAMP', 0), - 'message_edit_count' => array('USINT', 0), - 'to_address' => array('TEXT_UNI', ''), - 'bcc_address' => array('TEXT_UNI', ''), - 'message_reported' => array('BOOL', 0), - ), - 'PRIMARY_KEY' => 'msg_id', - 'KEYS' => array( - 'author_ip' => array('INDEX', 'author_ip'), - 'message_time' => array('INDEX', 'message_time'), - 'author_id' => array('INDEX', 'author_id'), - 'root_level' => array('INDEX', 'root_level'), - ), -); - -$schema_data['phpbb_privmsgs_folder'] = array( - 'COLUMNS' => array( - 'folder_id' => array('UINT', NULL, 'auto_increment'), - 'user_id' => array('UINT', 0), - 'folder_name' => array('VCHAR_UNI', ''), - 'pm_count' => array('UINT', 0), - ), - 'PRIMARY_KEY' => 'folder_id', - 'KEYS' => array( - 'user_id' => array('INDEX', 'user_id'), - ), -); - -$schema_data['phpbb_privmsgs_rules'] = array( - 'COLUMNS' => array( - 'rule_id' => array('UINT', NULL, 'auto_increment'), - 'user_id' => array('UINT', 0), - 'rule_check' => array('UINT', 0), - 'rule_connection' => array('UINT', 0), - 'rule_string' => array('VCHAR_UNI', ''), - 'rule_user_id' => array('UINT', 0), - 'rule_group_id' => array('UINT', 0), - 'rule_action' => array('UINT', 0), - 'rule_folder_id' => array('INT:11', 0), - ), - 'PRIMARY_KEY' => 'rule_id', - 'KEYS' => array( - 'user_id' => array('INDEX', 'user_id'), - ), -); - -$schema_data['phpbb_privmsgs_to'] = array( - 'COLUMNS' => array( - 'msg_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'author_id' => array('UINT', 0), - 'pm_deleted' => array('BOOL', 0), - 'pm_new' => array('BOOL', 1), - 'pm_unread' => array('BOOL', 1), - 'pm_replied' => array('BOOL', 0), - 'pm_marked' => array('BOOL', 0), - 'pm_forwarded' => array('BOOL', 0), - 'folder_id' => array('INT:11', 0), - ), - 'KEYS' => array( - 'msg_id' => array('INDEX', 'msg_id'), - 'author_id' => array('INDEX', 'author_id'), - 'usr_flder_id' => array('INDEX', array('user_id', 'folder_id')), - ), -); - -$schema_data['phpbb_profile_fields'] = array( - 'COLUMNS' => array( - 'field_id' => array('UINT', NULL, 'auto_increment'), - 'field_name' => array('VCHAR_UNI', ''), - 'field_type' => array('VCHAR:100', ''), - 'field_ident' => array('VCHAR:20', ''), - 'field_length' => array('VCHAR:20', ''), - 'field_minlen' => array('VCHAR', ''), - 'field_maxlen' => array('VCHAR', ''), - 'field_novalue' => array('VCHAR_UNI', ''), - 'field_default_value' => array('VCHAR_UNI', ''), - 'field_validation' => array('VCHAR_UNI:20', ''), - 'field_required' => array('BOOL', 0), - 'field_show_novalue' => array('BOOL', 0), - 'field_show_on_reg' => array('BOOL', 0), - 'field_show_on_pm' => array('BOOL', 0), - 'field_show_on_vt' => array('BOOL', 0), - 'field_show_on_ml' => array('BOOL', 0), - 'field_show_profile' => array('BOOL', 0), - 'field_hide' => array('BOOL', 0), - 'field_no_view' => array('BOOL', 0), - 'field_active' => array('BOOL', 0), - 'field_order' => array('UINT', 0), - 'field_is_contact' => array('BOOL', 0), - 'field_contact_desc' => array('VCHAR', ''), - 'field_contact_url' => array('VCHAR', ''), - ), - 'PRIMARY_KEY' => 'field_id', - 'KEYS' => array( - 'fld_type' => array('INDEX', 'field_type'), - 'fld_ordr' => array('INDEX', 'field_order'), - ), -); - -$schema_data['phpbb_profile_fields_data'] = array( - 'COLUMNS' => array( - 'user_id' => array('UINT', 0), - 'pf_phpbb_location' => array('VCHAR', ''), - 'pf_phpbb_interests' => array('TEXT_UNI', ''), - 'pf_phpbb_occupation' => array('TEXT_UNI', ''), - 'pf_phpbb_icq' => array('VCHAR', ''), - 'pf_phpbb_aol' => array('VCHAR', ''), - 'pf_phpbb_wlm' => array('VCHAR', ''), - 'pf_phpbb_yahoo' => array('VCHAR', ''), - 'pf_phpbb_website' => array('VCHAR', ''), - ), - 'PRIMARY_KEY' => 'user_id', -); - -$schema_data['phpbb_profile_fields_lang'] = array( - 'COLUMNS' => array( - 'field_id' => array('UINT', 0), - 'lang_id' => array('UINT', 0), - 'option_id' => array('UINT', 0), - 'field_type' => array('VCHAR:100', ''), - 'lang_value' => array('VCHAR_UNI', ''), - ), - 'PRIMARY_KEY' => array('field_id', 'lang_id', 'option_id'), -); - -$schema_data['phpbb_profile_lang'] = array( - 'COLUMNS' => array( - 'field_id' => array('UINT', 0), - 'lang_id' => array('UINT', 0), - 'lang_name' => array('VCHAR_UNI', ''), - 'lang_explain' => array('TEXT_UNI', ''), - 'lang_default_value' => array('VCHAR_UNI', ''), - ), - 'PRIMARY_KEY' => array('field_id', 'lang_id'), -); - -$schema_data['phpbb_ranks'] = array( - 'COLUMNS' => array( - 'rank_id' => array('UINT', NULL, 'auto_increment'), - 'rank_title' => array('VCHAR_UNI', ''), - 'rank_min' => array('UINT', 0), - 'rank_special' => array('BOOL', 0), - 'rank_image' => array('VCHAR', ''), - ), - 'PRIMARY_KEY' => 'rank_id', -); - -$schema_data['phpbb_reports'] = array( - 'COLUMNS' => array( - 'report_id' => array('UINT', NULL, 'auto_increment'), - 'reason_id' => array('USINT', 0), - 'post_id' => array('UINT', 0), - 'pm_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'user_notify' => array('BOOL', 0), - 'report_closed' => array('BOOL', 0), - 'report_time' => array('TIMESTAMP', 0), - 'report_text' => array('MTEXT_UNI', ''), - 'reported_post_text' => array('MTEXT_UNI', ''), - 'reported_post_uid' => array('VCHAR:8', ''), - 'reported_post_bitfield' => array('VCHAR:255', ''), - 'reported_post_enable_magic_url' => array('BOOL', 1), - 'reported_post_enable_smilies' => array('BOOL', 1), - 'reported_post_enable_bbcode' => array('BOOL', 1) - ), - 'PRIMARY_KEY' => 'report_id', - 'KEYS' => array( - 'post_id' => array('INDEX', 'post_id'), - 'pm_id' => array('INDEX', 'pm_id'), - ), -); - -$schema_data['phpbb_reports_reasons'] = array( - 'COLUMNS' => array( - 'reason_id' => array('USINT', NULL, 'auto_increment'), - 'reason_title' => array('VCHAR_UNI', ''), - 'reason_description' => array('MTEXT_UNI', ''), - 'reason_order' => array('USINT', 0), - ), - 'PRIMARY_KEY' => 'reason_id', -); - -$schema_data['phpbb_search_results'] = array( - 'COLUMNS' => array( - 'search_key' => array('VCHAR:32', ''), - 'search_time' => array('TIMESTAMP', 0), - 'search_keywords' => array('MTEXT_UNI', ''), - 'search_authors' => array('MTEXT', ''), - ), - 'PRIMARY_KEY' => 'search_key', -); - -$schema_data['phpbb_search_wordlist'] = array( - 'COLUMNS' => array( - 'word_id' => array('UINT', NULL, 'auto_increment'), - 'word_text' => array('VCHAR_UNI', ''), - 'word_common' => array('BOOL', 0), - 'word_count' => array('UINT', 0), - ), - 'PRIMARY_KEY' => 'word_id', - 'KEYS' => array( - 'wrd_txt' => array('UNIQUE', 'word_text'), - 'wrd_cnt' => array('INDEX', 'word_count'), - ), -); - -$schema_data['phpbb_search_wordmatch'] = array( - 'COLUMNS' => array( - 'post_id' => array('UINT', 0), - 'word_id' => array('UINT', 0), - 'title_match' => array('BOOL', 0), - ), - 'KEYS' => array( - 'unq_mtch' => array('UNIQUE', array('word_id', 'post_id', 'title_match')), - 'word_id' => array('INDEX', 'word_id'), - 'post_id' => array('INDEX', 'post_id'), - ), -); - -$schema_data['phpbb_sessions'] = array( - 'COLUMNS' => array( - 'session_id' => array('CHAR:32', ''), - 'session_user_id' => array('UINT', 0), - 'session_forum_id' => array('UINT', 0), - 'session_last_visit' => array('TIMESTAMP', 0), - 'session_start' => array('TIMESTAMP', 0), - 'session_time' => array('TIMESTAMP', 0), - 'session_ip' => array('VCHAR:40', ''), - 'session_browser' => array('VCHAR:150', ''), - 'session_forwarded_for' => array('VCHAR:255', ''), - 'session_page' => array('VCHAR_UNI', ''), - 'session_viewonline' => array('BOOL', 1), - 'session_autologin' => array('BOOL', 0), - 'session_admin' => array('BOOL', 0), - ), - 'PRIMARY_KEY' => 'session_id', - 'KEYS' => array( - 'session_time' => array('INDEX', 'session_time'), - 'session_user_id' => array('INDEX', 'session_user_id'), - 'session_fid' => array('INDEX', 'session_forum_id'), - ), -); - -$schema_data['phpbb_sessions_keys'] = array( - 'COLUMNS' => array( - 'key_id' => array('CHAR:32', ''), - 'user_id' => array('UINT', 0), - 'last_ip' => array('VCHAR:40', ''), - 'last_login' => array('TIMESTAMP', 0), - ), - 'PRIMARY_KEY' => array('key_id', 'user_id'), - 'KEYS' => array( - 'last_login' => array('INDEX', 'last_login'), - ), -); - -$schema_data['phpbb_sitelist'] = array( - 'COLUMNS' => array( - 'site_id' => array('UINT', NULL, 'auto_increment'), - 'site_ip' => array('VCHAR:40', ''), - 'site_hostname' => array('VCHAR', ''), - 'ip_exclude' => array('BOOL', 0), - ), - 'PRIMARY_KEY' => 'site_id', -); - -$schema_data['phpbb_smilies'] = array( - 'COLUMNS' => array( - 'smiley_id' => array('UINT', NULL, 'auto_increment'), - // We may want to set 'code' to VCHAR:50 or check if unicode support is possible... at the moment only ASCII characters are allowed. - 'code' => array('VCHAR_UNI:50', ''), - 'emotion' => array('VCHAR_UNI:50', ''), - 'smiley_url' => array('VCHAR:50', ''), - 'smiley_width' => array('USINT', 0), - 'smiley_height' => array('USINT', 0), - 'smiley_order' => array('UINT', 0), - 'display_on_posting'=> array('BOOL', 1), - ), - 'PRIMARY_KEY' => 'smiley_id', - 'KEYS' => array( - 'display_on_post' => array('INDEX', 'display_on_posting'), - ), -); - -$schema_data['phpbb_styles'] = array( - 'COLUMNS' => array( - 'style_id' => array('UINT', NULL, 'auto_increment'), - 'style_name' => array('VCHAR_UNI:255', ''), - 'style_copyright' => array('VCHAR_UNI', ''), - 'style_active' => array('BOOL', 1), - 'style_path' => array('VCHAR:100', ''), - 'bbcode_bitfield' => array('VCHAR:255', 'kNg='), - 'style_parent_id' => array('UINT:4', 0), - 'style_parent_tree' => array('TEXT', ''), - ), - 'PRIMARY_KEY' => 'style_id', - 'KEYS' => array( - 'style_name' => array('UNIQUE', 'style_name'), - ), -); - -$schema_data['phpbb_teampage'] = array( - 'COLUMNS' => array( - 'teampage_id' => array('UINT', NULL, 'auto_increment'), - 'group_id' => array('UINT', 0), - 'teampage_name' => array('VCHAR_UNI:255', ''), - 'teampage_position' => array('UINT', 0), - 'teampage_parent' => array('UINT', 0), - ), - 'PRIMARY_KEY' => 'teampage_id', -); - -$schema_data['phpbb_topics'] = array( - 'COLUMNS' => array( - 'topic_id' => array('UINT', NULL, 'auto_increment'), - 'forum_id' => array('UINT', 0), - 'icon_id' => array('UINT', 0), - 'topic_attachment' => array('BOOL', 0), - 'topic_visibility' => array('TINT:3', 0), - 'topic_reported' => array('BOOL', 0), - 'topic_title' => array('STEXT_UNI', '', 'true_sort'), - 'topic_poster' => array('UINT', 0), - 'topic_time' => array('TIMESTAMP', 0), - 'topic_time_limit' => array('TIMESTAMP', 0), - 'topic_views' => array('UINT', 0), - 'topic_posts_approved' => array('UINT', 0), - 'topic_posts_unapproved' => array('UINT', 0), - 'topic_posts_softdeleted' => array('UINT', 0), - 'topic_status' => array('TINT:3', 0), - 'topic_type' => array('TINT:3', 0), - 'topic_first_post_id' => array('UINT', 0), - 'topic_first_poster_name' => array('VCHAR_UNI', ''), - 'topic_first_poster_colour' => array('VCHAR:6', ''), - 'topic_last_post_id' => array('UINT', 0), - 'topic_last_poster_id' => array('UINT', 0), - 'topic_last_poster_name' => array('VCHAR_UNI', ''), - 'topic_last_poster_colour' => array('VCHAR:6', ''), - 'topic_last_post_subject' => array('STEXT_UNI', ''), - 'topic_last_post_time' => array('TIMESTAMP', 0), - 'topic_last_view_time' => array('TIMESTAMP', 0), - 'topic_moved_id' => array('UINT', 0), - 'topic_bumped' => array('BOOL', 0), - 'topic_bumper' => array('UINT', 0), - 'poll_title' => array('STEXT_UNI', ''), - 'poll_start' => array('TIMESTAMP', 0), - 'poll_length' => array('TIMESTAMP', 0), - 'poll_max_options' => array('TINT:4', 1), - 'poll_last_vote' => array('TIMESTAMP', 0), - 'poll_vote_change' => array('BOOL', 0), - 'topic_delete_time' => array('TIMESTAMP', 0), - 'topic_delete_reason' => array('STEXT_UNI', ''), - 'topic_delete_user' => array('UINT', 0), - ), - 'PRIMARY_KEY' => 'topic_id', - 'KEYS' => array( - 'forum_id' => array('INDEX', 'forum_id'), - 'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')), - 'last_post_time' => array('INDEX', 'topic_last_post_time'), - 'topic_visibility' => array('INDEX', 'topic_visibility'), - 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_visibility', 'topic_last_post_id')), - 'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')), - ), -); - -$schema_data['phpbb_topics_track'] = array( - 'COLUMNS' => array( - 'user_id' => array('UINT', 0), - 'topic_id' => array('UINT', 0), - 'forum_id' => array('UINT', 0), - 'mark_time' => array('TIMESTAMP', 0), - ), - 'PRIMARY_KEY' => array('user_id', 'topic_id'), - 'KEYS' => array( - 'topic_id' => array('INDEX', 'topic_id'), - 'forum_id' => array('INDEX', 'forum_id'), - ), -); - -$schema_data['phpbb_topics_posted'] = array( - 'COLUMNS' => array( - 'user_id' => array('UINT', 0), - 'topic_id' => array('UINT', 0), - 'topic_posted' => array('BOOL', 0), - ), - 'PRIMARY_KEY' => array('user_id', 'topic_id'), -); - -$schema_data['phpbb_topics_watch'] = array( - 'COLUMNS' => array( - 'topic_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'notify_status' => array('BOOL', 0), - ), - 'KEYS' => array( - 'topic_id' => array('INDEX', 'topic_id'), - 'user_id' => array('INDEX', 'user_id'), - 'notify_stat' => array('INDEX', 'notify_status'), - ), -); - -$schema_data['phpbb_user_notifications'] = array( - 'COLUMNS' => array( - 'item_type' => array('VCHAR:255', ''), - 'item_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'method' => array('VCHAR:255', ''), - 'notify' => array('BOOL', 1), - ), -); - -$schema_data['phpbb_user_group'] = array( - 'COLUMNS' => array( - 'group_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'group_leader' => array('BOOL', 0), - 'user_pending' => array('BOOL', 1), - ), - 'KEYS' => array( - 'group_id' => array('INDEX', 'group_id'), - 'user_id' => array('INDEX', 'user_id'), - 'group_leader' => array('INDEX', 'group_leader'), - ), -); - -$schema_data['phpbb_users'] = array( - 'COLUMNS' => array( - 'user_id' => array('UINT', NULL, 'auto_increment'), - 'user_type' => array('TINT:2', 0), - 'group_id' => array('UINT', 3), - 'user_permissions' => array('MTEXT', ''), - 'user_perm_from' => array('UINT', 0), - 'user_ip' => array('VCHAR:40', ''), - 'user_regdate' => array('TIMESTAMP', 0), - 'username' => array('VCHAR_CI', ''), - 'username_clean' => array('VCHAR_CI', ''), - 'user_password' => array('VCHAR_UNI', ''), - 'user_passchg' => array('TIMESTAMP', 0), - 'user_pass_convert' => array('BOOL', 0), - 'user_actkey' => array('VCHAR:32', ''), - 'user_newpasswd' => array('VCHAR_UNI', ''), - 'user_email' => array('VCHAR_UNI:100', ''), - 'user_email_hash' => array('BINT', 0), - 'user_birthday' => array('VCHAR:10', ''), - 'user_lastvisit' => array('TIMESTAMP', 0), - 'user_lastmark' => array('TIMESTAMP', 0), - 'user_lastpost_time' => array('TIMESTAMP', 0), - 'user_lastpage' => array('VCHAR_UNI:200', ''), - 'user_last_confirm_key' => array('VCHAR:10', ''), - 'user_last_search' => array('TIMESTAMP', 0), - 'user_warnings' => array('TINT:4', 0), - 'user_last_warning' => array('TIMESTAMP', 0), - 'user_login_attempts' => array('TINT:4', 0), - 'user_inactive_reason' => array('TINT:2', 0), - 'user_inactive_time' => array('TIMESTAMP', 0), - 'user_posts' => array('UINT', 0), - 'user_lang' => array('VCHAR:30', ''), - 'user_timezone' => array('VCHAR:100', 'UTC'), - 'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'), - 'user_style' => array('UINT', 0), - 'user_rank' => array('UINT', 0), - 'user_colour' => array('VCHAR:6', ''), - 'user_new_privmsg' => array('INT:4', 0), - 'user_unread_privmsg' => array('INT:4', 0), - 'user_last_privmsg' => array('TIMESTAMP', 0), - 'user_message_rules' => array('BOOL', 0), - 'user_full_folder' => array('INT:11', -3), - 'user_emailtime' => array('TIMESTAMP', 0), - 'user_topic_show_days' => array('USINT', 0), - 'user_topic_sortby_type' => array('VCHAR:1', 't'), - 'user_topic_sortby_dir' => array('VCHAR:1', 'd'), - 'user_post_show_days' => array('USINT', 0), - 'user_post_sortby_type' => array('VCHAR:1', 't'), - 'user_post_sortby_dir' => array('VCHAR:1', 'a'), - 'user_notify' => array('BOOL', 0), - 'user_notify_pm' => array('BOOL', 1), - 'user_notify_type' => array('TINT:4', 0), - 'user_allow_pm' => array('BOOL', 1), - 'user_allow_viewonline' => array('BOOL', 1), - 'user_allow_viewemail' => array('BOOL', 1), - 'user_allow_massemail' => array('BOOL', 1), - 'user_options' => array('UINT:11', 230271), - 'user_avatar' => array('VCHAR', ''), - 'user_avatar_type' => array('VCHAR:255', ''), - 'user_avatar_width' => array('USINT', 0), - 'user_avatar_height' => array('USINT', 0), - 'user_sig' => array('MTEXT_UNI', ''), - 'user_sig_bbcode_uid' => array('VCHAR:8', ''), - 'user_sig_bbcode_bitfield' => array('VCHAR:255', ''), - 'user_jabber' => array('VCHAR_UNI', ''), - 'user_form_salt' => array('VCHAR_UNI:32', ''), - 'user_new' => array('BOOL', 1), - 'user_reminded' => array('TINT:4', 0), - 'user_reminded_time' => array('TIMESTAMP', 0), - ), - 'PRIMARY_KEY' => 'user_id', - 'KEYS' => array( - 'user_birthday' => array('INDEX', 'user_birthday'), - 'user_email_hash' => array('INDEX', 'user_email_hash'), - 'user_type' => array('INDEX', 'user_type'), - 'username_clean' => array('UNIQUE', 'username_clean'), - ), -); - -$schema_data['phpbb_warnings'] = array( - 'COLUMNS' => array( - 'warning_id' => array('UINT', NULL, 'auto_increment'), - 'user_id' => array('UINT', 0), - 'post_id' => array('UINT', 0), - 'log_id' => array('UINT', 0), - 'warning_time' => array('TIMESTAMP', 0), - ), - 'PRIMARY_KEY' => 'warning_id', -); - -$schema_data['phpbb_words'] = array( - 'COLUMNS' => array( - 'word_id' => array('UINT', NULL, 'auto_increment'), - 'word' => array('VCHAR_UNI', ''), - 'replacement' => array('VCHAR_UNI', ''), - ), - 'PRIMARY_KEY' => 'word_id', -); - -$schema_data['phpbb_zebra'] = array( - 'COLUMNS' => array( - 'user_id' => array('UINT', 0), - 'zebra_id' => array('UINT', 0), - 'friend' => array('BOOL', 0), - 'foe' => array('BOOL', 0), - ), - 'PRIMARY_KEY' => array('user_id', 'zebra_id'), -); diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 009f0dfa33..c749b54f40 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1151,13 +1151,9 @@ class install_install extends module // How should we treat this schema? $delimiter = $available_dbms[$data['dbms']]['DELIM']; - $sql_query = @file_get_contents($dbms_schema); - $sql_query = preg_replace('#phpbb_#i', $data['table_prefix'], $sql_query); - $sql_query = phpbb_remove_comments($sql_query); - $sql_query = split_sql_file($sql_query, $delimiter); foreach ($sql_query as $sql) @@ -1171,6 +1167,27 @@ class install_install extends module } unset($sql_query); + // Ok we have the db info go ahead and work on building the table + $db_table_schema = @file_get_contents('schemas/schema.json'); + $db_table_schema = json_decode($db_table_schema, true); + + if (!defined('CONFIG_TABLE')) + { + // CONFIG_TABLE is required by sql_create_index() to check the + // length of index names. However table_prefix is not defined + // here yet, so we need to create the constant ourselves. + define('CONFIG_TABLE', $data['table_prefix'] . 'config'); + } + + $db_tools = new \phpbb\db\tools($db); + foreach ($db_table_schema as $table_name => $table_data) + { + $db_tools->sql_create_table( + $data['table_prefix'] . substr($table_name, 6), + $table_data + ); + } + // Ok tables have been built, let's fill in the basic information $sql_query = file_get_contents('schemas/schema_data.sql'); diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 3782fc66ff..28649dc54c 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -3,1510 +3,3 @@ # To change the contents of this file, edit # phpBB/develop/create_schema_files.php and # run it. - -# Table: 'phpbb_attachments' -CREATE TABLE phpbb_attachments ( - attach_id INTEGER NOT NULL, - post_msg_id INTEGER DEFAULT 0 NOT NULL, - topic_id INTEGER DEFAULT 0 NOT NULL, - in_message INTEGER DEFAULT 0 NOT NULL, - poster_id INTEGER DEFAULT 0 NOT NULL, - is_orphan INTEGER DEFAULT 1 NOT NULL, - physical_filename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - real_filename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - download_count INTEGER DEFAULT 0 NOT NULL, - attach_comment BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - extension VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL, - mimetype VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL, - filesize INTEGER DEFAULT 0 NOT NULL, - filetime INTEGER DEFAULT 0 NOT NULL, - thumbnail INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_attachments ADD PRIMARY KEY (attach_id);; - -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_topic_id ON phpbb_attachments(topic_id);; -CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments(poster_id);; -CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments(is_orphan);; - -CREATE GENERATOR phpbb_attachments_gen;; -SET GENERATOR phpbb_attachments_gen TO 0;; - -CREATE TRIGGER t_phpbb_attachments FOR phpbb_attachments -BEFORE INSERT -AS -BEGIN - NEW.attach_id = GEN_ID(phpbb_attachments_gen, 1); -END;; - - -# Table: 'phpbb_acl_groups' -CREATE TABLE phpbb_acl_groups ( - group_id INTEGER DEFAULT 0 NOT NULL, - forum_id INTEGER DEFAULT 0 NOT NULL, - auth_option_id INTEGER DEFAULT 0 NOT NULL, - auth_role_id INTEGER DEFAULT 0 NOT NULL, - auth_setting INTEGER DEFAULT 0 NOT NULL -);; - -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_role_id ON phpbb_acl_groups(auth_role_id);; - -# Table: 'phpbb_acl_options' -CREATE TABLE phpbb_acl_options ( - auth_option_id INTEGER NOT NULL, - auth_option VARCHAR(50) CHARACTER SET NONE DEFAULT '' NOT NULL, - is_global INTEGER DEFAULT 0 NOT NULL, - is_local INTEGER DEFAULT 0 NOT NULL, - founder_only INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_acl_options ADD PRIMARY KEY (auth_option_id);; - -CREATE UNIQUE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options(auth_option);; - -CREATE GENERATOR phpbb_acl_options_gen;; -SET GENERATOR phpbb_acl_options_gen TO 0;; - -CREATE TRIGGER t_phpbb_acl_options FOR phpbb_acl_options -BEFORE INSERT -AS -BEGIN - NEW.auth_option_id = GEN_ID(phpbb_acl_options_gen, 1); -END;; - - -# Table: 'phpbb_acl_roles' -CREATE TABLE phpbb_acl_roles ( - role_id INTEGER NOT NULL, - role_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - role_description BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - role_type VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL, - role_order INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_acl_roles ADD PRIMARY KEY (role_id);; - -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 GENERATOR phpbb_acl_roles_gen;; -SET GENERATOR phpbb_acl_roles_gen TO 0;; - -CREATE TRIGGER t_phpbb_acl_roles FOR phpbb_acl_roles -BEFORE INSERT -AS -BEGIN - NEW.role_id = GEN_ID(phpbb_acl_roles_gen, 1); -END;; - - -# Table: 'phpbb_acl_roles_data' -CREATE TABLE phpbb_acl_roles_data ( - role_id INTEGER DEFAULT 0 NOT NULL, - auth_option_id INTEGER DEFAULT 0 NOT NULL, - auth_setting INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_acl_roles_data ADD PRIMARY KEY (role_id, auth_option_id);; - -CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data(auth_option_id);; - -# Table: 'phpbb_acl_users' -CREATE TABLE phpbb_acl_users ( - user_id INTEGER DEFAULT 0 NOT NULL, - forum_id INTEGER DEFAULT 0 NOT NULL, - auth_option_id INTEGER DEFAULT 0 NOT NULL, - auth_role_id INTEGER DEFAULT 0 NOT NULL, - auth_setting INTEGER DEFAULT 0 NOT NULL -);; - -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_role_id ON phpbb_acl_users(auth_role_id);; - -# Table: 'phpbb_banlist' -CREATE TABLE phpbb_banlist ( - ban_id INTEGER NOT NULL, - ban_userid INTEGER DEFAULT 0 NOT NULL, - ban_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, - ban_email VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - ban_start INTEGER DEFAULT 0 NOT NULL, - ban_end INTEGER DEFAULT 0 NOT NULL, - ban_exclude INTEGER DEFAULT 0 NOT NULL, - ban_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - ban_give_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE -);; - -ALTER TABLE phpbb_banlist ADD PRIMARY KEY (ban_id);; - -CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist(ban_end);; -CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist(ban_userid, ban_exclude);; -CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist(ban_email, ban_exclude);; -CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist(ban_ip, ban_exclude);; - -CREATE GENERATOR phpbb_banlist_gen;; -SET GENERATOR phpbb_banlist_gen TO 0;; - -CREATE TRIGGER t_phpbb_banlist FOR phpbb_banlist -BEFORE INSERT -AS -BEGIN - NEW.ban_id = GEN_ID(phpbb_banlist_gen, 1); -END;; - - -# Table: 'phpbb_bbcodes' -CREATE TABLE phpbb_bbcodes ( - bbcode_id INTEGER DEFAULT 0 NOT NULL, - bbcode_tag VARCHAR(16) CHARACTER SET NONE DEFAULT '' NOT NULL, - bbcode_helpline VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - display_on_posting INTEGER DEFAULT 0 NOT NULL, - bbcode_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - bbcode_tpl BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - first_pass_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - first_pass_replace BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - second_pass_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - second_pass_replace BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL -);; - -ALTER TABLE phpbb_bbcodes ADD PRIMARY KEY (bbcode_id);; - -CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes(display_on_posting);; - -# Table: 'phpbb_bookmarks' -CREATE TABLE phpbb_bookmarks ( - topic_id INTEGER DEFAULT 0 NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_bookmarks ADD PRIMARY KEY (topic_id, user_id);; - - -# Table: 'phpbb_bots' -CREATE TABLE phpbb_bots ( - bot_id INTEGER NOT NULL, - bot_active INTEGER DEFAULT 1 NOT NULL, - bot_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - user_id INTEGER DEFAULT 0 NOT NULL, - bot_agent VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - bot_ip VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL -);; - -ALTER TABLE phpbb_bots ADD PRIMARY KEY (bot_id);; - -CREATE INDEX phpbb_bots_bot_active ON phpbb_bots(bot_active);; - -CREATE GENERATOR phpbb_bots_gen;; -SET GENERATOR phpbb_bots_gen TO 0;; - -CREATE TRIGGER t_phpbb_bots FOR phpbb_bots -BEFORE INSERT -AS -BEGIN - NEW.bot_id = GEN_ID(phpbb_bots_gen, 1); -END;; - - -# Table: 'phpbb_config' -CREATE TABLE phpbb_config ( - config_name VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - config_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - is_dynamic INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_config ADD PRIMARY KEY (config_name);; - -CREATE INDEX phpbb_config_is_dynamic ON phpbb_config(is_dynamic);; - -# Table: 'phpbb_config_text' -CREATE TABLE phpbb_config_text ( - config_name VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - config_value BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL -);; - -ALTER TABLE phpbb_config_text ADD PRIMARY KEY (config_name);; - - -# Table: 'phpbb_confirm' -CREATE TABLE phpbb_confirm ( - confirm_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, - session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, - confirm_type INTEGER DEFAULT 0 NOT NULL, - code VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL, - seed INTEGER DEFAULT 0 NOT NULL, - attempts INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_confirm ADD PRIMARY KEY (session_id, confirm_id);; - -CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm(confirm_type);; - -# Table: 'phpbb_disallow' -CREATE TABLE phpbb_disallow ( - disallow_id INTEGER NOT NULL, - disallow_username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE -);; - -ALTER TABLE phpbb_disallow ADD PRIMARY KEY (disallow_id);; - - -CREATE GENERATOR phpbb_disallow_gen;; -SET GENERATOR phpbb_disallow_gen TO 0;; - -CREATE TRIGGER t_phpbb_disallow FOR phpbb_disallow -BEFORE INSERT -AS -BEGIN - NEW.disallow_id = GEN_ID(phpbb_disallow_gen, 1); -END;; - - -# Table: 'phpbb_drafts' -CREATE TABLE phpbb_drafts ( - draft_id INTEGER NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - topic_id INTEGER DEFAULT 0 NOT NULL, - forum_id INTEGER DEFAULT 0 NOT NULL, - save_time INTEGER DEFAULT 0 NOT NULL, - draft_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - draft_message BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL -);; - -ALTER TABLE phpbb_drafts ADD PRIMARY KEY (draft_id);; - -CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts(save_time);; - -CREATE GENERATOR phpbb_drafts_gen;; -SET GENERATOR phpbb_drafts_gen TO 0;; - -CREATE TRIGGER t_phpbb_drafts FOR phpbb_drafts -BEFORE INSERT -AS -BEGIN - NEW.draft_id = GEN_ID(phpbb_drafts_gen, 1); -END;; - - -# Table: 'phpbb_ext' -CREATE TABLE phpbb_ext ( - ext_name VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - ext_active INTEGER DEFAULT 0 NOT NULL, - ext_state BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL -);; - -CREATE UNIQUE INDEX phpbb_ext_ext_name ON phpbb_ext(ext_name);; - -# Table: 'phpbb_extensions' -CREATE TABLE phpbb_extensions ( - extension_id INTEGER NOT NULL, - group_id INTEGER DEFAULT 0 NOT NULL, - extension VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL -);; - -ALTER TABLE phpbb_extensions ADD PRIMARY KEY (extension_id);; - - -CREATE GENERATOR phpbb_extensions_gen;; -SET GENERATOR phpbb_extensions_gen TO 0;; - -CREATE TRIGGER t_phpbb_extensions FOR phpbb_extensions -BEFORE INSERT -AS -BEGIN - NEW.extension_id = GEN_ID(phpbb_extensions_gen, 1); -END;; - - -# Table: 'phpbb_extension_groups' -CREATE TABLE phpbb_extension_groups ( - group_id INTEGER NOT NULL, - group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - cat_id INTEGER DEFAULT 0 NOT NULL, - allow_group INTEGER DEFAULT 0 NOT NULL, - download_mode INTEGER DEFAULT 1 NOT NULL, - upload_icon VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - max_filesize INTEGER DEFAULT 0 NOT NULL, - allowed_forums BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL, - allow_in_pm INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_extension_groups ADD PRIMARY KEY (group_id);; - - -CREATE GENERATOR phpbb_extension_groups_gen;; -SET GENERATOR phpbb_extension_groups_gen TO 0;; - -CREATE TRIGGER t_phpbb_extension_groups FOR phpbb_extension_groups -BEFORE INSERT -AS -BEGIN - NEW.group_id = GEN_ID(phpbb_extension_groups_gen, 1); -END;; - - -# Table: 'phpbb_forums' -CREATE TABLE phpbb_forums ( - forum_id INTEGER NOT NULL, - parent_id INTEGER DEFAULT 0 NOT NULL, - left_id INTEGER DEFAULT 0 NOT NULL, - right_id INTEGER DEFAULT 0 NOT NULL, - forum_parents BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL, - forum_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - forum_desc BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - forum_desc_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - forum_desc_options INTEGER DEFAULT 7 NOT NULL, - forum_desc_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL, - forum_link VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - forum_password VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - forum_style INTEGER DEFAULT 0 NOT NULL, - forum_image VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - forum_rules BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - forum_rules_link VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - forum_rules_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - forum_rules_options INTEGER DEFAULT 7 NOT NULL, - forum_rules_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL, - forum_topics_per_page INTEGER DEFAULT 0 NOT NULL, - forum_type INTEGER DEFAULT 0 NOT NULL, - forum_status INTEGER DEFAULT 0 NOT NULL, - forum_posts_approved INTEGER DEFAULT 0 NOT NULL, - forum_posts_unapproved INTEGER DEFAULT 0 NOT NULL, - forum_posts_softdeleted INTEGER DEFAULT 0 NOT NULL, - forum_topics_approved INTEGER DEFAULT 0 NOT NULL, - forum_topics_unapproved INTEGER DEFAULT 0 NOT NULL, - forum_topics_softdeleted INTEGER DEFAULT 0 NOT NULL, - forum_last_post_id INTEGER DEFAULT 0 NOT NULL, - forum_last_poster_id INTEGER DEFAULT 0 NOT NULL, - forum_last_post_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - forum_last_post_time INTEGER DEFAULT 0 NOT NULL, - forum_last_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - forum_last_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL, - forum_flags INTEGER DEFAULT 32 NOT NULL, - forum_options INTEGER DEFAULT 0 NOT NULL, - display_subforum_list INTEGER DEFAULT 1 NOT NULL, - display_on_index INTEGER DEFAULT 1 NOT NULL, - enable_indexing INTEGER DEFAULT 1 NOT NULL, - enable_icons INTEGER DEFAULT 1 NOT NULL, - enable_prune INTEGER DEFAULT 0 NOT NULL, - prune_next INTEGER DEFAULT 0 NOT NULL, - prune_days INTEGER DEFAULT 0 NOT NULL, - prune_viewed INTEGER DEFAULT 0 NOT NULL, - prune_freq INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_forums ADD PRIMARY KEY (forum_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 GENERATOR phpbb_forums_gen;; -SET GENERATOR phpbb_forums_gen TO 0;; - -CREATE TRIGGER t_phpbb_forums FOR phpbb_forums -BEFORE INSERT -AS -BEGIN - NEW.forum_id = GEN_ID(phpbb_forums_gen, 1); -END;; - - -# Table: 'phpbb_forums_access' -CREATE TABLE phpbb_forums_access ( - forum_id INTEGER DEFAULT 0 NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL -);; - -ALTER TABLE phpbb_forums_access ADD PRIMARY KEY (forum_id, user_id, session_id);; - - -# Table: 'phpbb_forums_track' -CREATE TABLE phpbb_forums_track ( - user_id INTEGER DEFAULT 0 NOT NULL, - forum_id INTEGER DEFAULT 0 NOT NULL, - mark_time INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_forums_track ADD PRIMARY KEY (user_id, forum_id);; - - -# Table: 'phpbb_forums_watch' -CREATE TABLE phpbb_forums_watch ( - forum_id INTEGER DEFAULT 0 NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - notify_status INTEGER DEFAULT 0 NOT NULL -);; - -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_notify_stat ON phpbb_forums_watch(notify_status);; - -# Table: 'phpbb_groups' -CREATE TABLE phpbb_groups ( - group_id INTEGER NOT NULL, - group_type INTEGER DEFAULT 1 NOT NULL, - group_founder_manage INTEGER DEFAULT 0 NOT NULL, - group_skip_auth INTEGER DEFAULT 0 NOT NULL, - group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - group_desc BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - group_desc_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - group_desc_options INTEGER DEFAULT 7 NOT NULL, - group_desc_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL, - group_display INTEGER DEFAULT 0 NOT NULL, - group_avatar VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - group_avatar_type VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - group_avatar_width INTEGER DEFAULT 0 NOT NULL, - group_avatar_height INTEGER DEFAULT 0 NOT NULL, - group_rank INTEGER DEFAULT 0 NOT NULL, - group_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL, - group_sig_chars INTEGER DEFAULT 0 NOT NULL, - group_receive_pm INTEGER DEFAULT 0 NOT NULL, - group_message_limit INTEGER DEFAULT 0 NOT NULL, - group_max_recipients INTEGER DEFAULT 0 NOT NULL, - group_legend INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_groups ADD PRIMARY KEY (group_id);; - -CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups(group_legend, group_name);; - -CREATE GENERATOR phpbb_groups_gen;; -SET GENERATOR phpbb_groups_gen TO 0;; - -CREATE TRIGGER t_phpbb_groups FOR phpbb_groups -BEFORE INSERT -AS -BEGIN - NEW.group_id = GEN_ID(phpbb_groups_gen, 1); -END;; - - -# Table: 'phpbb_icons' -CREATE TABLE phpbb_icons ( - icons_id INTEGER NOT NULL, - icons_url VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - icons_width INTEGER DEFAULT 0 NOT NULL, - icons_height INTEGER DEFAULT 0 NOT NULL, - icons_order INTEGER DEFAULT 0 NOT NULL, - display_on_posting INTEGER DEFAULT 1 NOT NULL -);; - -ALTER TABLE phpbb_icons ADD PRIMARY KEY (icons_id);; - -CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons(display_on_posting);; - -CREATE GENERATOR phpbb_icons_gen;; -SET GENERATOR phpbb_icons_gen TO 0;; - -CREATE TRIGGER t_phpbb_icons FOR phpbb_icons -BEFORE INSERT -AS -BEGIN - NEW.icons_id = GEN_ID(phpbb_icons_gen, 1); -END;; - - -# Table: 'phpbb_lang' -CREATE TABLE phpbb_lang ( - lang_id INTEGER NOT NULL, - lang_iso VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL, - lang_dir VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL, - lang_english_name VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - lang_local_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - lang_author VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE -);; - -ALTER TABLE phpbb_lang ADD PRIMARY KEY (lang_id);; - -CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang(lang_iso);; - -CREATE GENERATOR phpbb_lang_gen;; -SET GENERATOR phpbb_lang_gen TO 0;; - -CREATE TRIGGER t_phpbb_lang FOR phpbb_lang -BEFORE INSERT -AS -BEGIN - NEW.lang_id = GEN_ID(phpbb_lang_gen, 1); -END;; - - -# Table: 'phpbb_log' -CREATE TABLE phpbb_log ( - log_id INTEGER NOT NULL, - log_type INTEGER DEFAULT 0 NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - forum_id INTEGER DEFAULT 0 NOT NULL, - topic_id INTEGER DEFAULT 0 NOT NULL, - reportee_id INTEGER DEFAULT 0 NOT NULL, - log_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, - log_time INTEGER DEFAULT 0 NOT NULL, - log_operation BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - log_data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL -);; - -ALTER TABLE phpbb_log ADD PRIMARY KEY (log_id);; - -CREATE INDEX phpbb_log_log_type ON phpbb_log(log_type);; -CREATE INDEX phpbb_log_log_time ON phpbb_log(log_time);; -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_reportee_id ON phpbb_log(reportee_id);; -CREATE INDEX phpbb_log_user_id ON phpbb_log(user_id);; - -CREATE GENERATOR phpbb_log_gen;; -SET GENERATOR phpbb_log_gen TO 0;; - -CREATE TRIGGER t_phpbb_log FOR phpbb_log -BEFORE INSERT -AS -BEGIN - NEW.log_id = GEN_ID(phpbb_log_gen, 1); -END;; - - -# Table: 'phpbb_login_attempts' -CREATE TABLE phpbb_login_attempts ( - attempt_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, - attempt_browser VARCHAR(150) CHARACTER SET NONE DEFAULT '' NOT NULL, - attempt_forwarded_for VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - attempt_time INTEGER DEFAULT 0 NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - username VARCHAR(255) CHARACTER SET UTF8 DEFAULT 0 NOT NULL COLLATE UNICODE, - username_clean VARCHAR(255) CHARACTER SET UTF8 DEFAULT 0 NOT NULL COLLATE UNICODE -);; - -CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts(attempt_ip, attempt_time);; -CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts(attempt_forwarded_for, attempt_time);; -CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts(attempt_time);; -CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts(user_id);; - -# Table: 'phpbb_moderator_cache' -CREATE TABLE phpbb_moderator_cache ( - forum_id INTEGER DEFAULT 0 NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - group_id INTEGER DEFAULT 0 NOT NULL, - group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - display_on_index INTEGER DEFAULT 1 NOT NULL -);; - -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);; - -# Table: 'phpbb_migrations' -CREATE TABLE phpbb_migrations ( - migration_name VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - migration_depends_on BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL, - migration_schema_done INTEGER DEFAULT 0 NOT NULL, - migration_data_done INTEGER DEFAULT 0 NOT NULL, - migration_data_state BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL, - migration_start_time INTEGER DEFAULT 0 NOT NULL, - migration_end_time INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_migrations ADD PRIMARY KEY (migration_name);; - - -# Table: 'phpbb_modules' -CREATE TABLE phpbb_modules ( - module_id INTEGER NOT NULL, - module_enabled INTEGER DEFAULT 1 NOT NULL, - module_display INTEGER DEFAULT 1 NOT NULL, - module_basename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - module_class VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL, - parent_id INTEGER DEFAULT 0 NOT NULL, - left_id INTEGER DEFAULT 0 NOT NULL, - right_id INTEGER DEFAULT 0 NOT NULL, - module_langname VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - module_mode VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - module_auth VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL -);; - -ALTER TABLE phpbb_modules ADD PRIMARY KEY (module_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_class_left_id ON phpbb_modules(module_class, left_id);; - -CREATE GENERATOR phpbb_modules_gen;; -SET GENERATOR phpbb_modules_gen TO 0;; - -CREATE TRIGGER t_phpbb_modules FOR phpbb_modules -BEFORE INSERT -AS -BEGIN - NEW.module_id = GEN_ID(phpbb_modules_gen, 1); -END;; - - -# Table: 'phpbb_notification_types' -CREATE TABLE phpbb_notification_types ( - notification_type_id INTEGER NOT NULL, - notification_type_name VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - notification_type_enabled INTEGER DEFAULT 1 NOT NULL -);; - -ALTER TABLE phpbb_notification_types ADD PRIMARY KEY (notification_type_id);; - -CREATE UNIQUE INDEX phpbb_notification_types_type ON phpbb_notification_types(notification_type_name);; - -CREATE GENERATOR phpbb_notification_types_gen;; -SET GENERATOR phpbb_notification_types_gen TO 0;; - -CREATE TRIGGER t_phpbb_notification_types FOR phpbb_notification_types -BEFORE INSERT -AS -BEGIN - NEW.notification_type_id = GEN_ID(phpbb_notification_types_gen, 1); -END;; - - -# Table: 'phpbb_notifications' -CREATE TABLE phpbb_notifications ( - notification_id INTEGER NOT NULL, - notification_type_id INTEGER DEFAULT 0 NOT NULL, - item_id INTEGER DEFAULT 0 NOT NULL, - item_parent_id INTEGER DEFAULT 0 NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - notification_read INTEGER DEFAULT 0 NOT NULL, - notification_time INTEGER DEFAULT 1 NOT NULL, - notification_data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL -);; - -ALTER TABLE phpbb_notifications ADD PRIMARY KEY (notification_id);; - -CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications(notification_type_id, item_id);; -CREATE INDEX phpbb_notifications_user ON phpbb_notifications(user_id, notification_read);; - -CREATE GENERATOR phpbb_notifications_gen;; -SET GENERATOR phpbb_notifications_gen TO 0;; - -CREATE TRIGGER t_phpbb_notifications FOR phpbb_notifications -BEFORE INSERT -AS -BEGIN - NEW.notification_id = GEN_ID(phpbb_notifications_gen, 1); -END;; - - -# Table: 'phpbb_oauth_accounts' -CREATE TABLE phpbb_oauth_accounts ( - user_id INTEGER DEFAULT 0 NOT NULL, - provider VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - oauth_provider_id BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL -);; - -ALTER TABLE phpbb_oauth_accounts ADD PRIMARY KEY (user_id, provider);; - - -# Table: 'phpbb_oauth_tokens' -CREATE TABLE phpbb_oauth_tokens ( - user_id INTEGER DEFAULT 0 NOT NULL, - session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, - provider VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - oauth_token BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL -);; - -CREATE INDEX phpbb_oauth_tokens_user_id ON phpbb_oauth_tokens(user_id);; -CREATE INDEX phpbb_oauth_tokens_provider ON phpbb_oauth_tokens(provider);; - -# Table: 'phpbb_poll_options' -CREATE TABLE phpbb_poll_options ( - poll_option_id INTEGER DEFAULT 0 NOT NULL, - topic_id INTEGER DEFAULT 0 NOT NULL, - poll_option_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - poll_option_total INTEGER DEFAULT 0 NOT NULL -);; - -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);; - -# Table: 'phpbb_poll_votes' -CREATE TABLE phpbb_poll_votes ( - topic_id INTEGER DEFAULT 0 NOT NULL, - poll_option_id INTEGER DEFAULT 0 NOT NULL, - vote_user_id INTEGER DEFAULT 0 NOT NULL, - vote_user_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL -);; - -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_ip ON phpbb_poll_votes(vote_user_ip);; - -# Table: 'phpbb_posts' -CREATE TABLE phpbb_posts ( - post_id INTEGER NOT NULL, - topic_id INTEGER DEFAULT 0 NOT NULL, - forum_id INTEGER DEFAULT 0 NOT NULL, - poster_id INTEGER DEFAULT 0 NOT NULL, - icon_id INTEGER DEFAULT 0 NOT NULL, - poster_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, - post_time INTEGER DEFAULT 0 NOT NULL, - post_visibility INTEGER DEFAULT 0 NOT NULL, - post_reported INTEGER DEFAULT 0 NOT NULL, - enable_bbcode INTEGER DEFAULT 1 NOT NULL, - enable_smilies INTEGER DEFAULT 1 NOT NULL, - enable_magic_url INTEGER DEFAULT 1 NOT NULL, - enable_sig INTEGER DEFAULT 1 NOT NULL, - post_username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - post_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - post_checksum VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, - post_attachment INTEGER DEFAULT 0 NOT NULL, - bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL, - post_postcount INTEGER DEFAULT 1 NOT NULL, - post_edit_time INTEGER DEFAULT 0 NOT NULL, - post_edit_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - post_edit_user INTEGER DEFAULT 0 NOT NULL, - post_edit_count INTEGER DEFAULT 0 NOT NULL, - post_edit_locked INTEGER DEFAULT 0 NOT NULL, - post_delete_time INTEGER DEFAULT 0 NOT NULL, - post_delete_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - post_delete_user INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_posts ADD PRIMARY KEY (post_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_poster_ip ON phpbb_posts(poster_ip);; -CREATE INDEX phpbb_posts_poster_id ON phpbb_posts(poster_id);; -CREATE INDEX phpbb_posts_post_visibility ON phpbb_posts(post_visibility);; -CREATE INDEX phpbb_posts_post_username ON phpbb_posts(post_username);; -CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts(topic_id, post_time);; - -CREATE GENERATOR phpbb_posts_gen;; -SET GENERATOR phpbb_posts_gen TO 0;; - -CREATE TRIGGER t_phpbb_posts FOR phpbb_posts -BEFORE INSERT -AS -BEGIN - NEW.post_id = GEN_ID(phpbb_posts_gen, 1); -END;; - - -# Table: 'phpbb_privmsgs' -CREATE TABLE phpbb_privmsgs ( - msg_id INTEGER NOT NULL, - root_level INTEGER DEFAULT 0 NOT NULL, - author_id INTEGER DEFAULT 0 NOT NULL, - icon_id INTEGER DEFAULT 0 NOT NULL, - author_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, - message_time INTEGER DEFAULT 0 NOT NULL, - enable_bbcode INTEGER DEFAULT 1 NOT NULL, - enable_smilies INTEGER DEFAULT 1 NOT NULL, - enable_magic_url INTEGER DEFAULT 1 NOT NULL, - enable_sig INTEGER DEFAULT 1 NOT NULL, - message_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - message_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - message_edit_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - message_edit_user INTEGER DEFAULT 0 NOT NULL, - message_attachment INTEGER DEFAULT 0 NOT NULL, - bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL, - message_edit_time INTEGER DEFAULT 0 NOT NULL, - message_edit_count INTEGER DEFAULT 0 NOT NULL, - to_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - bcc_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - message_reported INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_privmsgs ADD PRIMARY KEY (msg_id);; - -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_author_id ON phpbb_privmsgs(author_id);; -CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs(root_level);; - -CREATE GENERATOR phpbb_privmsgs_gen;; -SET GENERATOR phpbb_privmsgs_gen TO 0;; - -CREATE TRIGGER t_phpbb_privmsgs FOR phpbb_privmsgs -BEFORE INSERT -AS -BEGIN - NEW.msg_id = GEN_ID(phpbb_privmsgs_gen, 1); -END;; - - -# Table: 'phpbb_privmsgs_folder' -CREATE TABLE phpbb_privmsgs_folder ( - folder_id INTEGER NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - folder_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - pm_count INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_privmsgs_folder ADD PRIMARY KEY (folder_id);; - -CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder(user_id);; - -CREATE GENERATOR phpbb_privmsgs_folder_gen;; -SET GENERATOR phpbb_privmsgs_folder_gen TO 0;; - -CREATE TRIGGER t_phpbb_privmsgs_folder FOR phpbb_privmsgs_folder -BEFORE INSERT -AS -BEGIN - NEW.folder_id = GEN_ID(phpbb_privmsgs_folder_gen, 1); -END;; - - -# Table: 'phpbb_privmsgs_rules' -CREATE TABLE phpbb_privmsgs_rules ( - rule_id INTEGER NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - rule_check INTEGER DEFAULT 0 NOT NULL, - rule_connection INTEGER DEFAULT 0 NOT NULL, - rule_string VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - rule_user_id INTEGER DEFAULT 0 NOT NULL, - rule_group_id INTEGER DEFAULT 0 NOT NULL, - rule_action INTEGER DEFAULT 0 NOT NULL, - rule_folder_id INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_privmsgs_rules ADD PRIMARY KEY (rule_id);; - -CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules(user_id);; - -CREATE GENERATOR phpbb_privmsgs_rules_gen;; -SET GENERATOR phpbb_privmsgs_rules_gen TO 0;; - -CREATE TRIGGER t_phpbb_privmsgs_rules FOR phpbb_privmsgs_rules -BEFORE INSERT -AS -BEGIN - NEW.rule_id = GEN_ID(phpbb_privmsgs_rules_gen, 1); -END;; - - -# Table: 'phpbb_privmsgs_to' -CREATE TABLE phpbb_privmsgs_to ( - msg_id INTEGER DEFAULT 0 NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - author_id INTEGER DEFAULT 0 NOT NULL, - pm_deleted INTEGER DEFAULT 0 NOT NULL, - pm_new INTEGER DEFAULT 1 NOT NULL, - pm_unread INTEGER DEFAULT 1 NOT NULL, - pm_replied INTEGER DEFAULT 0 NOT NULL, - pm_marked INTEGER DEFAULT 0 NOT NULL, - pm_forwarded INTEGER DEFAULT 0 NOT NULL, - folder_id INTEGER DEFAULT 0 NOT NULL -);; - -CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to(msg_id);; -CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to(author_id);; -CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to(user_id, folder_id);; - -# Table: 'phpbb_profile_fields' -CREATE TABLE phpbb_profile_fields ( - field_id INTEGER NOT NULL, - field_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - field_type VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL, - field_ident VARCHAR(20) CHARACTER SET NONE DEFAULT '' NOT NULL, - field_length VARCHAR(20) CHARACTER SET NONE DEFAULT '' NOT NULL, - field_minlen VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - field_maxlen VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - field_novalue VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - field_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - field_validation VARCHAR(20) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - field_required INTEGER DEFAULT 0 NOT NULL, - field_show_novalue INTEGER DEFAULT 0 NOT NULL, - field_show_on_reg INTEGER DEFAULT 0 NOT NULL, - field_show_on_pm INTEGER DEFAULT 0 NOT NULL, - field_show_on_vt INTEGER DEFAULT 0 NOT NULL, - field_show_on_ml INTEGER DEFAULT 0 NOT NULL, - field_show_profile INTEGER DEFAULT 0 NOT NULL, - field_hide INTEGER DEFAULT 0 NOT NULL, - field_no_view INTEGER DEFAULT 0 NOT NULL, - field_active INTEGER DEFAULT 0 NOT NULL, - field_order INTEGER DEFAULT 0 NOT NULL, - field_is_contact INTEGER DEFAULT 0 NOT NULL, - field_contact_desc VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - field_contact_url VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL -);; - -ALTER TABLE phpbb_profile_fields ADD PRIMARY KEY (field_id);; - -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 GENERATOR phpbb_profile_fields_gen;; -SET GENERATOR phpbb_profile_fields_gen TO 0;; - -CREATE TRIGGER t_phpbb_profile_fields FOR phpbb_profile_fields -BEFORE INSERT -AS -BEGIN - NEW.field_id = GEN_ID(phpbb_profile_fields_gen, 1); -END;; - - -# Table: 'phpbb_profile_fields_data' -CREATE TABLE phpbb_profile_fields_data ( - user_id INTEGER DEFAULT 0 NOT NULL, - pf_phpbb_location VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - pf_phpbb_interests BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - pf_phpbb_occupation BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - pf_phpbb_icq VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - pf_phpbb_aol VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - pf_phpbb_wlm VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - pf_phpbb_yahoo VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - pf_phpbb_website VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL -);; - -ALTER TABLE phpbb_profile_fields_data ADD PRIMARY KEY (user_id);; - - -# Table: 'phpbb_profile_fields_lang' -CREATE TABLE phpbb_profile_fields_lang ( - field_id INTEGER DEFAULT 0 NOT NULL, - lang_id INTEGER DEFAULT 0 NOT NULL, - option_id INTEGER DEFAULT 0 NOT NULL, - field_type VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL, - lang_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE -);; - -ALTER TABLE phpbb_profile_fields_lang ADD PRIMARY KEY (field_id, lang_id, option_id);; - - -# Table: 'phpbb_profile_lang' -CREATE TABLE phpbb_profile_lang ( - field_id INTEGER DEFAULT 0 NOT NULL, - lang_id INTEGER DEFAULT 0 NOT NULL, - lang_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - lang_explain BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - lang_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE -);; - -ALTER TABLE phpbb_profile_lang ADD PRIMARY KEY (field_id, lang_id);; - - -# Table: 'phpbb_ranks' -CREATE TABLE phpbb_ranks ( - rank_id INTEGER NOT NULL, - rank_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - rank_min INTEGER DEFAULT 0 NOT NULL, - rank_special INTEGER DEFAULT 0 NOT NULL, - rank_image VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL -);; - -ALTER TABLE phpbb_ranks ADD PRIMARY KEY (rank_id);; - - -CREATE GENERATOR phpbb_ranks_gen;; -SET GENERATOR phpbb_ranks_gen TO 0;; - -CREATE TRIGGER t_phpbb_ranks FOR phpbb_ranks -BEFORE INSERT -AS -BEGIN - NEW.rank_id = GEN_ID(phpbb_ranks_gen, 1); -END;; - - -# Table: 'phpbb_reports' -CREATE TABLE phpbb_reports ( - report_id INTEGER NOT NULL, - reason_id INTEGER DEFAULT 0 NOT NULL, - post_id INTEGER DEFAULT 0 NOT NULL, - pm_id INTEGER DEFAULT 0 NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - user_notify INTEGER DEFAULT 0 NOT NULL, - report_closed INTEGER DEFAULT 0 NOT NULL, - report_time INTEGER DEFAULT 0 NOT NULL, - report_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - reported_post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - reported_post_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL, - reported_post_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - reported_post_enable_magic_url INTEGER DEFAULT 1 NOT NULL, - reported_post_enable_smilies INTEGER DEFAULT 1 NOT NULL, - reported_post_enable_bbcode INTEGER DEFAULT 1 NOT NULL -);; - -ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);; - -CREATE INDEX phpbb_reports_post_id ON phpbb_reports(post_id);; -CREATE INDEX phpbb_reports_pm_id ON phpbb_reports(pm_id);; - -CREATE GENERATOR phpbb_reports_gen;; -SET GENERATOR phpbb_reports_gen TO 0;; - -CREATE TRIGGER t_phpbb_reports FOR phpbb_reports -BEFORE INSERT -AS -BEGIN - NEW.report_id = GEN_ID(phpbb_reports_gen, 1); -END;; - - -# Table: 'phpbb_reports_reasons' -CREATE TABLE phpbb_reports_reasons ( - reason_id INTEGER NOT NULL, - reason_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - reason_description BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - reason_order INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_reports_reasons ADD PRIMARY KEY (reason_id);; - - -CREATE GENERATOR phpbb_reports_reasons_gen;; -SET GENERATOR phpbb_reports_reasons_gen TO 0;; - -CREATE TRIGGER t_phpbb_reports_reasons FOR phpbb_reports_reasons -BEFORE INSERT -AS -BEGIN - NEW.reason_id = GEN_ID(phpbb_reports_reasons_gen, 1); -END;; - - -# Table: 'phpbb_search_results' -CREATE TABLE phpbb_search_results ( - search_key VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, - search_time INTEGER DEFAULT 0 NOT NULL, - search_keywords BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - search_authors BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL -);; - -ALTER TABLE phpbb_search_results ADD PRIMARY KEY (search_key);; - - -# Table: 'phpbb_search_wordlist' -CREATE TABLE phpbb_search_wordlist ( - word_id INTEGER NOT NULL, - word_text VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - word_common INTEGER DEFAULT 0 NOT NULL, - word_count INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_search_wordlist ADD PRIMARY KEY (word_id);; - -CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist(word_text);; -CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist(word_count);; - -CREATE GENERATOR phpbb_search_wordlist_gen;; -SET GENERATOR phpbb_search_wordlist_gen TO 0;; - -CREATE TRIGGER t_phpbb_search_wordlist FOR phpbb_search_wordlist -BEFORE INSERT -AS -BEGIN - NEW.word_id = GEN_ID(phpbb_search_wordlist_gen, 1); -END;; - - -# Table: 'phpbb_search_wordmatch' -CREATE TABLE phpbb_search_wordmatch ( - post_id INTEGER DEFAULT 0 NOT NULL, - word_id INTEGER DEFAULT 0 NOT NULL, - title_match INTEGER DEFAULT 0 NOT NULL -);; - -CREATE UNIQUE INDEX phpbb_search_wordmatch_unq_mtch ON phpbb_search_wordmatch(word_id, post_id, title_match);; -CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch(word_id);; -CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch(post_id);; - -# Table: 'phpbb_sessions' -CREATE TABLE phpbb_sessions ( - session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, - session_user_id INTEGER DEFAULT 0 NOT NULL, - session_forum_id INTEGER DEFAULT 0 NOT NULL, - session_last_visit INTEGER DEFAULT 0 NOT NULL, - session_start INTEGER DEFAULT 0 NOT NULL, - session_time INTEGER DEFAULT 0 NOT NULL, - session_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, - session_browser VARCHAR(150) CHARACTER SET NONE DEFAULT '' NOT NULL, - session_forwarded_for VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - session_page VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - session_viewonline INTEGER DEFAULT 1 NOT NULL, - session_autologin INTEGER DEFAULT 0 NOT NULL, - session_admin INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_sessions ADD PRIMARY KEY (session_id);; - -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_fid ON phpbb_sessions(session_forum_id);; - -# Table: 'phpbb_sessions_keys' -CREATE TABLE phpbb_sessions_keys ( - key_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - last_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, - last_login INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_sessions_keys ADD PRIMARY KEY (key_id, user_id);; - -CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys(last_login);; - -# Table: 'phpbb_sitelist' -CREATE TABLE phpbb_sitelist ( - site_id INTEGER NOT NULL, - site_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, - site_hostname VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - ip_exclude INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_sitelist ADD PRIMARY KEY (site_id);; - - -CREATE GENERATOR phpbb_sitelist_gen;; -SET GENERATOR phpbb_sitelist_gen TO 0;; - -CREATE TRIGGER t_phpbb_sitelist FOR phpbb_sitelist -BEFORE INSERT -AS -BEGIN - NEW.site_id = GEN_ID(phpbb_sitelist_gen, 1); -END;; - - -# Table: 'phpbb_smilies' -CREATE TABLE phpbb_smilies ( - smiley_id INTEGER NOT NULL, - code VARCHAR(50) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - emotion VARCHAR(50) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - smiley_url VARCHAR(50) CHARACTER SET NONE DEFAULT '' NOT NULL, - smiley_width INTEGER DEFAULT 0 NOT NULL, - smiley_height INTEGER DEFAULT 0 NOT NULL, - smiley_order INTEGER DEFAULT 0 NOT NULL, - display_on_posting INTEGER DEFAULT 1 NOT NULL -);; - -ALTER TABLE phpbb_smilies ADD PRIMARY KEY (smiley_id);; - -CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies(display_on_posting);; - -CREATE GENERATOR phpbb_smilies_gen;; -SET GENERATOR phpbb_smilies_gen TO 0;; - -CREATE TRIGGER t_phpbb_smilies FOR phpbb_smilies -BEFORE INSERT -AS -BEGIN - NEW.smiley_id = GEN_ID(phpbb_smilies_gen, 1); -END;; - - -# Table: 'phpbb_styles' -CREATE TABLE phpbb_styles ( - style_id INTEGER NOT NULL, - style_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - style_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - style_active INTEGER DEFAULT 1 NOT NULL, - style_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL, - bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT 'kNg=' NOT NULL, - style_parent_id INTEGER DEFAULT 0 NOT NULL, - style_parent_tree BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL -);; - -ALTER TABLE phpbb_styles ADD PRIMARY KEY (style_id);; - -CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles(style_name);; - -CREATE GENERATOR phpbb_styles_gen;; -SET GENERATOR phpbb_styles_gen TO 0;; - -CREATE TRIGGER t_phpbb_styles FOR phpbb_styles -BEFORE INSERT -AS -BEGIN - NEW.style_id = GEN_ID(phpbb_styles_gen, 1); -END;; - - -# Table: 'phpbb_teampage' -CREATE TABLE phpbb_teampage ( - teampage_id INTEGER NOT NULL, - group_id INTEGER DEFAULT 0 NOT NULL, - teampage_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - teampage_position INTEGER DEFAULT 0 NOT NULL, - teampage_parent INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_teampage ADD PRIMARY KEY (teampage_id);; - - -CREATE GENERATOR phpbb_teampage_gen;; -SET GENERATOR phpbb_teampage_gen TO 0;; - -CREATE TRIGGER t_phpbb_teampage FOR phpbb_teampage -BEFORE INSERT -AS -BEGIN - NEW.teampage_id = GEN_ID(phpbb_teampage_gen, 1); -END;; - - -# Table: 'phpbb_topics' -CREATE TABLE phpbb_topics ( - topic_id INTEGER NOT NULL, - forum_id INTEGER DEFAULT 0 NOT NULL, - icon_id INTEGER DEFAULT 0 NOT NULL, - topic_attachment INTEGER DEFAULT 0 NOT NULL, - topic_visibility INTEGER DEFAULT 0 NOT NULL, - topic_reported INTEGER DEFAULT 0 NOT NULL, - topic_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - topic_poster INTEGER DEFAULT 0 NOT NULL, - topic_time INTEGER DEFAULT 0 NOT NULL, - topic_time_limit INTEGER DEFAULT 0 NOT NULL, - topic_views INTEGER DEFAULT 0 NOT NULL, - topic_posts_approved INTEGER DEFAULT 0 NOT NULL, - topic_posts_unapproved INTEGER DEFAULT 0 NOT NULL, - topic_posts_softdeleted INTEGER DEFAULT 0 NOT NULL, - topic_status INTEGER DEFAULT 0 NOT NULL, - topic_type INTEGER DEFAULT 0 NOT NULL, - topic_first_post_id INTEGER DEFAULT 0 NOT NULL, - topic_first_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - topic_first_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL, - topic_last_post_id INTEGER DEFAULT 0 NOT NULL, - topic_last_poster_id INTEGER DEFAULT 0 NOT NULL, - topic_last_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - topic_last_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL, - topic_last_post_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - topic_last_post_time INTEGER DEFAULT 0 NOT NULL, - topic_last_view_time INTEGER DEFAULT 0 NOT NULL, - topic_moved_id INTEGER DEFAULT 0 NOT NULL, - topic_bumped INTEGER DEFAULT 0 NOT NULL, - topic_bumper INTEGER DEFAULT 0 NOT NULL, - poll_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - poll_start INTEGER DEFAULT 0 NOT NULL, - poll_length INTEGER DEFAULT 0 NOT NULL, - poll_max_options INTEGER DEFAULT 1 NOT NULL, - poll_last_vote INTEGER DEFAULT 0 NOT NULL, - poll_vote_change INTEGER DEFAULT 0 NOT NULL, - topic_delete_time INTEGER DEFAULT 0 NOT NULL, - topic_delete_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - topic_delete_user INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_topics ADD PRIMARY KEY (topic_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_last_post_time ON phpbb_topics(topic_last_post_time);; -CREATE INDEX phpbb_topics_topic_visibility ON phpbb_topics(topic_visibility);; -CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics(forum_id, topic_visibility, topic_last_post_id);; -CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics(forum_id, topic_last_post_time, topic_moved_id);; - -CREATE GENERATOR phpbb_topics_gen;; -SET GENERATOR phpbb_topics_gen TO 0;; - -CREATE TRIGGER t_phpbb_topics FOR phpbb_topics -BEFORE INSERT -AS -BEGIN - NEW.topic_id = GEN_ID(phpbb_topics_gen, 1); -END;; - - -# Table: 'phpbb_topics_track' -CREATE TABLE phpbb_topics_track ( - user_id INTEGER DEFAULT 0 NOT NULL, - topic_id INTEGER DEFAULT 0 NOT NULL, - forum_id INTEGER DEFAULT 0 NOT NULL, - mark_time INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_topics_track ADD PRIMARY KEY (user_id, topic_id);; - -CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track(topic_id);; -CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track(forum_id);; - -# Table: 'phpbb_topics_posted' -CREATE TABLE phpbb_topics_posted ( - user_id INTEGER DEFAULT 0 NOT NULL, - topic_id INTEGER DEFAULT 0 NOT NULL, - topic_posted INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_topics_posted ADD PRIMARY KEY (user_id, topic_id);; - - -# Table: 'phpbb_topics_watch' -CREATE TABLE phpbb_topics_watch ( - topic_id INTEGER DEFAULT 0 NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - notify_status INTEGER DEFAULT 0 NOT NULL -);; - -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_notify_stat ON phpbb_topics_watch(notify_status);; - -# Table: 'phpbb_user_notifications' -CREATE TABLE phpbb_user_notifications ( - item_type VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - item_id INTEGER DEFAULT 0 NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - method VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - notify INTEGER DEFAULT 1 NOT NULL -);; - - -# Table: 'phpbb_user_group' -CREATE TABLE phpbb_user_group ( - group_id INTEGER DEFAULT 0 NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - group_leader INTEGER DEFAULT 0 NOT NULL, - user_pending INTEGER DEFAULT 1 NOT NULL -);; - -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_group_leader ON phpbb_user_group(group_leader);; - -# Table: 'phpbb_users' -CREATE TABLE phpbb_users ( - user_id INTEGER NOT NULL, - user_type INTEGER DEFAULT 0 NOT NULL, - group_id INTEGER DEFAULT 3 NOT NULL, - user_permissions BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL, - user_perm_from INTEGER DEFAULT 0 NOT NULL, - user_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, - user_regdate INTEGER DEFAULT 0 NOT NULL, - username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - username_clean VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - user_password VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - user_passchg INTEGER DEFAULT 0 NOT NULL, - user_pass_convert INTEGER DEFAULT 0 NOT NULL, - user_actkey VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, - user_newpasswd VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - user_email VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - user_email_hash DOUBLE PRECISION DEFAULT 0 NOT NULL, - user_birthday VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL, - user_lastvisit INTEGER DEFAULT 0 NOT NULL, - user_lastmark INTEGER DEFAULT 0 NOT NULL, - user_lastpost_time INTEGER DEFAULT 0 NOT NULL, - user_lastpage VARCHAR(200) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - user_last_confirm_key VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL, - user_last_search INTEGER DEFAULT 0 NOT NULL, - user_warnings INTEGER DEFAULT 0 NOT NULL, - user_last_warning INTEGER DEFAULT 0 NOT NULL, - user_login_attempts INTEGER DEFAULT 0 NOT NULL, - user_inactive_reason INTEGER DEFAULT 0 NOT NULL, - user_inactive_time INTEGER DEFAULT 0 NOT NULL, - user_posts INTEGER DEFAULT 0 NOT NULL, - user_lang VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL, - user_timezone VARCHAR(100) CHARACTER SET NONE DEFAULT 'UTC' NOT NULL, - user_dateformat VARCHAR(30) CHARACTER SET UTF8 DEFAULT 'd M Y H:i' NOT NULL COLLATE UNICODE, - user_style INTEGER DEFAULT 0 NOT NULL, - user_rank INTEGER DEFAULT 0 NOT NULL, - user_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL, - user_new_privmsg INTEGER DEFAULT 0 NOT NULL, - user_unread_privmsg INTEGER DEFAULT 0 NOT NULL, - user_last_privmsg INTEGER DEFAULT 0 NOT NULL, - user_message_rules INTEGER DEFAULT 0 NOT NULL, - user_full_folder INTEGER DEFAULT -3 NOT NULL, - user_emailtime INTEGER DEFAULT 0 NOT NULL, - user_topic_show_days INTEGER DEFAULT 0 NOT NULL, - user_topic_sortby_type VARCHAR(1) CHARACTER SET NONE DEFAULT 't' NOT NULL, - user_topic_sortby_dir VARCHAR(1) CHARACTER SET NONE DEFAULT 'd' NOT NULL, - user_post_show_days INTEGER DEFAULT 0 NOT NULL, - user_post_sortby_type VARCHAR(1) CHARACTER SET NONE DEFAULT 't' NOT NULL, - user_post_sortby_dir VARCHAR(1) CHARACTER SET NONE DEFAULT 'a' NOT NULL, - user_notify INTEGER DEFAULT 0 NOT NULL, - user_notify_pm INTEGER DEFAULT 1 NOT NULL, - user_notify_type INTEGER DEFAULT 0 NOT NULL, - user_allow_pm INTEGER DEFAULT 1 NOT NULL, - user_allow_viewonline INTEGER DEFAULT 1 NOT NULL, - user_allow_viewemail INTEGER DEFAULT 1 NOT NULL, - user_allow_massemail INTEGER DEFAULT 1 NOT NULL, - user_options INTEGER DEFAULT 230271 NOT NULL, - user_avatar VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - user_avatar_type VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - user_avatar_width INTEGER DEFAULT 0 NOT NULL, - user_avatar_height INTEGER DEFAULT 0 NOT NULL, - user_sig BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, - user_sig_bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL, - user_sig_bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - user_jabber VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - user_form_salt VARCHAR(32) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - user_new INTEGER DEFAULT 1 NOT NULL, - user_reminded INTEGER DEFAULT 0 NOT NULL, - user_reminded_time INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_users ADD PRIMARY KEY (user_id);; - -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_type ON phpbb_users(user_type);; -CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users(username_clean);; - -CREATE GENERATOR phpbb_users_gen;; -SET GENERATOR phpbb_users_gen TO 0;; - -CREATE TRIGGER t_phpbb_users FOR phpbb_users -BEFORE INSERT -AS -BEGIN - NEW.user_id = GEN_ID(phpbb_users_gen, 1); -END;; - - -# Table: 'phpbb_warnings' -CREATE TABLE phpbb_warnings ( - warning_id INTEGER NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - post_id INTEGER DEFAULT 0 NOT NULL, - log_id INTEGER DEFAULT 0 NOT NULL, - warning_time INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_warnings ADD PRIMARY KEY (warning_id);; - - -CREATE GENERATOR phpbb_warnings_gen;; -SET GENERATOR phpbb_warnings_gen TO 0;; - -CREATE TRIGGER t_phpbb_warnings FOR phpbb_warnings -BEFORE INSERT -AS -BEGIN - NEW.warning_id = GEN_ID(phpbb_warnings_gen, 1); -END;; - - -# Table: 'phpbb_words' -CREATE TABLE phpbb_words ( - word_id INTEGER NOT NULL, - word VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, - replacement VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE -);; - -ALTER TABLE phpbb_words ADD PRIMARY KEY (word_id);; - - -CREATE GENERATOR phpbb_words_gen;; -SET GENERATOR phpbb_words_gen TO 0;; - -CREATE TRIGGER t_phpbb_words FOR phpbb_words -BEFORE INSERT -AS -BEGIN - NEW.word_id = GEN_ID(phpbb_words_gen, 1); -END;; - - -# Table: 'phpbb_zebra' -CREATE TABLE phpbb_zebra ( - user_id INTEGER DEFAULT 0 NOT NULL, - zebra_id INTEGER DEFAULT 0 NOT NULL, - friend INTEGER DEFAULT 0 NOT NULL, - foe INTEGER DEFAULT 0 NOT NULL -);; - -ALTER TABLE phpbb_zebra ADD PRIMARY KEY (user_id, zebra_id);; - - diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index d8d414a4c2..f88513cf0e 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -6,1874 +6,3 @@ * run it. */ -/* - Table: 'phpbb_attachments' -*/ -CREATE TABLE [phpbb_attachments] ( - [attach_id] [int] IDENTITY (1, 1) NOT NULL , - [post_msg_id] [int] DEFAULT (0) NOT NULL , - [topic_id] [int] DEFAULT (0) NOT NULL , - [in_message] [int] DEFAULT (0) NOT NULL , - [poster_id] [int] DEFAULT (0) NOT NULL , - [is_orphan] [int] DEFAULT (1) NOT NULL , - [physical_filename] [varchar] (255) DEFAULT ('') NOT NULL , - [real_filename] [varchar] (255) DEFAULT ('') NOT NULL , - [download_count] [int] DEFAULT (0) NOT NULL , - [attach_comment] [varchar] (4000) DEFAULT ('') NOT NULL , - [extension] [varchar] (100) DEFAULT ('') NOT NULL , - [mimetype] [varchar] (100) DEFAULT ('') NOT NULL , - [filesize] [int] DEFAULT (0) NOT NULL , - [filetime] [int] DEFAULT (0) NOT NULL , - [thumbnail] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_attachments] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_attachments] PRIMARY KEY CLUSTERED - ( - [attach_id] - ) -GO - -CREATE INDEX [filetime] ON [phpbb_attachments]([filetime]) -GO - -CREATE INDEX [post_msg_id] ON [phpbb_attachments]([post_msg_id]) -GO - -CREATE INDEX [topic_id] ON [phpbb_attachments]([topic_id]) -GO - -CREATE INDEX [poster_id] ON [phpbb_attachments]([poster_id]) -GO - -CREATE INDEX [is_orphan] ON [phpbb_attachments]([is_orphan]) -GO - - -/* - Table: 'phpbb_acl_groups' -*/ -CREATE TABLE [phpbb_acl_groups] ( - [group_id] [int] DEFAULT (0) NOT NULL , - [forum_id] [int] DEFAULT (0) NOT NULL , - [auth_option_id] [int] DEFAULT (0) NOT NULL , - [auth_role_id] [int] DEFAULT (0) NOT NULL , - [auth_setting] [int] DEFAULT (0) NOT NULL , - [mssqlindex] [int] IDENTITY (1, 1) NOT NULL -)GO - -ALTER TABLE [phpbb_acl_groups] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_acl_groups] PRIMARY KEY CLUSTERED - ( - [mssqlindex] - ) -GO - -CREATE INDEX [group_id] ON [phpbb_acl_groups]([group_id]) -GO - -CREATE INDEX [auth_opt_id] ON [phpbb_acl_groups]([auth_option_id]) -GO - -CREATE INDEX [auth_role_id] ON [phpbb_acl_groups]([auth_role_id]) -GO - - -/* - Table: 'phpbb_acl_options' -*/ -CREATE TABLE [phpbb_acl_options] ( - [auth_option_id] [int] IDENTITY (1, 1) NOT NULL , - [auth_option] [varchar] (50) DEFAULT ('') NOT NULL , - [is_global] [int] DEFAULT (0) NOT NULL , - [is_local] [int] DEFAULT (0) NOT NULL , - [founder_only] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_acl_options] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_acl_options] PRIMARY KEY CLUSTERED - ( - [auth_option_id] - ) -GO - -CREATE UNIQUE INDEX [auth_option] ON [phpbb_acl_options]([auth_option]) -GO - - -/* - Table: 'phpbb_acl_roles' -*/ -CREATE TABLE [phpbb_acl_roles] ( - [role_id] [int] IDENTITY (1, 1) NOT NULL , - [role_name] [varchar] (255) DEFAULT ('') NOT NULL , - [role_description] [varchar] (4000) DEFAULT ('') NOT NULL , - [role_type] [varchar] (10) DEFAULT ('') NOT NULL , - [role_order] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_acl_roles] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_acl_roles] PRIMARY KEY CLUSTERED - ( - [role_id] - ) -GO - -CREATE INDEX [role_type] ON [phpbb_acl_roles]([role_type]) -GO - -CREATE INDEX [role_order] ON [phpbb_acl_roles]([role_order]) -GO - - -/* - Table: 'phpbb_acl_roles_data' -*/ -CREATE TABLE [phpbb_acl_roles_data] ( - [role_id] [int] DEFAULT (0) NOT NULL , - [auth_option_id] [int] DEFAULT (0) NOT NULL , - [auth_setting] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_acl_roles_data] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_acl_roles_data] PRIMARY KEY CLUSTERED - ( - [role_id], - [auth_option_id] - ) -GO - -CREATE INDEX [ath_op_id] ON [phpbb_acl_roles_data]([auth_option_id]) -GO - - -/* - Table: 'phpbb_acl_users' -*/ -CREATE TABLE [phpbb_acl_users] ( - [user_id] [int] DEFAULT (0) NOT NULL , - [forum_id] [int] DEFAULT (0) NOT NULL , - [auth_option_id] [int] DEFAULT (0) NOT NULL , - [auth_role_id] [int] DEFAULT (0) NOT NULL , - [auth_setting] [int] DEFAULT (0) NOT NULL , - [mssqlindex] [int] IDENTITY (1, 1) NOT NULL -)GO - -ALTER TABLE [phpbb_acl_users] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_acl_users] PRIMARY KEY CLUSTERED - ( - [mssqlindex] - ) -GO - -CREATE INDEX [user_id] ON [phpbb_acl_users]([user_id]) -GO - -CREATE INDEX [auth_option_id] ON [phpbb_acl_users]([auth_option_id]) -GO - -CREATE INDEX [auth_role_id] ON [phpbb_acl_users]([auth_role_id]) -GO - - -/* - Table: 'phpbb_banlist' -*/ -CREATE TABLE [phpbb_banlist] ( - [ban_id] [int] IDENTITY (1, 1) NOT NULL , - [ban_userid] [int] DEFAULT (0) NOT NULL , - [ban_ip] [varchar] (40) DEFAULT ('') NOT NULL , - [ban_email] [varchar] (100) DEFAULT ('') NOT NULL , - [ban_start] [int] DEFAULT (0) NOT NULL , - [ban_end] [int] DEFAULT (0) NOT NULL , - [ban_exclude] [int] DEFAULT (0) NOT NULL , - [ban_reason] [varchar] (255) DEFAULT ('') NOT NULL , - [ban_give_reason] [varchar] (255) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_banlist] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_banlist] PRIMARY KEY CLUSTERED - ( - [ban_id] - ) -GO - -CREATE INDEX [ban_end] ON [phpbb_banlist]([ban_end]) -GO - -CREATE INDEX [ban_user] ON [phpbb_banlist]([ban_userid], [ban_exclude]) -GO - -CREATE INDEX [ban_email] ON [phpbb_banlist]([ban_email], [ban_exclude]) -GO - -CREATE INDEX [ban_ip] ON [phpbb_banlist]([ban_ip], [ban_exclude]) -GO - - -/* - Table: 'phpbb_bbcodes' -*/ -CREATE TABLE [phpbb_bbcodes] ( - [bbcode_id] [int] DEFAULT (0) NOT NULL , - [bbcode_tag] [varchar] (16) DEFAULT ('') NOT NULL , - [bbcode_helpline] [varchar] (255) DEFAULT ('') NOT NULL , - [display_on_posting] [int] DEFAULT (0) NOT NULL , - [bbcode_match] [varchar] (4000) DEFAULT ('') NOT NULL , - [bbcode_tpl] [text] DEFAULT ('') NOT NULL , - [first_pass_match] [text] DEFAULT ('') NOT NULL , - [first_pass_replace] [text] DEFAULT ('') NOT NULL , - [second_pass_match] [text] DEFAULT ('') NOT NULL , - [second_pass_replace] [text] DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_bbcodes] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_bbcodes] PRIMARY KEY CLUSTERED - ( - [bbcode_id] - ) -GO - -CREATE INDEX [display_on_post] ON [phpbb_bbcodes]([display_on_posting]) -GO - - -/* - Table: 'phpbb_bookmarks' -*/ -CREATE TABLE [phpbb_bookmarks] ( - [topic_id] [int] DEFAULT (0) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_bookmarks] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_bookmarks] PRIMARY KEY CLUSTERED - ( - [topic_id], - [user_id] - ) -GO - - -/* - Table: 'phpbb_bots' -*/ -CREATE TABLE [phpbb_bots] ( - [bot_id] [int] IDENTITY (1, 1) NOT NULL , - [bot_active] [int] DEFAULT (1) NOT NULL , - [bot_name] [varchar] (255) DEFAULT ('') NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [bot_agent] [varchar] (255) DEFAULT ('') NOT NULL , - [bot_ip] [varchar] (255) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_bots] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_bots] PRIMARY KEY CLUSTERED - ( - [bot_id] - ) -GO - -CREATE INDEX [bot_active] ON [phpbb_bots]([bot_active]) -GO - - -/* - Table: 'phpbb_config' -*/ -CREATE TABLE [phpbb_config] ( - [config_name] [varchar] (255) DEFAULT ('') NOT NULL , - [config_value] [varchar] (255) DEFAULT ('') NOT NULL , - [is_dynamic] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_config] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_config] PRIMARY KEY CLUSTERED - ( - [config_name] - ) -GO - -CREATE INDEX [is_dynamic] ON [phpbb_config]([is_dynamic]) -GO - - -/* - Table: 'phpbb_config_text' -*/ -CREATE TABLE [phpbb_config_text] ( - [config_name] [varchar] (255) DEFAULT ('') NOT NULL , - [config_value] [text] DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_config_text] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_config_text] PRIMARY KEY CLUSTERED - ( - [config_name] - ) -GO - - -/* - Table: 'phpbb_confirm' -*/ -CREATE TABLE [phpbb_confirm] ( - [confirm_id] [char] (32) DEFAULT ('') NOT NULL , - [session_id] [char] (32) DEFAULT ('') NOT NULL , - [confirm_type] [int] DEFAULT (0) NOT NULL , - [code] [varchar] (8) DEFAULT ('') NOT NULL , - [seed] [int] DEFAULT (0) NOT NULL , - [attempts] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_confirm] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_confirm] PRIMARY KEY CLUSTERED - ( - [session_id], - [confirm_id] - ) -GO - -CREATE INDEX [confirm_type] ON [phpbb_confirm]([confirm_type]) -GO - - -/* - Table: 'phpbb_disallow' -*/ -CREATE TABLE [phpbb_disallow] ( - [disallow_id] [int] IDENTITY (1, 1) NOT NULL , - [disallow_username] [varchar] (255) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_disallow] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_disallow] PRIMARY KEY CLUSTERED - ( - [disallow_id] - ) -GO - - -/* - Table: 'phpbb_drafts' -*/ -CREATE TABLE [phpbb_drafts] ( - [draft_id] [int] IDENTITY (1, 1) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [topic_id] [int] DEFAULT (0) NOT NULL , - [forum_id] [int] DEFAULT (0) NOT NULL , - [save_time] [int] DEFAULT (0) NOT NULL , - [draft_subject] [varchar] (255) DEFAULT ('') NOT NULL , - [draft_message] [text] DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_drafts] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_drafts] PRIMARY KEY CLUSTERED - ( - [draft_id] - ) -GO - -CREATE INDEX [save_time] ON [phpbb_drafts]([save_time]) -GO - - -/* - Table: 'phpbb_ext' -*/ -CREATE TABLE [phpbb_ext] ( - [ext_name] [varchar] (255) DEFAULT ('') NOT NULL , - [ext_active] [int] DEFAULT (0) NOT NULL , - [ext_state] [varchar] (8000) DEFAULT ('') NOT NULL , - [mssqlindex] [int] IDENTITY (1, 1) NOT NULL -)GO - -ALTER TABLE [phpbb_ext] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_ext] PRIMARY KEY CLUSTERED - ( - [mssqlindex] - ) -GO - -CREATE UNIQUE INDEX [ext_name] ON [phpbb_ext]([ext_name]) -GO - - -/* - Table: 'phpbb_extensions' -*/ -CREATE TABLE [phpbb_extensions] ( - [extension_id] [int] IDENTITY (1, 1) NOT NULL , - [group_id] [int] DEFAULT (0) NOT NULL , - [extension] [varchar] (100) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_extensions] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_extensions] PRIMARY KEY CLUSTERED - ( - [extension_id] - ) -GO - - -/* - Table: 'phpbb_extension_groups' -*/ -CREATE TABLE [phpbb_extension_groups] ( - [group_id] [int] IDENTITY (1, 1) NOT NULL , - [group_name] [varchar] (255) DEFAULT ('') NOT NULL , - [cat_id] [int] DEFAULT (0) NOT NULL , - [allow_group] [int] DEFAULT (0) NOT NULL , - [download_mode] [int] DEFAULT (1) NOT NULL , - [upload_icon] [varchar] (255) DEFAULT ('') NOT NULL , - [max_filesize] [int] DEFAULT (0) NOT NULL , - [allowed_forums] [varchar] (8000) DEFAULT ('') NOT NULL , - [allow_in_pm] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_extension_groups] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_extension_groups] PRIMARY KEY CLUSTERED - ( - [group_id] - ) -GO - - -/* - Table: 'phpbb_forums' -*/ -CREATE TABLE [phpbb_forums] ( - [forum_id] [int] IDENTITY (1, 1) NOT NULL , - [parent_id] [int] DEFAULT (0) NOT NULL , - [left_id] [int] DEFAULT (0) NOT NULL , - [right_id] [int] DEFAULT (0) NOT NULL , - [forum_parents] [text] DEFAULT ('') NOT NULL , - [forum_name] [varchar] (255) DEFAULT ('') NOT NULL , - [forum_desc] [varchar] (4000) DEFAULT ('') NOT NULL , - [forum_desc_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , - [forum_desc_options] [int] DEFAULT (7) NOT NULL , - [forum_desc_uid] [varchar] (8) DEFAULT ('') NOT NULL , - [forum_link] [varchar] (255) DEFAULT ('') NOT NULL , - [forum_password] [varchar] (255) DEFAULT ('') NOT NULL , - [forum_style] [int] DEFAULT (0) NOT NULL , - [forum_image] [varchar] (255) DEFAULT ('') NOT NULL , - [forum_rules] [varchar] (4000) DEFAULT ('') NOT NULL , - [forum_rules_link] [varchar] (255) DEFAULT ('') NOT NULL , - [forum_rules_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , - [forum_rules_options] [int] DEFAULT (7) NOT NULL , - [forum_rules_uid] [varchar] (8) DEFAULT ('') NOT NULL , - [forum_topics_per_page] [int] DEFAULT (0) NOT NULL , - [forum_type] [int] DEFAULT (0) NOT NULL , - [forum_status] [int] DEFAULT (0) NOT NULL , - [forum_posts_approved] [int] DEFAULT (0) NOT NULL , - [forum_posts_unapproved] [int] DEFAULT (0) NOT NULL , - [forum_posts_softdeleted] [int] DEFAULT (0) NOT NULL , - [forum_topics_approved] [int] DEFAULT (0) NOT NULL , - [forum_topics_unapproved] [int] DEFAULT (0) NOT NULL , - [forum_topics_softdeleted] [int] DEFAULT (0) NOT NULL , - [forum_last_post_id] [int] DEFAULT (0) NOT NULL , - [forum_last_poster_id] [int] DEFAULT (0) NOT NULL , - [forum_last_post_subject] [varchar] (255) DEFAULT ('') NOT NULL , - [forum_last_post_time] [int] DEFAULT (0) NOT NULL , - [forum_last_poster_name] [varchar] (255) DEFAULT ('') NOT NULL , - [forum_last_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL , - [forum_flags] [int] DEFAULT (32) NOT NULL , - [forum_options] [int] DEFAULT (0) NOT NULL , - [display_subforum_list] [int] DEFAULT (1) NOT NULL , - [display_on_index] [int] DEFAULT (1) NOT NULL , - [enable_indexing] [int] DEFAULT (1) NOT NULL , - [enable_icons] [int] DEFAULT (1) NOT NULL , - [enable_prune] [int] DEFAULT (0) NOT NULL , - [prune_next] [int] DEFAULT (0) NOT NULL , - [prune_days] [int] DEFAULT (0) NOT NULL , - [prune_viewed] [int] DEFAULT (0) NOT NULL , - [prune_freq] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_forums] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_forums] PRIMARY KEY CLUSTERED - ( - [forum_id] - ) -GO - -CREATE INDEX [left_right_id] ON [phpbb_forums]([left_id], [right_id]) -GO - -CREATE INDEX [forum_lastpost_id] ON [phpbb_forums]([forum_last_post_id]) -GO - - -/* - Table: 'phpbb_forums_access' -*/ -CREATE TABLE [phpbb_forums_access] ( - [forum_id] [int] DEFAULT (0) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [session_id] [char] (32) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_forums_access] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_forums_access] PRIMARY KEY CLUSTERED - ( - [forum_id], - [user_id], - [session_id] - ) -GO - - -/* - Table: 'phpbb_forums_track' -*/ -CREATE TABLE [phpbb_forums_track] ( - [user_id] [int] DEFAULT (0) NOT NULL , - [forum_id] [int] DEFAULT (0) NOT NULL , - [mark_time] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_forums_track] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_forums_track] PRIMARY KEY CLUSTERED - ( - [user_id], - [forum_id] - ) -GO - - -/* - Table: 'phpbb_forums_watch' -*/ -CREATE TABLE [phpbb_forums_watch] ( - [forum_id] [int] DEFAULT (0) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [notify_status] [int] DEFAULT (0) NOT NULL , - [mssqlindex] [int] IDENTITY (1, 1) NOT NULL -)GO - -ALTER TABLE [phpbb_forums_watch] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_forums_watch] PRIMARY KEY CLUSTERED - ( - [mssqlindex] - ) -GO - -CREATE INDEX [forum_id] ON [phpbb_forums_watch]([forum_id]) -GO - -CREATE INDEX [user_id] ON [phpbb_forums_watch]([user_id]) -GO - -CREATE INDEX [notify_stat] ON [phpbb_forums_watch]([notify_status]) -GO - - -/* - Table: 'phpbb_groups' -*/ -CREATE TABLE [phpbb_groups] ( - [group_id] [int] IDENTITY (1, 1) NOT NULL , - [group_type] [int] DEFAULT (1) NOT NULL , - [group_founder_manage] [int] DEFAULT (0) NOT NULL , - [group_skip_auth] [int] DEFAULT (0) NOT NULL , - [group_name] [varchar] (255) DEFAULT ('') NOT NULL , - [group_desc] [varchar] (4000) DEFAULT ('') NOT NULL , - [group_desc_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , - [group_desc_options] [int] DEFAULT (7) NOT NULL , - [group_desc_uid] [varchar] (8) DEFAULT ('') NOT NULL , - [group_display] [int] DEFAULT (0) NOT NULL , - [group_avatar] [varchar] (255) DEFAULT ('') NOT NULL , - [group_avatar_type] [varchar] (255) DEFAULT ('') NOT NULL , - [group_avatar_width] [int] DEFAULT (0) NOT NULL , - [group_avatar_height] [int] DEFAULT (0) NOT NULL , - [group_rank] [int] DEFAULT (0) NOT NULL , - [group_colour] [varchar] (6) DEFAULT ('') NOT NULL , - [group_sig_chars] [int] DEFAULT (0) NOT NULL , - [group_receive_pm] [int] DEFAULT (0) NOT NULL , - [group_message_limit] [int] DEFAULT (0) NOT NULL , - [group_max_recipients] [int] DEFAULT (0) NOT NULL , - [group_legend] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_groups] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_groups] PRIMARY KEY CLUSTERED - ( - [group_id] - ) -GO - -CREATE INDEX [group_legend_name] ON [phpbb_groups]([group_legend], [group_name]) -GO - - -/* - Table: 'phpbb_icons' -*/ -CREATE TABLE [phpbb_icons] ( - [icons_id] [int] IDENTITY (1, 1) NOT NULL , - [icons_url] [varchar] (255) DEFAULT ('') NOT NULL , - [icons_width] [int] DEFAULT (0) NOT NULL , - [icons_height] [int] DEFAULT (0) NOT NULL , - [icons_order] [int] DEFAULT (0) NOT NULL , - [display_on_posting] [int] DEFAULT (1) NOT NULL -)GO - -ALTER TABLE [phpbb_icons] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_icons] PRIMARY KEY CLUSTERED - ( - [icons_id] - ) -GO - -CREATE INDEX [display_on_posting] ON [phpbb_icons]([display_on_posting]) -GO - - -/* - Table: 'phpbb_lang' -*/ -CREATE TABLE [phpbb_lang] ( - [lang_id] [int] IDENTITY (1, 1) NOT NULL , - [lang_iso] [varchar] (30) DEFAULT ('') NOT NULL , - [lang_dir] [varchar] (30) DEFAULT ('') NOT NULL , - [lang_english_name] [varchar] (100) DEFAULT ('') NOT NULL , - [lang_local_name] [varchar] (255) DEFAULT ('') NOT NULL , - [lang_author] [varchar] (255) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_lang] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_lang] PRIMARY KEY CLUSTERED - ( - [lang_id] - ) -GO - -CREATE INDEX [lang_iso] ON [phpbb_lang]([lang_iso]) -GO - - -/* - Table: 'phpbb_log' -*/ -CREATE TABLE [phpbb_log] ( - [log_id] [int] IDENTITY (1, 1) NOT NULL , - [log_type] [int] DEFAULT (0) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [forum_id] [int] DEFAULT (0) NOT NULL , - [topic_id] [int] DEFAULT (0) NOT NULL , - [reportee_id] [int] DEFAULT (0) NOT NULL , - [log_ip] [varchar] (40) DEFAULT ('') NOT NULL , - [log_time] [int] DEFAULT (0) NOT NULL , - [log_operation] [varchar] (4000) DEFAULT ('') NOT NULL , - [log_data] [text] DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_log] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_log] PRIMARY KEY CLUSTERED - ( - [log_id] - ) -GO - -CREATE INDEX [log_type] ON [phpbb_log]([log_type]) -GO - -CREATE INDEX [log_time] ON [phpbb_log]([log_time]) -GO - -CREATE INDEX [forum_id] ON [phpbb_log]([forum_id]) -GO - -CREATE INDEX [topic_id] ON [phpbb_log]([topic_id]) -GO - -CREATE INDEX [reportee_id] ON [phpbb_log]([reportee_id]) -GO - -CREATE INDEX [user_id] ON [phpbb_log]([user_id]) -GO - - -/* - Table: 'phpbb_login_attempts' -*/ -CREATE TABLE [phpbb_login_attempts] ( - [attempt_ip] [varchar] (40) DEFAULT ('') NOT NULL , - [attempt_browser] [varchar] (150) DEFAULT ('') NOT NULL , - [attempt_forwarded_for] [varchar] (255) DEFAULT ('') NOT NULL , - [attempt_time] [int] DEFAULT (0) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [username] [varchar] (255) DEFAULT (0) NOT NULL , - [username_clean] [varchar] (255) DEFAULT (0) NOT NULL , - [mssqlindex] [int] IDENTITY (1, 1) NOT NULL -)GO - -ALTER TABLE [phpbb_login_attempts] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_login_attempts] PRIMARY KEY CLUSTERED - ( - [mssqlindex] - ) -GO - -CREATE INDEX [att_ip] ON [phpbb_login_attempts]([attempt_ip], [attempt_time]) -GO - -CREATE INDEX [att_for] ON [phpbb_login_attempts]([attempt_forwarded_for], [attempt_time]) -GO - -CREATE INDEX [att_time] ON [phpbb_login_attempts]([attempt_time]) -GO - -CREATE INDEX [user_id] ON [phpbb_login_attempts]([user_id]) -GO - - -/* - Table: 'phpbb_moderator_cache' -*/ -CREATE TABLE [phpbb_moderator_cache] ( - [forum_id] [int] DEFAULT (0) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [username] [varchar] (255) DEFAULT ('') NOT NULL , - [group_id] [int] DEFAULT (0) NOT NULL , - [group_name] [varchar] (255) DEFAULT ('') NOT NULL , - [display_on_index] [int] DEFAULT (1) NOT NULL , - [mssqlindex] [int] IDENTITY (1, 1) NOT NULL -)GO - -ALTER TABLE [phpbb_moderator_cache] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_moderator_cache] PRIMARY KEY CLUSTERED - ( - [mssqlindex] - ) -GO - -CREATE INDEX [disp_idx] ON [phpbb_moderator_cache]([display_on_index]) -GO - -CREATE INDEX [forum_id] ON [phpbb_moderator_cache]([forum_id]) -GO - - -/* - Table: 'phpbb_migrations' -*/ -CREATE TABLE [phpbb_migrations] ( - [migration_name] [varchar] (255) DEFAULT ('') NOT NULL , - [migration_depends_on] [varchar] (8000) DEFAULT ('') NOT NULL , - [migration_schema_done] [int] DEFAULT (0) NOT NULL , - [migration_data_done] [int] DEFAULT (0) NOT NULL , - [migration_data_state] [varchar] (8000) DEFAULT ('') NOT NULL , - [migration_start_time] [int] DEFAULT (0) NOT NULL , - [migration_end_time] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_migrations] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_migrations] PRIMARY KEY CLUSTERED - ( - [migration_name] - ) -GO - - -/* - Table: 'phpbb_modules' -*/ -CREATE TABLE [phpbb_modules] ( - [module_id] [int] IDENTITY (1, 1) NOT NULL , - [module_enabled] [int] DEFAULT (1) NOT NULL , - [module_display] [int] DEFAULT (1) NOT NULL , - [module_basename] [varchar] (255) DEFAULT ('') NOT NULL , - [module_class] [varchar] (10) DEFAULT ('') NOT NULL , - [parent_id] [int] DEFAULT (0) NOT NULL , - [left_id] [int] DEFAULT (0) NOT NULL , - [right_id] [int] DEFAULT (0) NOT NULL , - [module_langname] [varchar] (255) DEFAULT ('') NOT NULL , - [module_mode] [varchar] (255) DEFAULT ('') NOT NULL , - [module_auth] [varchar] (255) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_modules] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_modules] PRIMARY KEY CLUSTERED - ( - [module_id] - ) -GO - -CREATE INDEX [left_right_id] ON [phpbb_modules]([left_id], [right_id]) -GO - -CREATE INDEX [module_enabled] ON [phpbb_modules]([module_enabled]) -GO - -CREATE INDEX [class_left_id] ON [phpbb_modules]([module_class], [left_id]) -GO - - -/* - Table: 'phpbb_notification_types' -*/ -CREATE TABLE [phpbb_notification_types] ( - [notification_type_id] [int] IDENTITY (1, 1) NOT NULL , - [notification_type_name] [varchar] (255) DEFAULT ('') NOT NULL , - [notification_type_enabled] [int] DEFAULT (1) NOT NULL -)GO - -ALTER TABLE [phpbb_notification_types] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_notification_types] PRIMARY KEY CLUSTERED - ( - [notification_type_id] - ) -GO - -CREATE UNIQUE INDEX [type] ON [phpbb_notification_types]([notification_type_name]) -GO - - -/* - Table: 'phpbb_notifications' -*/ -CREATE TABLE [phpbb_notifications] ( - [notification_id] [int] IDENTITY (1, 1) NOT NULL , - [notification_type_id] [int] DEFAULT (0) NOT NULL , - [item_id] [int] DEFAULT (0) NOT NULL , - [item_parent_id] [int] DEFAULT (0) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [notification_read] [int] DEFAULT (0) NOT NULL , - [notification_time] [int] DEFAULT (1) NOT NULL , - [notification_data] [varchar] (4000) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_notifications] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_notifications] PRIMARY KEY CLUSTERED - ( - [notification_id] - ) -GO - -CREATE INDEX [item_ident] ON [phpbb_notifications]([notification_type_id], [item_id]) -GO - -CREATE INDEX [user] ON [phpbb_notifications]([user_id], [notification_read]) -GO - - -/* - Table: 'phpbb_oauth_accounts' -*/ -CREATE TABLE [phpbb_oauth_accounts] ( - [user_id] [int] DEFAULT (0) NOT NULL , - [provider] [varchar] (255) DEFAULT ('') NOT NULL , - [oauth_provider_id] [varchar] (4000) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_oauth_accounts] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_oauth_accounts] PRIMARY KEY CLUSTERED - ( - [user_id], - [provider] - ) -GO - - -/* - Table: 'phpbb_oauth_tokens' -*/ -CREATE TABLE [phpbb_oauth_tokens] ( - [user_id] [int] DEFAULT (0) NOT NULL , - [session_id] [char] (32) DEFAULT ('') NOT NULL , - [provider] [varchar] (255) DEFAULT ('') NOT NULL , - [oauth_token] [text] DEFAULT ('') NOT NULL , - [mssqlindex] [int] IDENTITY (1, 1) NOT NULL -)GO - -ALTER TABLE [phpbb_oauth_tokens] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_oauth_tokens] PRIMARY KEY CLUSTERED - ( - [mssqlindex] - ) -GO - -CREATE INDEX [user_id] ON [phpbb_oauth_tokens]([user_id]) -GO - -CREATE INDEX [provider] ON [phpbb_oauth_tokens]([provider]) -GO - - -/* - Table: 'phpbb_poll_options' -*/ -CREATE TABLE [phpbb_poll_options] ( - [poll_option_id] [int] DEFAULT (0) NOT NULL , - [topic_id] [int] DEFAULT (0) NOT NULL , - [poll_option_text] [varchar] (4000) DEFAULT ('') NOT NULL , - [poll_option_total] [int] DEFAULT (0) NOT NULL , - [mssqlindex] [int] IDENTITY (1, 1) NOT NULL -)GO - -ALTER TABLE [phpbb_poll_options] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_poll_options] PRIMARY KEY CLUSTERED - ( - [mssqlindex] - ) -GO - -CREATE INDEX [poll_opt_id] ON [phpbb_poll_options]([poll_option_id]) -GO - -CREATE INDEX [topic_id] ON [phpbb_poll_options]([topic_id]) -GO - - -/* - Table: 'phpbb_poll_votes' -*/ -CREATE TABLE [phpbb_poll_votes] ( - [topic_id] [int] DEFAULT (0) NOT NULL , - [poll_option_id] [int] DEFAULT (0) NOT NULL , - [vote_user_id] [int] DEFAULT (0) NOT NULL , - [vote_user_ip] [varchar] (40) DEFAULT ('') NOT NULL , - [mssqlindex] [int] IDENTITY (1, 1) NOT NULL -)GO - -ALTER TABLE [phpbb_poll_votes] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_poll_votes] PRIMARY KEY CLUSTERED - ( - [mssqlindex] - ) -GO - -CREATE INDEX [topic_id] ON [phpbb_poll_votes]([topic_id]) -GO - -CREATE INDEX [vote_user_id] ON [phpbb_poll_votes]([vote_user_id]) -GO - -CREATE INDEX [vote_user_ip] ON [phpbb_poll_votes]([vote_user_ip]) -GO - - -/* - Table: 'phpbb_posts' -*/ -CREATE TABLE [phpbb_posts] ( - [post_id] [int] IDENTITY (1, 1) NOT NULL , - [topic_id] [int] DEFAULT (0) NOT NULL , - [forum_id] [int] DEFAULT (0) NOT NULL , - [poster_id] [int] DEFAULT (0) NOT NULL , - [icon_id] [int] DEFAULT (0) NOT NULL , - [poster_ip] [varchar] (40) DEFAULT ('') NOT NULL , - [post_time] [int] DEFAULT (0) NOT NULL , - [post_visibility] [int] DEFAULT (0) NOT NULL , - [post_reported] [int] DEFAULT (0) NOT NULL , - [enable_bbcode] [int] DEFAULT (1) NOT NULL , - [enable_smilies] [int] DEFAULT (1) NOT NULL , - [enable_magic_url] [int] DEFAULT (1) NOT NULL , - [enable_sig] [int] DEFAULT (1) NOT NULL , - [post_username] [varchar] (255) DEFAULT ('') NOT NULL , - [post_subject] [varchar] (255) DEFAULT ('') NOT NULL , - [post_text] [text] DEFAULT ('') NOT NULL , - [post_checksum] [varchar] (32) DEFAULT ('') NOT NULL , - [post_attachment] [int] DEFAULT (0) NOT NULL , - [bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , - [bbcode_uid] [varchar] (8) DEFAULT ('') NOT NULL , - [post_postcount] [int] DEFAULT (1) NOT NULL , - [post_edit_time] [int] DEFAULT (0) NOT NULL , - [post_edit_reason] [varchar] (255) DEFAULT ('') NOT NULL , - [post_edit_user] [int] DEFAULT (0) NOT NULL , - [post_edit_count] [int] DEFAULT (0) NOT NULL , - [post_edit_locked] [int] DEFAULT (0) NOT NULL , - [post_delete_time] [int] DEFAULT (0) NOT NULL , - [post_delete_reason] [varchar] (255) DEFAULT ('') NOT NULL , - [post_delete_user] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_posts] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_posts] PRIMARY KEY CLUSTERED - ( - [post_id] - ) -GO - -CREATE INDEX [forum_id] ON [phpbb_posts]([forum_id]) -GO - -CREATE INDEX [topic_id] ON [phpbb_posts]([topic_id]) -GO - -CREATE INDEX [poster_ip] ON [phpbb_posts]([poster_ip]) -GO - -CREATE INDEX [poster_id] ON [phpbb_posts]([poster_id]) -GO - -CREATE INDEX [post_visibility] ON [phpbb_posts]([post_visibility]) -GO - -CREATE INDEX [post_username] ON [phpbb_posts]([post_username]) -GO - -CREATE INDEX [tid_post_time] ON [phpbb_posts]([topic_id], [post_time]) -GO - - -/* - Table: 'phpbb_privmsgs' -*/ -CREATE TABLE [phpbb_privmsgs] ( - [msg_id] [int] IDENTITY (1, 1) NOT NULL , - [root_level] [int] DEFAULT (0) NOT NULL , - [author_id] [int] DEFAULT (0) NOT NULL , - [icon_id] [int] DEFAULT (0) NOT NULL , - [author_ip] [varchar] (40) DEFAULT ('') NOT NULL , - [message_time] [int] DEFAULT (0) NOT NULL , - [enable_bbcode] [int] DEFAULT (1) NOT NULL , - [enable_smilies] [int] DEFAULT (1) NOT NULL , - [enable_magic_url] [int] DEFAULT (1) NOT NULL , - [enable_sig] [int] DEFAULT (1) NOT NULL , - [message_subject] [varchar] (255) DEFAULT ('') NOT NULL , - [message_text] [text] DEFAULT ('') NOT NULL , - [message_edit_reason] [varchar] (255) DEFAULT ('') NOT NULL , - [message_edit_user] [int] DEFAULT (0) NOT NULL , - [message_attachment] [int] DEFAULT (0) NOT NULL , - [bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , - [bbcode_uid] [varchar] (8) DEFAULT ('') NOT NULL , - [message_edit_time] [int] DEFAULT (0) NOT NULL , - [message_edit_count] [int] DEFAULT (0) NOT NULL , - [to_address] [varchar] (4000) DEFAULT ('') NOT NULL , - [bcc_address] [varchar] (4000) DEFAULT ('') NOT NULL , - [message_reported] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_privmsgs] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_privmsgs] PRIMARY KEY CLUSTERED - ( - [msg_id] - ) -GO - -CREATE INDEX [author_ip] ON [phpbb_privmsgs]([author_ip]) -GO - -CREATE INDEX [message_time] ON [phpbb_privmsgs]([message_time]) -GO - -CREATE INDEX [author_id] ON [phpbb_privmsgs]([author_id]) -GO - -CREATE INDEX [root_level] ON [phpbb_privmsgs]([root_level]) -GO - - -/* - Table: 'phpbb_privmsgs_folder' -*/ -CREATE TABLE [phpbb_privmsgs_folder] ( - [folder_id] [int] IDENTITY (1, 1) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [folder_name] [varchar] (255) DEFAULT ('') NOT NULL , - [pm_count] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_privmsgs_folder] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_privmsgs_folder] PRIMARY KEY CLUSTERED - ( - [folder_id] - ) -GO - -CREATE INDEX [user_id] ON [phpbb_privmsgs_folder]([user_id]) -GO - - -/* - Table: 'phpbb_privmsgs_rules' -*/ -CREATE TABLE [phpbb_privmsgs_rules] ( - [rule_id] [int] IDENTITY (1, 1) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [rule_check] [int] DEFAULT (0) NOT NULL , - [rule_connection] [int] DEFAULT (0) NOT NULL , - [rule_string] [varchar] (255) DEFAULT ('') NOT NULL , - [rule_user_id] [int] DEFAULT (0) NOT NULL , - [rule_group_id] [int] DEFAULT (0) NOT NULL , - [rule_action] [int] DEFAULT (0) NOT NULL , - [rule_folder_id] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_privmsgs_rules] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_privmsgs_rules] PRIMARY KEY CLUSTERED - ( - [rule_id] - ) -GO - -CREATE INDEX [user_id] ON [phpbb_privmsgs_rules]([user_id]) -GO - - -/* - Table: 'phpbb_privmsgs_to' -*/ -CREATE TABLE [phpbb_privmsgs_to] ( - [msg_id] [int] DEFAULT (0) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [author_id] [int] DEFAULT (0) NOT NULL , - [pm_deleted] [int] DEFAULT (0) NOT NULL , - [pm_new] [int] DEFAULT (1) NOT NULL , - [pm_unread] [int] DEFAULT (1) NOT NULL , - [pm_replied] [int] DEFAULT (0) NOT NULL , - [pm_marked] [int] DEFAULT (0) NOT NULL , - [pm_forwarded] [int] DEFAULT (0) NOT NULL , - [folder_id] [int] DEFAULT (0) NOT NULL , - [mssqlindex] [int] IDENTITY (1, 1) NOT NULL -)GO - -ALTER TABLE [phpbb_privmsgs_to] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_privmsgs_to] PRIMARY KEY CLUSTERED - ( - [mssqlindex] - ) -GO - -CREATE INDEX [msg_id] ON [phpbb_privmsgs_to]([msg_id]) -GO - -CREATE INDEX [author_id] ON [phpbb_privmsgs_to]([author_id]) -GO - -CREATE INDEX [usr_flder_id] ON [phpbb_privmsgs_to]([user_id], [folder_id]) -GO - - -/* - Table: 'phpbb_profile_fields' -*/ -CREATE TABLE [phpbb_profile_fields] ( - [field_id] [int] IDENTITY (1, 1) NOT NULL , - [field_name] [varchar] (255) DEFAULT ('') NOT NULL , - [field_type] [varchar] (100) DEFAULT ('') NOT NULL , - [field_ident] [varchar] (20) DEFAULT ('') NOT NULL , - [field_length] [varchar] (20) DEFAULT ('') NOT NULL , - [field_minlen] [varchar] (255) DEFAULT ('') NOT NULL , - [field_maxlen] [varchar] (255) DEFAULT ('') NOT NULL , - [field_novalue] [varchar] (255) DEFAULT ('') NOT NULL , - [field_default_value] [varchar] (255) DEFAULT ('') NOT NULL , - [field_validation] [varchar] (20) DEFAULT ('') NOT NULL , - [field_required] [int] DEFAULT (0) NOT NULL , - [field_show_novalue] [int] DEFAULT (0) NOT NULL , - [field_show_on_reg] [int] DEFAULT (0) NOT NULL , - [field_show_on_pm] [int] DEFAULT (0) NOT NULL , - [field_show_on_vt] [int] DEFAULT (0) NOT NULL , - [field_show_on_ml] [int] DEFAULT (0) NOT NULL , - [field_show_profile] [int] DEFAULT (0) NOT NULL , - [field_hide] [int] DEFAULT (0) NOT NULL , - [field_no_view] [int] DEFAULT (0) NOT NULL , - [field_active] [int] DEFAULT (0) NOT NULL , - [field_order] [int] DEFAULT (0) NOT NULL , - [field_is_contact] [int] DEFAULT (0) NOT NULL , - [field_contact_desc] [varchar] (255) DEFAULT ('') NOT NULL , - [field_contact_url] [varchar] (255) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_profile_fields] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_profile_fields] PRIMARY KEY CLUSTERED - ( - [field_id] - ) -GO - -CREATE INDEX [fld_type] ON [phpbb_profile_fields]([field_type]) -GO - -CREATE INDEX [fld_ordr] ON [phpbb_profile_fields]([field_order]) -GO - - -/* - Table: 'phpbb_profile_fields_data' -*/ -CREATE TABLE [phpbb_profile_fields_data] ( - [user_id] [int] DEFAULT (0) NOT NULL , - [pf_phpbb_location] [varchar] (255) DEFAULT ('') NOT NULL , - [pf_phpbb_interests] [varchar] (4000) DEFAULT ('') NOT NULL , - [pf_phpbb_occupation] [varchar] (4000) DEFAULT ('') NOT NULL , - [pf_phpbb_icq] [varchar] (255) DEFAULT ('') NOT NULL , - [pf_phpbb_aol] [varchar] (255) DEFAULT ('') NOT NULL , - [pf_phpbb_wlm] [varchar] (255) DEFAULT ('') NOT NULL , - [pf_phpbb_yahoo] [varchar] (255) DEFAULT ('') NOT NULL , - [pf_phpbb_website] [varchar] (255) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_profile_fields_data] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_profile_fields_data] PRIMARY KEY CLUSTERED - ( - [user_id] - ) -GO - - -/* - Table: 'phpbb_profile_fields_lang' -*/ -CREATE TABLE [phpbb_profile_fields_lang] ( - [field_id] [int] DEFAULT (0) NOT NULL , - [lang_id] [int] DEFAULT (0) NOT NULL , - [option_id] [int] DEFAULT (0) NOT NULL , - [field_type] [varchar] (100) DEFAULT ('') NOT NULL , - [lang_value] [varchar] (255) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_profile_fields_lang] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_profile_fields_lang] PRIMARY KEY CLUSTERED - ( - [field_id], - [lang_id], - [option_id] - ) -GO - - -/* - Table: 'phpbb_profile_lang' -*/ -CREATE TABLE [phpbb_profile_lang] ( - [field_id] [int] DEFAULT (0) NOT NULL , - [lang_id] [int] DEFAULT (0) NOT NULL , - [lang_name] [varchar] (255) DEFAULT ('') NOT NULL , - [lang_explain] [varchar] (4000) DEFAULT ('') NOT NULL , - [lang_default_value] [varchar] (255) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_profile_lang] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_profile_lang] PRIMARY KEY CLUSTERED - ( - [field_id], - [lang_id] - ) -GO - - -/* - Table: 'phpbb_ranks' -*/ -CREATE TABLE [phpbb_ranks] ( - [rank_id] [int] IDENTITY (1, 1) NOT NULL , - [rank_title] [varchar] (255) DEFAULT ('') NOT NULL , - [rank_min] [int] DEFAULT (0) NOT NULL , - [rank_special] [int] DEFAULT (0) NOT NULL , - [rank_image] [varchar] (255) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_ranks] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_ranks] PRIMARY KEY CLUSTERED - ( - [rank_id] - ) -GO - - -/* - Table: 'phpbb_reports' -*/ -CREATE TABLE [phpbb_reports] ( - [report_id] [int] IDENTITY (1, 1) NOT NULL , - [reason_id] [int] DEFAULT (0) NOT NULL , - [post_id] [int] DEFAULT (0) NOT NULL , - [pm_id] [int] DEFAULT (0) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [user_notify] [int] DEFAULT (0) NOT NULL , - [report_closed] [int] DEFAULT (0) NOT NULL , - [report_time] [int] DEFAULT (0) NOT NULL , - [report_text] [text] DEFAULT ('') NOT NULL , - [reported_post_text] [text] DEFAULT ('') NOT NULL , - [reported_post_uid] [varchar] (8) DEFAULT ('') NOT NULL , - [reported_post_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , - [reported_post_enable_magic_url] [int] DEFAULT (1) NOT NULL , - [reported_post_enable_smilies] [int] DEFAULT (1) NOT NULL , - [reported_post_enable_bbcode] [int] DEFAULT (1) NOT NULL -)GO - -ALTER TABLE [phpbb_reports] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_reports] PRIMARY KEY CLUSTERED - ( - [report_id] - ) -GO - -CREATE INDEX [post_id] ON [phpbb_reports]([post_id]) -GO - -CREATE INDEX [pm_id] ON [phpbb_reports]([pm_id]) -GO - - -/* - Table: 'phpbb_reports_reasons' -*/ -CREATE TABLE [phpbb_reports_reasons] ( - [reason_id] [int] IDENTITY (1, 1) NOT NULL , - [reason_title] [varchar] (255) DEFAULT ('') NOT NULL , - [reason_description] [text] DEFAULT ('') NOT NULL , - [reason_order] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_reports_reasons] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_reports_reasons] PRIMARY KEY CLUSTERED - ( - [reason_id] - ) -GO - - -/* - Table: 'phpbb_search_results' -*/ -CREATE TABLE [phpbb_search_results] ( - [search_key] [varchar] (32) DEFAULT ('') NOT NULL , - [search_time] [int] DEFAULT (0) NOT NULL , - [search_keywords] [text] DEFAULT ('') NOT NULL , - [search_authors] [text] DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_search_results] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_search_results] PRIMARY KEY CLUSTERED - ( - [search_key] - ) -GO - - -/* - Table: 'phpbb_search_wordlist' -*/ -CREATE TABLE [phpbb_search_wordlist] ( - [word_id] [int] IDENTITY (1, 1) NOT NULL , - [word_text] [varchar] (255) DEFAULT ('') NOT NULL , - [word_common] [int] DEFAULT (0) NOT NULL , - [word_count] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_search_wordlist] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_search_wordlist] PRIMARY KEY CLUSTERED - ( - [word_id] - ) -GO - -CREATE UNIQUE INDEX [wrd_txt] ON [phpbb_search_wordlist]([word_text]) -GO - -CREATE INDEX [wrd_cnt] ON [phpbb_search_wordlist]([word_count]) -GO - - -/* - Table: 'phpbb_search_wordmatch' -*/ -CREATE TABLE [phpbb_search_wordmatch] ( - [post_id] [int] DEFAULT (0) NOT NULL , - [word_id] [int] DEFAULT (0) NOT NULL , - [title_match] [int] DEFAULT (0) NOT NULL , - [mssqlindex] [int] IDENTITY (1, 1) NOT NULL -)GO - -ALTER TABLE [phpbb_search_wordmatch] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_search_wordmatch] PRIMARY KEY CLUSTERED - ( - [mssqlindex] - ) -GO - -CREATE UNIQUE INDEX [unq_mtch] ON [phpbb_search_wordmatch]([word_id], [post_id], [title_match]) -GO - -CREATE INDEX [word_id] ON [phpbb_search_wordmatch]([word_id]) -GO - -CREATE INDEX [post_id] ON [phpbb_search_wordmatch]([post_id]) -GO - - -/* - Table: 'phpbb_sessions' -*/ -CREATE TABLE [phpbb_sessions] ( - [session_id] [char] (32) DEFAULT ('') NOT NULL , - [session_user_id] [int] DEFAULT (0) NOT NULL , - [session_forum_id] [int] DEFAULT (0) NOT NULL , - [session_last_visit] [int] DEFAULT (0) NOT NULL , - [session_start] [int] DEFAULT (0) NOT NULL , - [session_time] [int] DEFAULT (0) NOT NULL , - [session_ip] [varchar] (40) DEFAULT ('') NOT NULL , - [session_browser] [varchar] (150) DEFAULT ('') NOT NULL , - [session_forwarded_for] [varchar] (255) DEFAULT ('') NOT NULL , - [session_page] [varchar] (255) DEFAULT ('') NOT NULL , - [session_viewonline] [int] DEFAULT (1) NOT NULL , - [session_autologin] [int] DEFAULT (0) NOT NULL , - [session_admin] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_sessions] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_sessions] PRIMARY KEY CLUSTERED - ( - [session_id] - ) -GO - -CREATE INDEX [session_time] ON [phpbb_sessions]([session_time]) -GO - -CREATE INDEX [session_user_id] ON [phpbb_sessions]([session_user_id]) -GO - -CREATE INDEX [session_fid] ON [phpbb_sessions]([session_forum_id]) -GO - - -/* - Table: 'phpbb_sessions_keys' -*/ -CREATE TABLE [phpbb_sessions_keys] ( - [key_id] [char] (32) DEFAULT ('') NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [last_ip] [varchar] (40) DEFAULT ('') NOT NULL , - [last_login] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_sessions_keys] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_sessions_keys] PRIMARY KEY CLUSTERED - ( - [key_id], - [user_id] - ) -GO - -CREATE INDEX [last_login] ON [phpbb_sessions_keys]([last_login]) -GO - - -/* - Table: 'phpbb_sitelist' -*/ -CREATE TABLE [phpbb_sitelist] ( - [site_id] [int] IDENTITY (1, 1) NOT NULL , - [site_ip] [varchar] (40) DEFAULT ('') NOT NULL , - [site_hostname] [varchar] (255) DEFAULT ('') NOT NULL , - [ip_exclude] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_sitelist] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_sitelist] PRIMARY KEY CLUSTERED - ( - [site_id] - ) -GO - - -/* - Table: 'phpbb_smilies' -*/ -CREATE TABLE [phpbb_smilies] ( - [smiley_id] [int] IDENTITY (1, 1) NOT NULL , - [code] [varchar] (50) DEFAULT ('') NOT NULL , - [emotion] [varchar] (50) DEFAULT ('') NOT NULL , - [smiley_url] [varchar] (50) DEFAULT ('') NOT NULL , - [smiley_width] [int] DEFAULT (0) NOT NULL , - [smiley_height] [int] DEFAULT (0) NOT NULL , - [smiley_order] [int] DEFAULT (0) NOT NULL , - [display_on_posting] [int] DEFAULT (1) NOT NULL -)GO - -ALTER TABLE [phpbb_smilies] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_smilies] PRIMARY KEY CLUSTERED - ( - [smiley_id] - ) -GO - -CREATE INDEX [display_on_post] ON [phpbb_smilies]([display_on_posting]) -GO - - -/* - Table: 'phpbb_styles' -*/ -CREATE TABLE [phpbb_styles] ( - [style_id] [int] IDENTITY (1, 1) NOT NULL , - [style_name] [varchar] (255) DEFAULT ('') NOT NULL , - [style_copyright] [varchar] (255) DEFAULT ('') NOT NULL , - [style_active] [int] DEFAULT (1) NOT NULL , - [style_path] [varchar] (100) DEFAULT ('') NOT NULL , - [bbcode_bitfield] [varchar] (255) DEFAULT ('kNg=') NOT NULL , - [style_parent_id] [int] DEFAULT (0) NOT NULL , - [style_parent_tree] [varchar] (8000) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_styles] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_styles] PRIMARY KEY CLUSTERED - ( - [style_id] - ) -GO - -CREATE UNIQUE INDEX [style_name] ON [phpbb_styles]([style_name]) -GO - - -/* - Table: 'phpbb_teampage' -*/ -CREATE TABLE [phpbb_teampage] ( - [teampage_id] [int] IDENTITY (1, 1) NOT NULL , - [group_id] [int] DEFAULT (0) NOT NULL , - [teampage_name] [varchar] (255) DEFAULT ('') NOT NULL , - [teampage_position] [int] DEFAULT (0) NOT NULL , - [teampage_parent] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_teampage] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_teampage] PRIMARY KEY CLUSTERED - ( - [teampage_id] - ) -GO - - -/* - Table: 'phpbb_topics' -*/ -CREATE TABLE [phpbb_topics] ( - [topic_id] [int] IDENTITY (1, 1) NOT NULL , - [forum_id] [int] DEFAULT (0) NOT NULL , - [icon_id] [int] DEFAULT (0) NOT NULL , - [topic_attachment] [int] DEFAULT (0) NOT NULL , - [topic_visibility] [int] DEFAULT (0) NOT NULL , - [topic_reported] [int] DEFAULT (0) NOT NULL , - [topic_title] [varchar] (255) DEFAULT ('') NOT NULL , - [topic_poster] [int] DEFAULT (0) NOT NULL , - [topic_time] [int] DEFAULT (0) NOT NULL , - [topic_time_limit] [int] DEFAULT (0) NOT NULL , - [topic_views] [int] DEFAULT (0) NOT NULL , - [topic_posts_approved] [int] DEFAULT (0) NOT NULL , - [topic_posts_unapproved] [int] DEFAULT (0) NOT NULL , - [topic_posts_softdeleted] [int] DEFAULT (0) NOT NULL , - [topic_status] [int] DEFAULT (0) NOT NULL , - [topic_type] [int] DEFAULT (0) NOT NULL , - [topic_first_post_id] [int] DEFAULT (0) NOT NULL , - [topic_first_poster_name] [varchar] (255) DEFAULT ('') NOT NULL , - [topic_first_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL , - [topic_last_post_id] [int] DEFAULT (0) NOT NULL , - [topic_last_poster_id] [int] DEFAULT (0) NOT NULL , - [topic_last_poster_name] [varchar] (255) DEFAULT ('') NOT NULL , - [topic_last_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL , - [topic_last_post_subject] [varchar] (255) DEFAULT ('') NOT NULL , - [topic_last_post_time] [int] DEFAULT (0) NOT NULL , - [topic_last_view_time] [int] DEFAULT (0) NOT NULL , - [topic_moved_id] [int] DEFAULT (0) NOT NULL , - [topic_bumped] [int] DEFAULT (0) NOT NULL , - [topic_bumper] [int] DEFAULT (0) NOT NULL , - [poll_title] [varchar] (255) DEFAULT ('') NOT NULL , - [poll_start] [int] DEFAULT (0) NOT NULL , - [poll_length] [int] DEFAULT (0) NOT NULL , - [poll_max_options] [int] DEFAULT (1) NOT NULL , - [poll_last_vote] [int] DEFAULT (0) NOT NULL , - [poll_vote_change] [int] DEFAULT (0) NOT NULL , - [topic_delete_time] [int] DEFAULT (0) NOT NULL , - [topic_delete_reason] [varchar] (255) DEFAULT ('') NOT NULL , - [topic_delete_user] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_topics] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_topics] PRIMARY KEY CLUSTERED - ( - [topic_id] - ) -GO - -CREATE INDEX [forum_id] ON [phpbb_topics]([forum_id]) -GO - -CREATE INDEX [forum_id_type] ON [phpbb_topics]([forum_id], [topic_type]) -GO - -CREATE INDEX [last_post_time] ON [phpbb_topics]([topic_last_post_time]) -GO - -CREATE INDEX [topic_visibility] ON [phpbb_topics]([topic_visibility]) -GO - -CREATE INDEX [forum_appr_last] ON [phpbb_topics]([forum_id], [topic_visibility], [topic_last_post_id]) -GO - -CREATE INDEX [fid_time_moved] ON [phpbb_topics]([forum_id], [topic_last_post_time], [topic_moved_id]) -GO - - -/* - Table: 'phpbb_topics_track' -*/ -CREATE TABLE [phpbb_topics_track] ( - [user_id] [int] DEFAULT (0) NOT NULL , - [topic_id] [int] DEFAULT (0) NOT NULL , - [forum_id] [int] DEFAULT (0) NOT NULL , - [mark_time] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_topics_track] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_topics_track] PRIMARY KEY CLUSTERED - ( - [user_id], - [topic_id] - ) -GO - -CREATE INDEX [topic_id] ON [phpbb_topics_track]([topic_id]) -GO - -CREATE INDEX [forum_id] ON [phpbb_topics_track]([forum_id]) -GO - - -/* - Table: 'phpbb_topics_posted' -*/ -CREATE TABLE [phpbb_topics_posted] ( - [user_id] [int] DEFAULT (0) NOT NULL , - [topic_id] [int] DEFAULT (0) NOT NULL , - [topic_posted] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_topics_posted] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_topics_posted] PRIMARY KEY CLUSTERED - ( - [user_id], - [topic_id] - ) -GO - - -/* - Table: 'phpbb_topics_watch' -*/ -CREATE TABLE [phpbb_topics_watch] ( - [topic_id] [int] DEFAULT (0) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [notify_status] [int] DEFAULT (0) NOT NULL , - [mssqlindex] [int] IDENTITY (1, 1) NOT NULL -)GO - -ALTER TABLE [phpbb_topics_watch] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_topics_watch] PRIMARY KEY CLUSTERED - ( - [mssqlindex] - ) -GO - -CREATE INDEX [topic_id] ON [phpbb_topics_watch]([topic_id]) -GO - -CREATE INDEX [user_id] ON [phpbb_topics_watch]([user_id]) -GO - -CREATE INDEX [notify_stat] ON [phpbb_topics_watch]([notify_status]) -GO - - -/* - Table: 'phpbb_user_notifications' -*/ -CREATE TABLE [phpbb_user_notifications] ( - [item_type] [varchar] (255) DEFAULT ('') NOT NULL , - [item_id] [int] DEFAULT (0) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [method] [varchar] (255) DEFAULT ('') NOT NULL , - [notify] [int] DEFAULT (1) NOT NULL , - [mssqlindex] [int] IDENTITY (1, 1) NOT NULL -)GO - -ALTER TABLE [phpbb_user_notifications] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_user_notifications] PRIMARY KEY CLUSTERED - ( - [mssqlindex] - ) -GO - - -/* - Table: 'phpbb_user_group' -*/ -CREATE TABLE [phpbb_user_group] ( - [group_id] [int] DEFAULT (0) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [group_leader] [int] DEFAULT (0) NOT NULL , - [user_pending] [int] DEFAULT (1) NOT NULL , - [mssqlindex] [int] IDENTITY (1, 1) NOT NULL -)GO - -ALTER TABLE [phpbb_user_group] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_user_group] PRIMARY KEY CLUSTERED - ( - [mssqlindex] - ) -GO - -CREATE INDEX [group_id] ON [phpbb_user_group]([group_id]) -GO - -CREATE INDEX [user_id] ON [phpbb_user_group]([user_id]) -GO - -CREATE INDEX [group_leader] ON [phpbb_user_group]([group_leader]) -GO - - -/* - Table: 'phpbb_users' -*/ -CREATE TABLE [phpbb_users] ( - [user_id] [int] IDENTITY (1, 1) NOT NULL , - [user_type] [int] DEFAULT (0) NOT NULL , - [group_id] [int] DEFAULT (3) NOT NULL , - [user_permissions] [text] DEFAULT ('') NOT NULL , - [user_perm_from] [int] DEFAULT (0) NOT NULL , - [user_ip] [varchar] (40) DEFAULT ('') NOT NULL , - [user_regdate] [int] DEFAULT (0) NOT NULL , - [username] [varchar] (255) DEFAULT ('') NOT NULL , - [username_clean] [varchar] (255) DEFAULT ('') NOT NULL , - [user_password] [varchar] (255) DEFAULT ('') NOT NULL , - [user_passchg] [int] DEFAULT (0) NOT NULL , - [user_pass_convert] [int] DEFAULT (0) NOT NULL , - [user_actkey] [varchar] (32) DEFAULT ('') NOT NULL , - [user_newpasswd] [varchar] (255) DEFAULT ('') NOT NULL , - [user_email] [varchar] (100) DEFAULT ('') NOT NULL , - [user_email_hash] [float] DEFAULT (0) NOT NULL , - [user_birthday] [varchar] (10) DEFAULT ('') NOT NULL , - [user_lastvisit] [int] DEFAULT (0) NOT NULL , - [user_lastmark] [int] DEFAULT (0) NOT NULL , - [user_lastpost_time] [int] DEFAULT (0) NOT NULL , - [user_lastpage] [varchar] (200) DEFAULT ('') NOT NULL , - [user_last_confirm_key] [varchar] (10) DEFAULT ('') NOT NULL , - [user_last_search] [int] DEFAULT (0) NOT NULL , - [user_warnings] [int] DEFAULT (0) NOT NULL , - [user_last_warning] [int] DEFAULT (0) NOT NULL , - [user_login_attempts] [int] DEFAULT (0) NOT NULL , - [user_inactive_reason] [int] DEFAULT (0) NOT NULL , - [user_inactive_time] [int] DEFAULT (0) NOT NULL , - [user_posts] [int] DEFAULT (0) NOT NULL , - [user_lang] [varchar] (30) DEFAULT ('') NOT NULL , - [user_timezone] [varchar] (100) DEFAULT ('UTC') NOT NULL , - [user_dateformat] [varchar] (30) DEFAULT ('d M Y H:i') NOT NULL , - [user_style] [int] DEFAULT (0) NOT NULL , - [user_rank] [int] DEFAULT (0) NOT NULL , - [user_colour] [varchar] (6) DEFAULT ('') NOT NULL , - [user_new_privmsg] [int] DEFAULT (0) NOT NULL , - [user_unread_privmsg] [int] DEFAULT (0) NOT NULL , - [user_last_privmsg] [int] DEFAULT (0) NOT NULL , - [user_message_rules] [int] DEFAULT (0) NOT NULL , - [user_full_folder] [int] DEFAULT (-3) NOT NULL , - [user_emailtime] [int] DEFAULT (0) NOT NULL , - [user_topic_show_days] [int] DEFAULT (0) NOT NULL , - [user_topic_sortby_type] [varchar] (1) DEFAULT ('t') NOT NULL , - [user_topic_sortby_dir] [varchar] (1) DEFAULT ('d') NOT NULL , - [user_post_show_days] [int] DEFAULT (0) NOT NULL , - [user_post_sortby_type] [varchar] (1) DEFAULT ('t') NOT NULL , - [user_post_sortby_dir] [varchar] (1) DEFAULT ('a') NOT NULL , - [user_notify] [int] DEFAULT (0) NOT NULL , - [user_notify_pm] [int] DEFAULT (1) NOT NULL , - [user_notify_type] [int] DEFAULT (0) NOT NULL , - [user_allow_pm] [int] DEFAULT (1) NOT NULL , - [user_allow_viewonline] [int] DEFAULT (1) NOT NULL , - [user_allow_viewemail] [int] DEFAULT (1) NOT NULL , - [user_allow_massemail] [int] DEFAULT (1) NOT NULL , - [user_options] [int] DEFAULT (230271) NOT NULL , - [user_avatar] [varchar] (255) DEFAULT ('') NOT NULL , - [user_avatar_type] [varchar] (255) DEFAULT ('') NOT NULL , - [user_avatar_width] [int] DEFAULT (0) NOT NULL , - [user_avatar_height] [int] DEFAULT (0) NOT NULL , - [user_sig] [text] DEFAULT ('') NOT NULL , - [user_sig_bbcode_uid] [varchar] (8) DEFAULT ('') NOT NULL , - [user_sig_bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , - [user_jabber] [varchar] (255) DEFAULT ('') NOT NULL , - [user_form_salt] [varchar] (32) DEFAULT ('') NOT NULL , - [user_new] [int] DEFAULT (1) NOT NULL , - [user_reminded] [int] DEFAULT (0) NOT NULL , - [user_reminded_time] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_users] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_users] PRIMARY KEY CLUSTERED - ( - [user_id] - ) -GO - -CREATE INDEX [user_birthday] ON [phpbb_users]([user_birthday]) -GO - -CREATE INDEX [user_email_hash] ON [phpbb_users]([user_email_hash]) -GO - -CREATE INDEX [user_type] ON [phpbb_users]([user_type]) -GO - -CREATE UNIQUE INDEX [username_clean] ON [phpbb_users]([username_clean]) -GO - - -/* - Table: 'phpbb_warnings' -*/ -CREATE TABLE [phpbb_warnings] ( - [warning_id] [int] IDENTITY (1, 1) NOT NULL , - [user_id] [int] DEFAULT (0) NOT NULL , - [post_id] [int] DEFAULT (0) NOT NULL , - [log_id] [int] DEFAULT (0) NOT NULL , - [warning_time] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_warnings] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_warnings] PRIMARY KEY CLUSTERED - ( - [warning_id] - ) -GO - - -/* - Table: 'phpbb_words' -*/ -CREATE TABLE [phpbb_words] ( - [word_id] [int] IDENTITY (1, 1) NOT NULL , - [word] [varchar] (255) DEFAULT ('') NOT NULL , - [replacement] [varchar] (255) DEFAULT ('') NOT NULL -)GO - -ALTER TABLE [phpbb_words] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_words] PRIMARY KEY CLUSTERED - ( - [word_id] - ) -GO - - -/* - Table: 'phpbb_zebra' -*/ -CREATE TABLE [phpbb_zebra] ( - [user_id] [int] DEFAULT (0) NOT NULL , - [zebra_id] [int] DEFAULT (0) NOT NULL , - [friend] [int] DEFAULT (0) NOT NULL , - [foe] [int] DEFAULT (0) NOT NULL -)GO - -ALTER TABLE [phpbb_zebra] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_zebra] PRIMARY KEY CLUSTERED - ( - [user_id], - [zebra_id] - ) -GO - - diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 66c08156d0..28649dc54c 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -3,1082 +3,3 @@ # To change the contents of this file, edit # phpBB/develop/create_schema_files.php and # run it. -# 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), - UNIQUE 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 smallint(4) UNSIGNED 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_config_text' -CREATE TABLE phpbb_config_text ( - config_name varbinary(255) DEFAULT '' NOT NULL, - config_value mediumblob NOT NULL, - PRIMARY KEY (config_name) -); - - -# 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, - attempts mediumint(8) 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_ext' -CREATE TABLE phpbb_ext ( - ext_name varbinary(255) DEFAULT '' NOT NULL, - ext_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - ext_state blob NOT NULL, - UNIQUE ext_name (ext_name) -); - - -# 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 blob NOT NULL, - forum_style mediumint(8) 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_approved mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - forum_posts_unapproved mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - forum_posts_softdeleted mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - forum_topics_approved mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - forum_topics_unapproved mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - forum_topics_softdeleted 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, - forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL, - display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' 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_skip_auth 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 varbinary(255) DEFAULT '' 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_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - group_legend mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - PRIMARY KEY (group_id), - KEY group_legend_name (group_legend, group_name(255)) -); - - -# 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 log_time (log_time), - KEY forum_id (forum_id), - KEY topic_id (topic_id), - KEY reportee_id (reportee_id), - KEY user_id (user_id) -); - - -# Table: 'phpbb_login_attempts' -CREATE TABLE phpbb_login_attempts ( - attempt_ip varbinary(40) DEFAULT '' NOT NULL, - attempt_browser varbinary(150) DEFAULT '' NOT NULL, - attempt_forwarded_for varbinary(255) DEFAULT '' NOT NULL, - attempt_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - username blob NOT NULL, - username_clean blob NOT NULL, - KEY att_ip (attempt_ip, attempt_time), - KEY att_for (attempt_forwarded_for, attempt_time), - KEY att_time (attempt_time), - 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_migrations' -CREATE TABLE phpbb_migrations ( - migration_name varbinary(255) DEFAULT '' NOT NULL, - migration_depends_on blob NOT NULL, - migration_schema_done tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - migration_data_done tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - migration_data_state blob NOT NULL, - migration_start_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - migration_end_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - PRIMARY KEY (migration_name) -); - - -# 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_notification_types' -CREATE TABLE phpbb_notification_types ( - notification_type_id smallint(4) UNSIGNED NOT NULL auto_increment, - notification_type_name varbinary(255) DEFAULT '' NOT NULL, - notification_type_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - PRIMARY KEY (notification_type_id), - UNIQUE type (notification_type_name) -); - - -# Table: 'phpbb_notifications' -CREATE TABLE phpbb_notifications ( - notification_id int(10) UNSIGNED NOT NULL auto_increment, - notification_type_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - item_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - item_parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - notification_read tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - notification_time int(11) UNSIGNED DEFAULT '1' NOT NULL, - notification_data blob NOT NULL, - PRIMARY KEY (notification_id), - KEY item_ident (notification_type_id, item_id), - KEY user (user_id, notification_read) -); - - -# Table: 'phpbb_oauth_accounts' -CREATE TABLE phpbb_oauth_accounts ( - user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - provider varbinary(255) DEFAULT '' NOT NULL, - oauth_provider_id blob NOT NULL, - PRIMARY KEY (user_id, provider) -); - - -# Table: 'phpbb_oauth_tokens' -CREATE TABLE phpbb_oauth_tokens ( - user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - session_id binary(32) DEFAULT '' NOT NULL, - provider varbinary(255) DEFAULT '' NOT NULL, - oauth_token mediumblob NOT NULL, - KEY user_id (user_id), - KEY provider (provider) -); - - -# 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_visibility tinyint(3) DEFAULT '0' 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, - post_delete_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - post_delete_reason blob NOT NULL, - post_delete_user mediumint(8) 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_visibility (post_visibility), - KEY post_username (post_username(255)), - 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, - message_reported tinyint(1) UNSIGNED DEFAULT '0' 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 varbinary(100) DEFAULT '' 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_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - field_show_on_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - field_show_on_ml tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - field_show_profile 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, - field_is_contact tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - field_contact_desc varbinary(255) DEFAULT '' NOT NULL, - field_contact_url varbinary(255) DEFAULT '' 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, - pf_phpbb_location varbinary(255) DEFAULT '' NOT NULL, - pf_phpbb_interests blob NOT NULL, - pf_phpbb_occupation blob NOT NULL, - pf_phpbb_icq varbinary(255) DEFAULT '' NOT NULL, - pf_phpbb_aol varbinary(255) DEFAULT '' NOT NULL, - pf_phpbb_wlm varbinary(255) DEFAULT '' NOT NULL, - pf_phpbb_yahoo varbinary(255) DEFAULT '' NOT NULL, - pf_phpbb_website varbinary(255) DEFAULT '' 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 varbinary(100) DEFAULT '' 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, - pm_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, - reported_post_text mediumblob NOT NULL, - reported_post_uid varbinary(8) DEFAULT '' NOT NULL, - reported_post_bitfield varbinary(255) DEFAULT '' NOT NULL, - reported_post_enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - reported_post_enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - reported_post_enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - PRIMARY KEY (report_id), - KEY post_id (post_id), - KEY pm_id (pm_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_forum_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), - KEY session_fid (session_forum_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 mediumint(8) UNSIGNED NOT NULL auto_increment, - style_name blob NOT NULL, - style_copyright blob NOT NULL, - style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - style_path varbinary(100) DEFAULT '' NOT NULL, - bbcode_bitfield varbinary(255) DEFAULT 'kNg=' NOT NULL, - style_parent_id int(4) UNSIGNED DEFAULT '0' NOT NULL, - style_parent_tree blob NOT NULL, - PRIMARY KEY (style_id), - UNIQUE style_name (style_name(255)) -); - - -# Table: 'phpbb_teampage' -CREATE TABLE phpbb_teampage ( - teampage_id mediumint(8) UNSIGNED NOT NULL auto_increment, - group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - teampage_name blob NOT NULL, - teampage_position mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - teampage_parent mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - PRIMARY KEY (teampage_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_visibility tinyint(3) DEFAULT '0' 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_posts_approved mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - topic_posts_unapproved mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - topic_posts_softdeleted 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, - topic_delete_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - topic_delete_reason blob NOT NULL, - topic_delete_user mediumint(8) 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_visibility (topic_visibility), - KEY forum_appr_last (forum_id, topic_visibility, 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 topic_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_notifications' -CREATE TABLE phpbb_user_notifications ( - item_type varbinary(255) DEFAULT '' NOT NULL, - item_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - method varbinary(255) DEFAULT '' NOT NULL, - notify tinyint(1) UNSIGNED DEFAULT '1' NOT NULL -); - - -# 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 blob NOT NULL, - user_passchg int(11) UNSIGNED DEFAULT '0' NOT NULL, - user_pass_convert tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - user_actkey varbinary(32) DEFAULT '' NOT NULL, - user_newpasswd blob 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 varbinary(100) DEFAULT 'UTC' NOT NULL, - user_dateformat varbinary(90) DEFAULT 'd M Y H:i' NOT NULL, - user_style mediumint(8) 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 '230271' NOT NULL, - user_avatar varbinary(255) DEFAULT '' NOT NULL, - user_avatar_type varbinary(255) DEFAULT '' 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_jabber blob NOT NULL, - user_form_salt varbinary(96) DEFAULT '' NOT NULL, - user_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - user_reminded tinyint(4) DEFAULT '0' NOT NULL, - user_reminded_time int(11) UNSIGNED DEFAULT '0' 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) -); - - diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 8119d4cd93..28649dc54c 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -3,1082 +3,3 @@ # To change the contents of this file, edit # phpBB/develop/create_schema_files.php and # run it. -# 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 varchar(255) DEFAULT '' NOT NULL, - real_filename varchar(255) DEFAULT '' NOT NULL, - download_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - attach_comment text NOT NULL, - extension varchar(100) DEFAULT '' NOT NULL, - mimetype varchar(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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_acl_options' -CREATE TABLE phpbb_acl_options ( - auth_option_id mediumint(8) UNSIGNED NOT NULL auto_increment, - auth_option varchar(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), - UNIQUE auth_option (auth_option) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_acl_roles' -CREATE TABLE phpbb_acl_roles ( - role_id mediumint(8) UNSIGNED NOT NULL auto_increment, - role_name varchar(255) DEFAULT '' NOT NULL, - role_description text NOT NULL, - role_type varchar(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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 varchar(40) DEFAULT '' NOT NULL, - ban_email varchar(100) DEFAULT '' 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 varchar(255) DEFAULT '' NOT NULL, - ban_give_reason varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (ban_id), - KEY ban_end (ban_end), - KEY ban_user (ban_userid, ban_exclude), - KEY ban_email (ban_email, ban_exclude), - KEY ban_ip (ban_ip, ban_exclude) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_bbcodes' -CREATE TABLE phpbb_bbcodes ( - bbcode_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - bbcode_tag varchar(16) DEFAULT '' NOT NULL, - bbcode_helpline varchar(255) DEFAULT '' NOT NULL, - display_on_posting tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - bbcode_match text NOT NULL, - bbcode_tpl mediumtext NOT NULL, - first_pass_match mediumtext NOT NULL, - first_pass_replace mediumtext NOT NULL, - second_pass_match mediumtext NOT NULL, - second_pass_replace mediumtext NOT NULL, - PRIMARY KEY (bbcode_id), - KEY display_on_post (display_on_posting) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 varchar(255) DEFAULT '' NOT NULL, - user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - bot_agent varchar(255) DEFAULT '' NOT NULL, - bot_ip varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (bot_id), - KEY bot_active (bot_active) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_config' -CREATE TABLE phpbb_config ( - config_name varchar(255) DEFAULT '' NOT NULL, - config_value varchar(255) DEFAULT '' NOT NULL, - is_dynamic tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - PRIMARY KEY (config_name), - KEY is_dynamic (is_dynamic) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_config_text' -CREATE TABLE phpbb_config_text ( - config_name varchar(255) DEFAULT '' NOT NULL, - config_value mediumtext NOT NULL, - PRIMARY KEY (config_name) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_confirm' -CREATE TABLE phpbb_confirm ( - confirm_id char(32) DEFAULT '' NOT NULL, - session_id char(32) DEFAULT '' NOT NULL, - confirm_type tinyint(3) DEFAULT '0' NOT NULL, - code varchar(8) DEFAULT '' NOT NULL, - seed int(10) UNSIGNED DEFAULT '0' NOT NULL, - attempts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - PRIMARY KEY (session_id, confirm_id), - KEY confirm_type (confirm_type) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_disallow' -CREATE TABLE phpbb_disallow ( - disallow_id mediumint(8) UNSIGNED NOT NULL auto_increment, - disallow_username varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (disallow_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 varchar(255) DEFAULT '' NOT NULL, - draft_message mediumtext NOT NULL, - PRIMARY KEY (draft_id), - KEY save_time (save_time) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_ext' -CREATE TABLE phpbb_ext ( - ext_name varchar(255) DEFAULT '' NOT NULL, - ext_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - ext_state text NOT NULL, - UNIQUE ext_name (ext_name) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 varchar(100) DEFAULT '' NOT NULL, - PRIMARY KEY (extension_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_extension_groups' -CREATE TABLE phpbb_extension_groups ( - group_id mediumint(8) UNSIGNED NOT NULL auto_increment, - group_name varchar(255) DEFAULT '' 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 varchar(255) DEFAULT '' NOT NULL, - max_filesize int(20) UNSIGNED DEFAULT '0' NOT NULL, - allowed_forums text NOT NULL, - allow_in_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - PRIMARY KEY (group_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 mediumtext NOT NULL, - forum_name varchar(255) DEFAULT '' NOT NULL, - forum_desc text NOT NULL, - forum_desc_bitfield varchar(255) DEFAULT '' NOT NULL, - forum_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL, - forum_desc_uid varchar(8) DEFAULT '' NOT NULL, - forum_link varchar(255) DEFAULT '' NOT NULL, - forum_password varchar(255) DEFAULT '' NOT NULL, - forum_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - forum_image varchar(255) DEFAULT '' NOT NULL, - forum_rules text NOT NULL, - forum_rules_link varchar(255) DEFAULT '' NOT NULL, - forum_rules_bitfield varchar(255) DEFAULT '' NOT NULL, - forum_rules_options int(11) UNSIGNED DEFAULT '7' NOT NULL, - forum_rules_uid varchar(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_approved mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - forum_posts_unapproved mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - forum_posts_softdeleted mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - forum_topics_approved mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - forum_topics_unapproved mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - forum_topics_softdeleted 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 varchar(255) DEFAULT '' NOT NULL, - forum_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - forum_last_poster_name varchar(255) DEFAULT '' NOT NULL, - forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL, - forum_flags tinyint(4) DEFAULT '32' NOT NULL, - forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL, - display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 char(32) DEFAULT '' NOT NULL, - PRIMARY KEY (forum_id, user_id, session_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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_skip_auth tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - group_name varchar(255) DEFAULT '' NOT NULL, - group_desc text NOT NULL, - group_desc_bitfield varchar(255) DEFAULT '' NOT NULL, - group_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL, - group_desc_uid varchar(8) DEFAULT '' NOT NULL, - group_display tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - group_avatar varchar(255) DEFAULT '' NOT NULL, - group_avatar_type varchar(255) DEFAULT '' 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 varchar(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_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - group_legend mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - PRIMARY KEY (group_id), - KEY group_legend_name (group_legend, group_name) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_icons' -CREATE TABLE phpbb_icons ( - icons_id mediumint(8) UNSIGNED NOT NULL auto_increment, - icons_url varchar(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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_lang' -CREATE TABLE phpbb_lang ( - lang_id tinyint(4) NOT NULL auto_increment, - lang_iso varchar(30) DEFAULT '' NOT NULL, - lang_dir varchar(30) DEFAULT '' NOT NULL, - lang_english_name varchar(100) DEFAULT '' NOT NULL, - lang_local_name varchar(255) DEFAULT '' NOT NULL, - lang_author varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (lang_id), - KEY lang_iso (lang_iso) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 varchar(40) DEFAULT '' NOT NULL, - log_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - log_operation text NOT NULL, - log_data mediumtext NOT NULL, - PRIMARY KEY (log_id), - KEY log_type (log_type), - KEY log_time (log_time), - KEY forum_id (forum_id), - KEY topic_id (topic_id), - KEY reportee_id (reportee_id), - KEY user_id (user_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_login_attempts' -CREATE TABLE phpbb_login_attempts ( - attempt_ip varchar(40) DEFAULT '' NOT NULL, - attempt_browser varchar(150) DEFAULT '' NOT NULL, - attempt_forwarded_for varchar(255) DEFAULT '' NOT NULL, - attempt_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - username varchar(255) DEFAULT '0' NOT NULL, - username_clean varchar(255) DEFAULT '0' NOT NULL, - KEY att_ip (attempt_ip, attempt_time), - KEY att_for (attempt_forwarded_for, attempt_time), - KEY att_time (attempt_time), - KEY user_id (user_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 varchar(255) DEFAULT '' NOT NULL, - group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - group_name varchar(255) DEFAULT '' NOT NULL, - display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - KEY disp_idx (display_on_index), - KEY forum_id (forum_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_migrations' -CREATE TABLE phpbb_migrations ( - migration_name varchar(255) DEFAULT '' NOT NULL, - migration_depends_on text NOT NULL, - migration_schema_done tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - migration_data_done tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - migration_data_state text NOT NULL, - migration_start_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - migration_end_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - PRIMARY KEY (migration_name) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 varchar(255) DEFAULT '' NOT NULL, - module_class varchar(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 varchar(255) DEFAULT '' NOT NULL, - module_mode varchar(255) DEFAULT '' NOT NULL, - module_auth varchar(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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_notification_types' -CREATE TABLE phpbb_notification_types ( - notification_type_id smallint(4) UNSIGNED NOT NULL auto_increment, - notification_type_name varchar(255) DEFAULT '' NOT NULL, - notification_type_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - PRIMARY KEY (notification_type_id), - UNIQUE type (notification_type_name) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_notifications' -CREATE TABLE phpbb_notifications ( - notification_id int(10) UNSIGNED NOT NULL auto_increment, - notification_type_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - item_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - item_parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - notification_read tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - notification_time int(11) UNSIGNED DEFAULT '1' NOT NULL, - notification_data text NOT NULL, - PRIMARY KEY (notification_id), - KEY item_ident (notification_type_id, item_id), - KEY user (user_id, notification_read) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_oauth_accounts' -CREATE TABLE phpbb_oauth_accounts ( - user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - provider varchar(255) DEFAULT '' NOT NULL, - oauth_provider_id text NOT NULL, - PRIMARY KEY (user_id, provider) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_oauth_tokens' -CREATE TABLE phpbb_oauth_tokens ( - user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - session_id char(32) DEFAULT '' NOT NULL, - provider varchar(255) DEFAULT '' NOT NULL, - oauth_token mediumtext NOT NULL, - KEY user_id (user_id), - KEY provider (provider) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 text NOT NULL, - poll_option_total mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - KEY poll_opt_id (poll_option_id), - KEY topic_id (topic_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 varchar(40) DEFAULT '' NOT NULL, - KEY topic_id (topic_id), - KEY vote_user_id (vote_user_id), - KEY vote_user_ip (vote_user_ip) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 varchar(40) DEFAULT '' NOT NULL, - post_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - post_visibility tinyint(3) DEFAULT '0' 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 varchar(255) DEFAULT '' NOT NULL, - post_subject varchar(255) DEFAULT '' NOT NULL COLLATE utf8_unicode_ci, - post_text mediumtext NOT NULL, - post_checksum varchar(32) DEFAULT '' NOT NULL, - post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, - bbcode_uid varchar(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 varchar(255) DEFAULT '' 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, - post_delete_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - post_delete_reason varchar(255) DEFAULT '' NOT NULL, - post_delete_user mediumint(8) 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_visibility (post_visibility), - KEY post_username (post_username), - KEY tid_post_time (topic_id, post_time) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 varchar(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 varchar(255) DEFAULT '' NOT NULL, - message_text mediumtext NOT NULL, - message_edit_reason varchar(255) DEFAULT '' NOT NULL, - message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - message_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, - bbcode_uid varchar(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 text NOT NULL, - bcc_address text NOT NULL, - message_reported tinyint(1) UNSIGNED DEFAULT '0' 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 varchar(255) DEFAULT '' NOT NULL, - pm_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - PRIMARY KEY (folder_id), - KEY user_id (user_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 varchar(255) DEFAULT '' 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_profile_fields' -CREATE TABLE phpbb_profile_fields ( - field_id mediumint(8) UNSIGNED NOT NULL auto_increment, - field_name varchar(255) DEFAULT '' NOT NULL, - field_type varchar(100) DEFAULT '' NOT NULL, - field_ident varchar(20) DEFAULT '' NOT NULL, - field_length varchar(20) DEFAULT '' NOT NULL, - field_minlen varchar(255) DEFAULT '' NOT NULL, - field_maxlen varchar(255) DEFAULT '' NOT NULL, - field_novalue varchar(255) DEFAULT '' NOT NULL, - field_default_value varchar(255) DEFAULT '' NOT NULL, - field_validation varchar(20) DEFAULT '' NOT NULL, - field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - field_show_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - field_show_on_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - field_show_on_ml tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - field_show_profile 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, - field_is_contact tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - field_contact_desc varchar(255) DEFAULT '' NOT NULL, - field_contact_url varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (field_id), - KEY fld_type (field_type), - KEY fld_ordr (field_order) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_profile_fields_data' -CREATE TABLE phpbb_profile_fields_data ( - user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - pf_phpbb_location varchar(255) DEFAULT '' NOT NULL, - pf_phpbb_interests text NOT NULL, - pf_phpbb_occupation text NOT NULL, - pf_phpbb_icq varchar(255) DEFAULT '' NOT NULL, - pf_phpbb_aol varchar(255) DEFAULT '' NOT NULL, - pf_phpbb_wlm varchar(255) DEFAULT '' NOT NULL, - pf_phpbb_yahoo varchar(255) DEFAULT '' NOT NULL, - pf_phpbb_website varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (user_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 varchar(100) DEFAULT '' NOT NULL, - lang_value varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (field_id, lang_id, option_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 varchar(255) DEFAULT '' NOT NULL, - lang_explain text NOT NULL, - lang_default_value varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (field_id, lang_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_ranks' -CREATE TABLE phpbb_ranks ( - rank_id mediumint(8) UNSIGNED NOT NULL auto_increment, - rank_title varchar(255) DEFAULT '' NOT NULL, - rank_min mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - rank_special tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - rank_image varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (rank_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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, - pm_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 mediumtext NOT NULL, - reported_post_text mediumtext NOT NULL, - reported_post_uid varchar(8) DEFAULT '' NOT NULL, - reported_post_bitfield varchar(255) DEFAULT '' NOT NULL, - reported_post_enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - reported_post_enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - reported_post_enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - PRIMARY KEY (report_id), - KEY post_id (post_id), - KEY pm_id (pm_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_reports_reasons' -CREATE TABLE phpbb_reports_reasons ( - reason_id smallint(4) UNSIGNED NOT NULL auto_increment, - reason_title varchar(255) DEFAULT '' NOT NULL, - reason_description mediumtext NOT NULL, - reason_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - PRIMARY KEY (reason_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_search_results' -CREATE TABLE phpbb_search_results ( - search_key varchar(32) DEFAULT '' NOT NULL, - search_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - search_keywords mediumtext NOT NULL, - search_authors mediumtext NOT NULL, - PRIMARY KEY (search_key) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_search_wordlist' -CREATE TABLE phpbb_search_wordlist ( - word_id mediumint(8) UNSIGNED NOT NULL auto_increment, - word_text varchar(255) DEFAULT '' 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), - KEY wrd_cnt (word_count) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_sessions' -CREATE TABLE phpbb_sessions ( - session_id char(32) DEFAULT '' NOT NULL, - session_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - session_forum_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 varchar(40) DEFAULT '' NOT NULL, - session_browser varchar(150) DEFAULT '' NOT NULL, - session_forwarded_for varchar(255) DEFAULT '' NOT NULL, - session_page varchar(255) DEFAULT '' 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), - KEY session_fid (session_forum_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_sessions_keys' -CREATE TABLE phpbb_sessions_keys ( - key_id char(32) DEFAULT '' NOT NULL, - user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - last_ip varchar(40) DEFAULT '' NOT NULL, - last_login int(11) UNSIGNED DEFAULT '0' NOT NULL, - PRIMARY KEY (key_id, user_id), - KEY last_login (last_login) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_sitelist' -CREATE TABLE phpbb_sitelist ( - site_id mediumint(8) UNSIGNED NOT NULL auto_increment, - site_ip varchar(40) DEFAULT '' NOT NULL, - site_hostname varchar(255) DEFAULT '' NOT NULL, - ip_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - PRIMARY KEY (site_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_smilies' -CREATE TABLE phpbb_smilies ( - smiley_id mediumint(8) UNSIGNED NOT NULL auto_increment, - code varchar(50) DEFAULT '' NOT NULL, - emotion varchar(50) DEFAULT '' NOT NULL, - smiley_url varchar(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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_styles' -CREATE TABLE phpbb_styles ( - style_id mediumint(8) UNSIGNED NOT NULL auto_increment, - style_name varchar(255) DEFAULT '' NOT NULL, - style_copyright varchar(255) DEFAULT '' NOT NULL, - style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - style_path varchar(100) DEFAULT '' NOT NULL, - bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL, - style_parent_id int(4) UNSIGNED DEFAULT '0' NOT NULL, - style_parent_tree text NOT NULL, - PRIMARY KEY (style_id), - UNIQUE style_name (style_name) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_teampage' -CREATE TABLE phpbb_teampage ( - teampage_id mediumint(8) UNSIGNED NOT NULL auto_increment, - group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - teampage_name varchar(255) DEFAULT '' NOT NULL, - teampage_position mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - teampage_parent mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - PRIMARY KEY (teampage_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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_visibility tinyint(3) DEFAULT '0' NOT NULL, - topic_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - topic_title varchar(255) DEFAULT '' NOT NULL COLLATE utf8_unicode_ci, - 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_posts_approved mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - topic_posts_unapproved mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - topic_posts_softdeleted 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 varchar(255) DEFAULT '' NOT NULL, - topic_first_poster_colour varchar(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 varchar(255) DEFAULT '' NOT NULL, - topic_last_poster_colour varchar(6) DEFAULT '' NOT NULL, - topic_last_post_subject varchar(255) DEFAULT '' 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 varchar(255) DEFAULT '' 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, - topic_delete_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - topic_delete_reason varchar(255) DEFAULT '' NOT NULL, - topic_delete_user mediumint(8) 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_visibility (topic_visibility), - KEY forum_appr_last (forum_id, topic_visibility, topic_last_post_id), - KEY fid_time_moved (forum_id, topic_last_post_time, topic_moved_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 topic_id (topic_id), - KEY forum_id (forum_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_user_notifications' -CREATE TABLE phpbb_user_notifications ( - item_type varchar(255) DEFAULT '' NOT NULL, - item_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - method varchar(255) DEFAULT '' NOT NULL, - notify tinyint(1) UNSIGNED DEFAULT '1' NOT NULL -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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 mediumtext NOT NULL, - user_perm_from mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - user_ip varchar(40) DEFAULT '' NOT NULL, - user_regdate int(11) UNSIGNED DEFAULT '0' NOT NULL, - username varchar(255) DEFAULT '' NOT NULL, - username_clean varchar(255) DEFAULT '' NOT NULL, - user_password varchar(255) DEFAULT '' NOT NULL, - user_passchg int(11) UNSIGNED DEFAULT '0' NOT NULL, - user_pass_convert tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - user_actkey varchar(32) DEFAULT '' NOT NULL, - user_newpasswd varchar(255) DEFAULT '' NOT NULL, - user_email varchar(100) DEFAULT '' NOT NULL, - user_email_hash bigint(20) DEFAULT '0' NOT NULL, - user_birthday varchar(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 varchar(200) DEFAULT '' NOT NULL, - user_last_confirm_key varchar(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 varchar(30) DEFAULT '' NOT NULL, - user_timezone varchar(100) DEFAULT 'UTC' NOT NULL, - user_dateformat varchar(30) DEFAULT 'd M Y H:i' NOT NULL, - user_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - user_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - user_colour varchar(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 varchar(1) DEFAULT 't' NOT NULL, - user_topic_sortby_dir varchar(1) DEFAULT 'd' NOT NULL, - user_post_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - user_post_sortby_type varchar(1) DEFAULT 't' NOT NULL, - user_post_sortby_dir varchar(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 '230271' NOT NULL, - user_avatar varchar(255) DEFAULT '' NOT NULL, - user_avatar_type varchar(255) DEFAULT '' NOT NULL, - user_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - user_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - user_sig mediumtext NOT NULL, - user_sig_bbcode_uid varchar(8) DEFAULT '' NOT NULL, - user_sig_bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, - user_jabber varchar(255) DEFAULT '' NOT NULL, - user_form_salt varchar(32) DEFAULT '' NOT NULL, - user_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - user_reminded tinyint(4) DEFAULT '0' NOT NULL, - user_reminded_time int(11) UNSIGNED DEFAULT '0' 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# Table: 'phpbb_words' -CREATE TABLE phpbb_words ( - word_id mediumint(8) UNSIGNED NOT NULL auto_increment, - word varchar(255) DEFAULT '' NOT NULL, - replacement varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (word_id) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - -# 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) -) CHARACTER SET `utf8` COLLATE `utf8_bin`; - - diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index b1f39da7bc..61f5d5f961 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -43,1927 +43,3 @@ DISCONNECT; CONNECT phpbb/phpbb_password; */ -/* - Table: 'phpbb_attachments' -*/ -CREATE TABLE phpbb_attachments ( - attach_id number(8) NOT NULL, - post_msg_id number(8) DEFAULT '0' NOT NULL, - topic_id number(8) DEFAULT '0' NOT NULL, - in_message number(1) DEFAULT '0' NOT NULL, - poster_id number(8) DEFAULT '0' NOT NULL, - is_orphan number(1) DEFAULT '1' NOT NULL, - physical_filename varchar2(255) DEFAULT '' , - real_filename varchar2(255) DEFAULT '' , - download_count number(8) DEFAULT '0' NOT NULL, - attach_comment clob DEFAULT '' , - extension varchar2(100) DEFAULT '' , - mimetype varchar2(100) DEFAULT '' , - filesize number(20) DEFAULT '0' NOT NULL, - filetime number(11) DEFAULT '0' NOT NULL, - thumbnail number(1) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_attachments PRIMARY KEY (attach_id) -) -/ - -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_topic_id ON phpbb_attachments (topic_id) -/ -CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id) -/ -CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments (is_orphan) -/ - -CREATE SEQUENCE phpbb_attachments_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_attachments -BEFORE INSERT ON phpbb_attachments -FOR EACH ROW WHEN ( - new.attach_id IS NULL OR new.attach_id = 0 -) -BEGIN - SELECT phpbb_attachments_seq.nextval - INTO :new.attach_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_acl_groups' -*/ -CREATE TABLE phpbb_acl_groups ( - group_id number(8) DEFAULT '0' NOT NULL, - forum_id number(8) DEFAULT '0' NOT NULL, - auth_option_id number(8) DEFAULT '0' NOT NULL, - auth_role_id number(8) DEFAULT '0' NOT NULL, - auth_setting number(2) DEFAULT '0' NOT NULL -) -/ - -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_role_id ON phpbb_acl_groups (auth_role_id) -/ - -/* - Table: 'phpbb_acl_options' -*/ -CREATE TABLE phpbb_acl_options ( - auth_option_id number(8) NOT NULL, - auth_option varchar2(50) DEFAULT '' , - is_global number(1) DEFAULT '0' NOT NULL, - is_local number(1) DEFAULT '0' NOT NULL, - founder_only number(1) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_acl_options PRIMARY KEY (auth_option_id), - CONSTRAINT u_phpbb_auth_option UNIQUE (auth_option) -) -/ - - -CREATE SEQUENCE phpbb_acl_options_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_acl_options -BEFORE INSERT ON phpbb_acl_options -FOR EACH ROW WHEN ( - new.auth_option_id IS NULL OR new.auth_option_id = 0 -) -BEGIN - SELECT phpbb_acl_options_seq.nextval - INTO :new.auth_option_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_acl_roles' -*/ -CREATE TABLE phpbb_acl_roles ( - role_id number(8) NOT NULL, - role_name varchar2(765) DEFAULT '' , - role_description clob DEFAULT '' , - role_type varchar2(10) DEFAULT '' , - role_order number(4) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_acl_roles PRIMARY KEY (role_id) -) -/ - -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 SEQUENCE phpbb_acl_roles_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_acl_roles -BEFORE INSERT ON phpbb_acl_roles -FOR EACH ROW WHEN ( - new.role_id IS NULL OR new.role_id = 0 -) -BEGIN - SELECT phpbb_acl_roles_seq.nextval - INTO :new.role_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_acl_roles_data' -*/ -CREATE TABLE phpbb_acl_roles_data ( - role_id number(8) DEFAULT '0' NOT NULL, - auth_option_id number(8) DEFAULT '0' NOT NULL, - auth_setting number(2) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_acl_roles_data PRIMARY KEY (role_id, auth_option_id) -) -/ - -CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id) -/ - -/* - Table: 'phpbb_acl_users' -*/ -CREATE TABLE phpbb_acl_users ( - user_id number(8) DEFAULT '0' NOT NULL, - forum_id number(8) DEFAULT '0' NOT NULL, - auth_option_id number(8) DEFAULT '0' NOT NULL, - auth_role_id number(8) DEFAULT '0' NOT NULL, - auth_setting number(2) DEFAULT '0' NOT NULL -) -/ - -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_role_id ON phpbb_acl_users (auth_role_id) -/ - -/* - Table: 'phpbb_banlist' -*/ -CREATE TABLE phpbb_banlist ( - ban_id number(8) NOT NULL, - ban_userid number(8) DEFAULT '0' NOT NULL, - ban_ip varchar2(40) DEFAULT '' , - ban_email varchar2(300) DEFAULT '' , - ban_start number(11) DEFAULT '0' NOT NULL, - ban_end number(11) DEFAULT '0' NOT NULL, - ban_exclude number(1) DEFAULT '0' NOT NULL, - ban_reason varchar2(765) DEFAULT '' , - ban_give_reason varchar2(765) DEFAULT '' , - CONSTRAINT pk_phpbb_banlist PRIMARY KEY (ban_id) -) -/ - -CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end) -/ -CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist (ban_userid, ban_exclude) -/ -CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist (ban_email, ban_exclude) -/ -CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist (ban_ip, ban_exclude) -/ - -CREATE SEQUENCE phpbb_banlist_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_banlist -BEFORE INSERT ON phpbb_banlist -FOR EACH ROW WHEN ( - new.ban_id IS NULL OR new.ban_id = 0 -) -BEGIN - SELECT phpbb_banlist_seq.nextval - INTO :new.ban_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_bbcodes' -*/ -CREATE TABLE phpbb_bbcodes ( - bbcode_id number(4) DEFAULT '0' NOT NULL, - bbcode_tag varchar2(16) DEFAULT '' , - bbcode_helpline varchar2(765) DEFAULT '' , - display_on_posting number(1) DEFAULT '0' NOT NULL, - bbcode_match clob DEFAULT '' , - bbcode_tpl clob DEFAULT '' , - first_pass_match clob DEFAULT '' , - first_pass_replace clob DEFAULT '' , - second_pass_match clob DEFAULT '' , - second_pass_replace clob DEFAULT '' , - CONSTRAINT pk_phpbb_bbcodes PRIMARY KEY (bbcode_id) -) -/ - -CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting) -/ - -/* - Table: 'phpbb_bookmarks' -*/ -CREATE TABLE phpbb_bookmarks ( - topic_id number(8) DEFAULT '0' NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_bookmarks PRIMARY KEY (topic_id, user_id) -) -/ - - -/* - Table: 'phpbb_bots' -*/ -CREATE TABLE phpbb_bots ( - bot_id number(8) NOT NULL, - bot_active number(1) DEFAULT '1' NOT NULL, - bot_name varchar2(765) DEFAULT '' , - user_id number(8) DEFAULT '0' NOT NULL, - bot_agent varchar2(255) DEFAULT '' , - bot_ip varchar2(255) DEFAULT '' , - CONSTRAINT pk_phpbb_bots PRIMARY KEY (bot_id) -) -/ - -CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active) -/ - -CREATE SEQUENCE phpbb_bots_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_bots -BEFORE INSERT ON phpbb_bots -FOR EACH ROW WHEN ( - new.bot_id IS NULL OR new.bot_id = 0 -) -BEGIN - SELECT phpbb_bots_seq.nextval - INTO :new.bot_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_config' -*/ -CREATE TABLE phpbb_config ( - config_name varchar2(255) DEFAULT '' , - config_value varchar2(765) DEFAULT '' , - is_dynamic number(1) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_config PRIMARY KEY (config_name) -) -/ - -CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic) -/ - -/* - Table: 'phpbb_config_text' -*/ -CREATE TABLE phpbb_config_text ( - config_name varchar2(255) DEFAULT '' , - config_value clob DEFAULT '' , - CONSTRAINT pk_phpbb_config_text PRIMARY KEY (config_name) -) -/ - - -/* - Table: 'phpbb_confirm' -*/ -CREATE TABLE phpbb_confirm ( - confirm_id char(32) DEFAULT '' , - session_id char(32) DEFAULT '' , - confirm_type number(3) DEFAULT '0' NOT NULL, - code varchar2(8) DEFAULT '' , - seed number(10) DEFAULT '0' NOT NULL, - attempts number(8) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_confirm PRIMARY KEY (session_id, confirm_id) -) -/ - -CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm (confirm_type) -/ - -/* - Table: 'phpbb_disallow' -*/ -CREATE TABLE phpbb_disallow ( - disallow_id number(8) NOT NULL, - disallow_username varchar2(765) DEFAULT '' , - CONSTRAINT pk_phpbb_disallow PRIMARY KEY (disallow_id) -) -/ - - -CREATE SEQUENCE phpbb_disallow_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_disallow -BEFORE INSERT ON phpbb_disallow -FOR EACH ROW WHEN ( - new.disallow_id IS NULL OR new.disallow_id = 0 -) -BEGIN - SELECT phpbb_disallow_seq.nextval - INTO :new.disallow_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_drafts' -*/ -CREATE TABLE phpbb_drafts ( - draft_id number(8) NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - topic_id number(8) DEFAULT '0' NOT NULL, - forum_id number(8) DEFAULT '0' NOT NULL, - save_time number(11) DEFAULT '0' NOT NULL, - draft_subject varchar2(765) DEFAULT '' , - draft_message clob DEFAULT '' , - CONSTRAINT pk_phpbb_drafts PRIMARY KEY (draft_id) -) -/ - -CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time) -/ - -CREATE SEQUENCE phpbb_drafts_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_drafts -BEFORE INSERT ON phpbb_drafts -FOR EACH ROW WHEN ( - new.draft_id IS NULL OR new.draft_id = 0 -) -BEGIN - SELECT phpbb_drafts_seq.nextval - INTO :new.draft_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_ext' -*/ -CREATE TABLE phpbb_ext ( - ext_name varchar2(255) DEFAULT '' , - ext_active number(1) DEFAULT '0' NOT NULL, - ext_state clob DEFAULT '' , - CONSTRAINT u_phpbb_ext_name UNIQUE (ext_name) -) -/ - - -/* - Table: 'phpbb_extensions' -*/ -CREATE TABLE phpbb_extensions ( - extension_id number(8) NOT NULL, - group_id number(8) DEFAULT '0' NOT NULL, - extension varchar2(100) DEFAULT '' , - CONSTRAINT pk_phpbb_extensions PRIMARY KEY (extension_id) -) -/ - - -CREATE SEQUENCE phpbb_extensions_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_extensions -BEFORE INSERT ON phpbb_extensions -FOR EACH ROW WHEN ( - new.extension_id IS NULL OR new.extension_id = 0 -) -BEGIN - SELECT phpbb_extensions_seq.nextval - INTO :new.extension_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_extension_groups' -*/ -CREATE TABLE phpbb_extension_groups ( - group_id number(8) NOT NULL, - group_name varchar2(765) DEFAULT '' , - cat_id number(2) DEFAULT '0' NOT NULL, - allow_group number(1) DEFAULT '0' NOT NULL, - download_mode number(1) DEFAULT '1' NOT NULL, - upload_icon varchar2(255) DEFAULT '' , - max_filesize number(20) DEFAULT '0' NOT NULL, - allowed_forums clob DEFAULT '' , - allow_in_pm number(1) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_extension_groups PRIMARY KEY (group_id) -) -/ - - -CREATE SEQUENCE phpbb_extension_groups_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_extension_groups -BEFORE INSERT ON phpbb_extension_groups -FOR EACH ROW WHEN ( - new.group_id IS NULL OR new.group_id = 0 -) -BEGIN - SELECT phpbb_extension_groups_seq.nextval - INTO :new.group_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_forums' -*/ -CREATE TABLE phpbb_forums ( - forum_id number(8) NOT NULL, - parent_id number(8) DEFAULT '0' NOT NULL, - left_id number(8) DEFAULT '0' NOT NULL, - right_id number(8) DEFAULT '0' NOT NULL, - forum_parents clob DEFAULT '' , - forum_name varchar2(765) DEFAULT '' , - forum_desc clob DEFAULT '' , - forum_desc_bitfield varchar2(255) DEFAULT '' , - forum_desc_options number(11) DEFAULT '7' NOT NULL, - forum_desc_uid varchar2(8) DEFAULT '' , - forum_link varchar2(765) DEFAULT '' , - forum_password varchar2(765) DEFAULT '' , - forum_style number(8) DEFAULT '0' NOT NULL, - forum_image varchar2(255) DEFAULT '' , - forum_rules clob DEFAULT '' , - forum_rules_link varchar2(765) DEFAULT '' , - forum_rules_bitfield varchar2(255) DEFAULT '' , - forum_rules_options number(11) DEFAULT '7' NOT NULL, - forum_rules_uid varchar2(8) DEFAULT '' , - forum_topics_per_page number(4) DEFAULT '0' NOT NULL, - forum_type number(4) DEFAULT '0' NOT NULL, - forum_status number(4) DEFAULT '0' NOT NULL, - forum_posts_approved number(8) DEFAULT '0' NOT NULL, - forum_posts_unapproved number(8) DEFAULT '0' NOT NULL, - forum_posts_softdeleted number(8) DEFAULT '0' NOT NULL, - forum_topics_approved number(8) DEFAULT '0' NOT NULL, - forum_topics_unapproved number(8) DEFAULT '0' NOT NULL, - forum_topics_softdeleted number(8) DEFAULT '0' NOT NULL, - forum_last_post_id number(8) DEFAULT '0' NOT NULL, - forum_last_poster_id number(8) DEFAULT '0' NOT NULL, - forum_last_post_subject varchar2(765) DEFAULT '' , - forum_last_post_time number(11) DEFAULT '0' NOT NULL, - forum_last_poster_name varchar2(765) DEFAULT '' , - forum_last_poster_colour varchar2(6) DEFAULT '' , - forum_flags number(4) DEFAULT '32' NOT NULL, - forum_options number(20) DEFAULT '0' NOT NULL, - display_subforum_list number(1) DEFAULT '1' NOT NULL, - display_on_index number(1) DEFAULT '1' NOT NULL, - enable_indexing number(1) DEFAULT '1' NOT NULL, - enable_icons number(1) DEFAULT '1' NOT NULL, - enable_prune number(1) DEFAULT '0' NOT NULL, - prune_next number(11) DEFAULT '0' NOT NULL, - prune_days number(8) DEFAULT '0' NOT NULL, - prune_viewed number(8) DEFAULT '0' NOT NULL, - prune_freq number(8) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_forums PRIMARY KEY (forum_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 SEQUENCE phpbb_forums_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_forums -BEFORE INSERT ON phpbb_forums -FOR EACH ROW WHEN ( - new.forum_id IS NULL OR new.forum_id = 0 -) -BEGIN - SELECT phpbb_forums_seq.nextval - INTO :new.forum_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_forums_access' -*/ -CREATE TABLE phpbb_forums_access ( - forum_id number(8) DEFAULT '0' NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - session_id char(32) DEFAULT '' , - CONSTRAINT pk_phpbb_forums_access PRIMARY KEY (forum_id, user_id, session_id) -) -/ - - -/* - Table: 'phpbb_forums_track' -*/ -CREATE TABLE phpbb_forums_track ( - user_id number(8) DEFAULT '0' NOT NULL, - forum_id number(8) DEFAULT '0' NOT NULL, - mark_time number(11) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_forums_track PRIMARY KEY (user_id, forum_id) -) -/ - - -/* - Table: 'phpbb_forums_watch' -*/ -CREATE TABLE phpbb_forums_watch ( - forum_id number(8) DEFAULT '0' NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - notify_status number(1) DEFAULT '0' NOT NULL -) -/ - -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_notify_stat ON phpbb_forums_watch (notify_status) -/ - -/* - Table: 'phpbb_groups' -*/ -CREATE TABLE phpbb_groups ( - group_id number(8) NOT NULL, - group_type number(4) DEFAULT '1' NOT NULL, - group_founder_manage number(1) DEFAULT '0' NOT NULL, - group_skip_auth number(1) DEFAULT '0' NOT NULL, - group_name varchar2(255) DEFAULT '' , - group_desc clob DEFAULT '' , - group_desc_bitfield varchar2(255) DEFAULT '' , - group_desc_options number(11) DEFAULT '7' NOT NULL, - group_desc_uid varchar2(8) DEFAULT '' , - group_display number(1) DEFAULT '0' NOT NULL, - group_avatar varchar2(255) DEFAULT '' , - group_avatar_type varchar2(255) DEFAULT '' , - group_avatar_width number(4) DEFAULT '0' NOT NULL, - group_avatar_height number(4) DEFAULT '0' NOT NULL, - group_rank number(8) DEFAULT '0' NOT NULL, - group_colour varchar2(6) DEFAULT '' , - group_sig_chars number(8) DEFAULT '0' NOT NULL, - group_receive_pm number(1) DEFAULT '0' NOT NULL, - group_message_limit number(8) DEFAULT '0' NOT NULL, - group_max_recipients number(8) DEFAULT '0' NOT NULL, - group_legend number(8) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_groups PRIMARY KEY (group_id) -) -/ - -CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name) -/ - -CREATE SEQUENCE phpbb_groups_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_groups -BEFORE INSERT ON phpbb_groups -FOR EACH ROW WHEN ( - new.group_id IS NULL OR new.group_id = 0 -) -BEGIN - SELECT phpbb_groups_seq.nextval - INTO :new.group_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_icons' -*/ -CREATE TABLE phpbb_icons ( - icons_id number(8) NOT NULL, - icons_url varchar2(255) DEFAULT '' , - icons_width number(4) DEFAULT '0' NOT NULL, - icons_height number(4) DEFAULT '0' NOT NULL, - icons_order number(8) DEFAULT '0' NOT NULL, - display_on_posting number(1) DEFAULT '1' NOT NULL, - CONSTRAINT pk_phpbb_icons PRIMARY KEY (icons_id) -) -/ - -CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons (display_on_posting) -/ - -CREATE SEQUENCE phpbb_icons_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_icons -BEFORE INSERT ON phpbb_icons -FOR EACH ROW WHEN ( - new.icons_id IS NULL OR new.icons_id = 0 -) -BEGIN - SELECT phpbb_icons_seq.nextval - INTO :new.icons_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_lang' -*/ -CREATE TABLE phpbb_lang ( - lang_id number(4) NOT NULL, - lang_iso varchar2(30) DEFAULT '' , - lang_dir varchar2(30) DEFAULT '' , - lang_english_name varchar2(300) DEFAULT '' , - lang_local_name varchar2(765) DEFAULT '' , - lang_author varchar2(765) DEFAULT '' , - CONSTRAINT pk_phpbb_lang PRIMARY KEY (lang_id) -) -/ - -CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang (lang_iso) -/ - -CREATE SEQUENCE phpbb_lang_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_lang -BEFORE INSERT ON phpbb_lang -FOR EACH ROW WHEN ( - new.lang_id IS NULL OR new.lang_id = 0 -) -BEGIN - SELECT phpbb_lang_seq.nextval - INTO :new.lang_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_log' -*/ -CREATE TABLE phpbb_log ( - log_id number(8) NOT NULL, - log_type number(4) DEFAULT '0' NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - forum_id number(8) DEFAULT '0' NOT NULL, - topic_id number(8) DEFAULT '0' NOT NULL, - reportee_id number(8) DEFAULT '0' NOT NULL, - log_ip varchar2(40) DEFAULT '' , - log_time number(11) DEFAULT '0' NOT NULL, - log_operation clob DEFAULT '' , - log_data clob DEFAULT '' , - CONSTRAINT pk_phpbb_log PRIMARY KEY (log_id) -) -/ - -CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type) -/ -CREATE INDEX phpbb_log_log_time ON phpbb_log (log_time) -/ -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_reportee_id ON phpbb_log (reportee_id) -/ -CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id) -/ - -CREATE SEQUENCE phpbb_log_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_log -BEFORE INSERT ON phpbb_log -FOR EACH ROW WHEN ( - new.log_id IS NULL OR new.log_id = 0 -) -BEGIN - SELECT phpbb_log_seq.nextval - INTO :new.log_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_login_attempts' -*/ -CREATE TABLE phpbb_login_attempts ( - attempt_ip varchar2(40) DEFAULT '' , - attempt_browser varchar2(150) DEFAULT '' , - attempt_forwarded_for varchar2(255) DEFAULT '' , - attempt_time number(11) DEFAULT '0' NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - username varchar2(765) DEFAULT '0' NOT NULL, - username_clean varchar2(255) DEFAULT '0' NOT NULL -) -/ - -CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts (attempt_ip, attempt_time) -/ -CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts (attempt_forwarded_for, attempt_time) -/ -CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts (attempt_time) -/ -CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts (user_id) -/ - -/* - Table: 'phpbb_moderator_cache' -*/ -CREATE TABLE phpbb_moderator_cache ( - forum_id number(8) DEFAULT '0' NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - username varchar2(765) DEFAULT '' , - group_id number(8) DEFAULT '0' NOT NULL, - group_name varchar2(765) DEFAULT '' , - display_on_index number(1) DEFAULT '1' NOT NULL -) -/ - -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) -/ - -/* - Table: 'phpbb_migrations' -*/ -CREATE TABLE phpbb_migrations ( - migration_name varchar2(255) DEFAULT '' , - migration_depends_on clob DEFAULT '' , - migration_schema_done number(1) DEFAULT '0' NOT NULL, - migration_data_done number(1) DEFAULT '0' NOT NULL, - migration_data_state clob DEFAULT '' , - migration_start_time number(11) DEFAULT '0' NOT NULL, - migration_end_time number(11) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_migrations PRIMARY KEY (migration_name) -) -/ - - -/* - Table: 'phpbb_modules' -*/ -CREATE TABLE phpbb_modules ( - module_id number(8) NOT NULL, - module_enabled number(1) DEFAULT '1' NOT NULL, - module_display number(1) DEFAULT '1' NOT NULL, - module_basename varchar2(255) DEFAULT '' , - module_class varchar2(10) DEFAULT '' , - parent_id number(8) DEFAULT '0' NOT NULL, - left_id number(8) DEFAULT '0' NOT NULL, - right_id number(8) DEFAULT '0' NOT NULL, - module_langname varchar2(255) DEFAULT '' , - module_mode varchar2(255) DEFAULT '' , - module_auth varchar2(255) DEFAULT '' , - CONSTRAINT pk_phpbb_modules PRIMARY KEY (module_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_class_left_id ON phpbb_modules (module_class, left_id) -/ - -CREATE SEQUENCE phpbb_modules_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_modules -BEFORE INSERT ON phpbb_modules -FOR EACH ROW WHEN ( - new.module_id IS NULL OR new.module_id = 0 -) -BEGIN - SELECT phpbb_modules_seq.nextval - INTO :new.module_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_notification_types' -*/ -CREATE TABLE phpbb_notification_types ( - notification_type_id number(4) NOT NULL, - notification_type_name varchar2(255) DEFAULT '' , - notification_type_enabled number(1) DEFAULT '1' NOT NULL, - CONSTRAINT pk_phpbb_notification_types PRIMARY KEY (notification_type_id), - CONSTRAINT u_phpbb_type UNIQUE (notification_type_name) -) -/ - - -CREATE SEQUENCE phpbb_notification_types_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_notification_types -BEFORE INSERT ON phpbb_notification_types -FOR EACH ROW WHEN ( - new.notification_type_id IS NULL OR new.notification_type_id = 0 -) -BEGIN - SELECT phpbb_notification_types_seq.nextval - INTO :new.notification_type_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_notifications' -*/ -CREATE TABLE phpbb_notifications ( - notification_id number(10) NOT NULL, - notification_type_id number(4) DEFAULT '0' NOT NULL, - item_id number(8) DEFAULT '0' NOT NULL, - item_parent_id number(8) DEFAULT '0' NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - notification_read number(1) DEFAULT '0' NOT NULL, - notification_time number(11) DEFAULT '1' NOT NULL, - notification_data clob DEFAULT '' , - CONSTRAINT pk_phpbb_notifications PRIMARY KEY (notification_id) -) -/ - -CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications (notification_type_id, item_id) -/ -CREATE INDEX phpbb_notifications_user ON phpbb_notifications (user_id, notification_read) -/ - -CREATE SEQUENCE phpbb_notifications_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_notifications -BEFORE INSERT ON phpbb_notifications -FOR EACH ROW WHEN ( - new.notification_id IS NULL OR new.notification_id = 0 -) -BEGIN - SELECT phpbb_notifications_seq.nextval - INTO :new.notification_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_oauth_accounts' -*/ -CREATE TABLE phpbb_oauth_accounts ( - user_id number(8) DEFAULT '0' NOT NULL, - provider varchar2(255) DEFAULT '' , - oauth_provider_id clob DEFAULT '' , - CONSTRAINT pk_phpbb_oauth_accounts PRIMARY KEY (user_id, provider) -) -/ - - -/* - Table: 'phpbb_oauth_tokens' -*/ -CREATE TABLE phpbb_oauth_tokens ( - user_id number(8) DEFAULT '0' NOT NULL, - session_id char(32) DEFAULT '' , - provider varchar2(255) DEFAULT '' , - oauth_token clob DEFAULT '' -) -/ - -CREATE INDEX phpbb_oauth_tokens_user_id ON phpbb_oauth_tokens (user_id) -/ -CREATE INDEX phpbb_oauth_tokens_provider ON phpbb_oauth_tokens (provider) -/ - -/* - Table: 'phpbb_poll_options' -*/ -CREATE TABLE phpbb_poll_options ( - poll_option_id number(4) DEFAULT '0' NOT NULL, - topic_id number(8) DEFAULT '0' NOT NULL, - poll_option_text clob DEFAULT '' , - poll_option_total number(8) DEFAULT '0' NOT NULL -) -/ - -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) -/ - -/* - Table: 'phpbb_poll_votes' -*/ -CREATE TABLE phpbb_poll_votes ( - topic_id number(8) DEFAULT '0' NOT NULL, - poll_option_id number(4) DEFAULT '0' NOT NULL, - vote_user_id number(8) DEFAULT '0' NOT NULL, - vote_user_ip varchar2(40) DEFAULT '' -) -/ - -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_ip ON phpbb_poll_votes (vote_user_ip) -/ - -/* - Table: 'phpbb_posts' -*/ -CREATE TABLE phpbb_posts ( - post_id number(8) NOT NULL, - topic_id number(8) DEFAULT '0' NOT NULL, - forum_id number(8) DEFAULT '0' NOT NULL, - poster_id number(8) DEFAULT '0' NOT NULL, - icon_id number(8) DEFAULT '0' NOT NULL, - poster_ip varchar2(40) DEFAULT '' , - post_time number(11) DEFAULT '0' NOT NULL, - post_visibility number(3) DEFAULT '0' NOT NULL, - post_reported number(1) DEFAULT '0' NOT NULL, - enable_bbcode number(1) DEFAULT '1' NOT NULL, - enable_smilies number(1) DEFAULT '1' NOT NULL, - enable_magic_url number(1) DEFAULT '1' NOT NULL, - enable_sig number(1) DEFAULT '1' NOT NULL, - post_username varchar2(765) DEFAULT '' , - post_subject varchar2(765) DEFAULT '' , - post_text clob DEFAULT '' , - post_checksum varchar2(32) DEFAULT '' , - post_attachment number(1) DEFAULT '0' NOT NULL, - bbcode_bitfield varchar2(255) DEFAULT '' , - bbcode_uid varchar2(8) DEFAULT '' , - post_postcount number(1) DEFAULT '1' NOT NULL, - post_edit_time number(11) DEFAULT '0' NOT NULL, - post_edit_reason varchar2(765) DEFAULT '' , - post_edit_user number(8) DEFAULT '0' NOT NULL, - post_edit_count number(4) DEFAULT '0' NOT NULL, - post_edit_locked number(1) DEFAULT '0' NOT NULL, - post_delete_time number(11) DEFAULT '0' NOT NULL, - post_delete_reason varchar2(765) DEFAULT '' , - post_delete_user number(8) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_posts PRIMARY KEY (post_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_poster_ip ON phpbb_posts (poster_ip) -/ -CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id) -/ -CREATE INDEX phpbb_posts_post_visibility ON phpbb_posts (post_visibility) -/ -CREATE INDEX phpbb_posts_post_username ON phpbb_posts (post_username) -/ -CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time) -/ - -CREATE SEQUENCE phpbb_posts_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_posts -BEFORE INSERT ON phpbb_posts -FOR EACH ROW WHEN ( - new.post_id IS NULL OR new.post_id = 0 -) -BEGIN - SELECT phpbb_posts_seq.nextval - INTO :new.post_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_privmsgs' -*/ -CREATE TABLE phpbb_privmsgs ( - msg_id number(8) NOT NULL, - root_level number(8) DEFAULT '0' NOT NULL, - author_id number(8) DEFAULT '0' NOT NULL, - icon_id number(8) DEFAULT '0' NOT NULL, - author_ip varchar2(40) DEFAULT '' , - message_time number(11) DEFAULT '0' NOT NULL, - enable_bbcode number(1) DEFAULT '1' NOT NULL, - enable_smilies number(1) DEFAULT '1' NOT NULL, - enable_magic_url number(1) DEFAULT '1' NOT NULL, - enable_sig number(1) DEFAULT '1' NOT NULL, - message_subject varchar2(765) DEFAULT '' , - message_text clob DEFAULT '' , - message_edit_reason varchar2(765) DEFAULT '' , - message_edit_user number(8) DEFAULT '0' NOT NULL, - message_attachment number(1) DEFAULT '0' NOT NULL, - bbcode_bitfield varchar2(255) DEFAULT '' , - bbcode_uid varchar2(8) DEFAULT '' , - message_edit_time number(11) DEFAULT '0' NOT NULL, - message_edit_count number(4) DEFAULT '0' NOT NULL, - to_address clob DEFAULT '' , - bcc_address clob DEFAULT '' , - message_reported number(1) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_privmsgs PRIMARY KEY (msg_id) -) -/ - -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_author_id ON phpbb_privmsgs (author_id) -/ -CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs (root_level) -/ - -CREATE SEQUENCE phpbb_privmsgs_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_privmsgs -BEFORE INSERT ON phpbb_privmsgs -FOR EACH ROW WHEN ( - new.msg_id IS NULL OR new.msg_id = 0 -) -BEGIN - SELECT phpbb_privmsgs_seq.nextval - INTO :new.msg_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_privmsgs_folder' -*/ -CREATE TABLE phpbb_privmsgs_folder ( - folder_id number(8) NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - folder_name varchar2(765) DEFAULT '' , - pm_count number(8) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_privmsgs_folder PRIMARY KEY (folder_id) -) -/ - -CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id) -/ - -CREATE SEQUENCE phpbb_privmsgs_folder_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_privmsgs_folder -BEFORE INSERT ON phpbb_privmsgs_folder -FOR EACH ROW WHEN ( - new.folder_id IS NULL OR new.folder_id = 0 -) -BEGIN - SELECT phpbb_privmsgs_folder_seq.nextval - INTO :new.folder_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_privmsgs_rules' -*/ -CREATE TABLE phpbb_privmsgs_rules ( - rule_id number(8) NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - rule_check number(8) DEFAULT '0' NOT NULL, - rule_connection number(8) DEFAULT '0' NOT NULL, - rule_string varchar2(765) DEFAULT '' , - rule_user_id number(8) DEFAULT '0' NOT NULL, - rule_group_id number(8) DEFAULT '0' NOT NULL, - rule_action number(8) DEFAULT '0' NOT NULL, - rule_folder_id number(11) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_privmsgs_rules PRIMARY KEY (rule_id) -) -/ - -CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules (user_id) -/ - -CREATE SEQUENCE phpbb_privmsgs_rules_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_privmsgs_rules -BEFORE INSERT ON phpbb_privmsgs_rules -FOR EACH ROW WHEN ( - new.rule_id IS NULL OR new.rule_id = 0 -) -BEGIN - SELECT phpbb_privmsgs_rules_seq.nextval - INTO :new.rule_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_privmsgs_to' -*/ -CREATE TABLE phpbb_privmsgs_to ( - msg_id number(8) DEFAULT '0' NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - author_id number(8) DEFAULT '0' NOT NULL, - pm_deleted number(1) DEFAULT '0' NOT NULL, - pm_new number(1) DEFAULT '1' NOT NULL, - pm_unread number(1) DEFAULT '1' NOT NULL, - pm_replied number(1) DEFAULT '0' NOT NULL, - pm_marked number(1) DEFAULT '0' NOT NULL, - pm_forwarded number(1) DEFAULT '0' NOT NULL, - folder_id number(11) DEFAULT '0' NOT NULL -) -/ - -CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id) -/ -CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to (author_id) -/ -CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folder_id) -/ - -/* - Table: 'phpbb_profile_fields' -*/ -CREATE TABLE phpbb_profile_fields ( - field_id number(8) NOT NULL, - field_name varchar2(765) DEFAULT '' , - field_type varchar2(100) DEFAULT '' , - field_ident varchar2(20) DEFAULT '' , - field_length varchar2(20) DEFAULT '' , - field_minlen varchar2(255) DEFAULT '' , - field_maxlen varchar2(255) DEFAULT '' , - field_novalue varchar2(765) DEFAULT '' , - field_default_value varchar2(765) DEFAULT '' , - field_validation varchar2(60) DEFAULT '' , - field_required number(1) DEFAULT '0' NOT NULL, - field_show_novalue number(1) DEFAULT '0' NOT NULL, - field_show_on_reg number(1) DEFAULT '0' NOT NULL, - field_show_on_pm number(1) DEFAULT '0' NOT NULL, - field_show_on_vt number(1) DEFAULT '0' NOT NULL, - field_show_on_ml number(1) DEFAULT '0' NOT NULL, - field_show_profile number(1) DEFAULT '0' NOT NULL, - field_hide number(1) DEFAULT '0' NOT NULL, - field_no_view number(1) DEFAULT '0' NOT NULL, - field_active number(1) DEFAULT '0' NOT NULL, - field_order number(8) DEFAULT '0' NOT NULL, - field_is_contact number(1) DEFAULT '0' NOT NULL, - field_contact_desc varchar2(255) DEFAULT '' , - field_contact_url varchar2(255) DEFAULT '' , - CONSTRAINT pk_phpbb_profile_fields PRIMARY KEY (field_id) -) -/ - -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 SEQUENCE phpbb_profile_fields_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_profile_fields -BEFORE INSERT ON phpbb_profile_fields -FOR EACH ROW WHEN ( - new.field_id IS NULL OR new.field_id = 0 -) -BEGIN - SELECT phpbb_profile_fields_seq.nextval - INTO :new.field_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_profile_fields_data' -*/ -CREATE TABLE phpbb_profile_fields_data ( - user_id number(8) DEFAULT '0' NOT NULL, - pf_phpbb_location varchar2(255) DEFAULT '' , - pf_phpbb_interests clob DEFAULT '' , - pf_phpbb_occupation clob DEFAULT '' , - pf_phpbb_icq varchar2(255) DEFAULT '' , - pf_phpbb_aol varchar2(255) DEFAULT '' , - pf_phpbb_wlm varchar2(255) DEFAULT '' , - pf_phpbb_yahoo varchar2(255) DEFAULT '' , - pf_phpbb_website varchar2(255) DEFAULT '' , - CONSTRAINT pk_phpbb_profile_fields_data PRIMARY KEY (user_id) -) -/ - - -/* - Table: 'phpbb_profile_fields_lang' -*/ -CREATE TABLE phpbb_profile_fields_lang ( - field_id number(8) DEFAULT '0' NOT NULL, - lang_id number(8) DEFAULT '0' NOT NULL, - option_id number(8) DEFAULT '0' NOT NULL, - field_type varchar2(100) DEFAULT '' , - lang_value varchar2(765) DEFAULT '' , - CONSTRAINT pk_phpbb_profile_fields_lang PRIMARY KEY (field_id, lang_id, option_id) -) -/ - - -/* - Table: 'phpbb_profile_lang' -*/ -CREATE TABLE phpbb_profile_lang ( - field_id number(8) DEFAULT '0' NOT NULL, - lang_id number(8) DEFAULT '0' NOT NULL, - lang_name varchar2(765) DEFAULT '' , - lang_explain clob DEFAULT '' , - lang_default_value varchar2(765) DEFAULT '' , - CONSTRAINT pk_phpbb_profile_lang PRIMARY KEY (field_id, lang_id) -) -/ - - -/* - Table: 'phpbb_ranks' -*/ -CREATE TABLE phpbb_ranks ( - rank_id number(8) NOT NULL, - rank_title varchar2(765) DEFAULT '' , - rank_min number(8) DEFAULT '0' NOT NULL, - rank_special number(1) DEFAULT '0' NOT NULL, - rank_image varchar2(255) DEFAULT '' , - CONSTRAINT pk_phpbb_ranks PRIMARY KEY (rank_id) -) -/ - - -CREATE SEQUENCE phpbb_ranks_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_ranks -BEFORE INSERT ON phpbb_ranks -FOR EACH ROW WHEN ( - new.rank_id IS NULL OR new.rank_id = 0 -) -BEGIN - SELECT phpbb_ranks_seq.nextval - INTO :new.rank_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_reports' -*/ -CREATE TABLE phpbb_reports ( - report_id number(8) NOT NULL, - reason_id number(4) DEFAULT '0' NOT NULL, - post_id number(8) DEFAULT '0' NOT NULL, - pm_id number(8) DEFAULT '0' NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - user_notify number(1) DEFAULT '0' NOT NULL, - report_closed number(1) DEFAULT '0' NOT NULL, - report_time number(11) DEFAULT '0' NOT NULL, - report_text clob DEFAULT '' , - reported_post_text clob DEFAULT '' , - reported_post_uid varchar2(8) DEFAULT '' , - reported_post_bitfield varchar2(255) DEFAULT '' , - reported_post_enable_magic_url number(1) DEFAULT '1' NOT NULL, - reported_post_enable_smilies number(1) DEFAULT '1' NOT NULL, - reported_post_enable_bbcode number(1) DEFAULT '1' NOT NULL, - CONSTRAINT pk_phpbb_reports PRIMARY KEY (report_id) -) -/ - -CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id) -/ -CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id) -/ - -CREATE SEQUENCE phpbb_reports_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_reports -BEFORE INSERT ON phpbb_reports -FOR EACH ROW WHEN ( - new.report_id IS NULL OR new.report_id = 0 -) -BEGIN - SELECT phpbb_reports_seq.nextval - INTO :new.report_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_reports_reasons' -*/ -CREATE TABLE phpbb_reports_reasons ( - reason_id number(4) NOT NULL, - reason_title varchar2(765) DEFAULT '' , - reason_description clob DEFAULT '' , - reason_order number(4) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_reports_reasons PRIMARY KEY (reason_id) -) -/ - - -CREATE SEQUENCE phpbb_reports_reasons_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_reports_reasons -BEFORE INSERT ON phpbb_reports_reasons -FOR EACH ROW WHEN ( - new.reason_id IS NULL OR new.reason_id = 0 -) -BEGIN - SELECT phpbb_reports_reasons_seq.nextval - INTO :new.reason_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_search_results' -*/ -CREATE TABLE phpbb_search_results ( - search_key varchar2(32) DEFAULT '' , - search_time number(11) DEFAULT '0' NOT NULL, - search_keywords clob DEFAULT '' , - search_authors clob DEFAULT '' , - CONSTRAINT pk_phpbb_search_results PRIMARY KEY (search_key) -) -/ - - -/* - Table: 'phpbb_search_wordlist' -*/ -CREATE TABLE phpbb_search_wordlist ( - word_id number(8) NOT NULL, - word_text varchar2(765) DEFAULT '' , - word_common number(1) DEFAULT '0' NOT NULL, - word_count number(8) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_search_wordlist PRIMARY KEY (word_id), - CONSTRAINT u_phpbb_wrd_txt UNIQUE (word_text) -) -/ - -CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist (word_count) -/ - -CREATE SEQUENCE phpbb_search_wordlist_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_search_wordlist -BEFORE INSERT ON phpbb_search_wordlist -FOR EACH ROW WHEN ( - new.word_id IS NULL OR new.word_id = 0 -) -BEGIN - SELECT phpbb_search_wordlist_seq.nextval - INTO :new.word_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_search_wordmatch' -*/ -CREATE TABLE phpbb_search_wordmatch ( - post_id number(8) DEFAULT '0' NOT NULL, - word_id number(8) DEFAULT '0' NOT NULL, - title_match number(1) DEFAULT '0' NOT NULL, - CONSTRAINT u_phpbb_unq_mtch UNIQUE (word_id, post_id, title_match) -) -/ - -CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id) -/ -CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id) -/ - -/* - Table: 'phpbb_sessions' -*/ -CREATE TABLE phpbb_sessions ( - session_id char(32) DEFAULT '' , - session_user_id number(8) DEFAULT '0' NOT NULL, - session_forum_id number(8) DEFAULT '0' NOT NULL, - session_last_visit number(11) DEFAULT '0' NOT NULL, - session_start number(11) DEFAULT '0' NOT NULL, - session_time number(11) DEFAULT '0' NOT NULL, - session_ip varchar2(40) DEFAULT '' , - session_browser varchar2(150) DEFAULT '' , - session_forwarded_for varchar2(255) DEFAULT '' , - session_page varchar2(765) DEFAULT '' , - session_viewonline number(1) DEFAULT '1' NOT NULL, - session_autologin number(1) DEFAULT '0' NOT NULL, - session_admin number(1) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_sessions PRIMARY KEY (session_id) -) -/ - -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_fid ON phpbb_sessions (session_forum_id) -/ - -/* - Table: 'phpbb_sessions_keys' -*/ -CREATE TABLE phpbb_sessions_keys ( - key_id char(32) DEFAULT '' , - user_id number(8) DEFAULT '0' NOT NULL, - last_ip varchar2(40) DEFAULT '' , - last_login number(11) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_sessions_keys PRIMARY KEY (key_id, user_id) -) -/ - -CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login) -/ - -/* - Table: 'phpbb_sitelist' -*/ -CREATE TABLE phpbb_sitelist ( - site_id number(8) NOT NULL, - site_ip varchar2(40) DEFAULT '' , - site_hostname varchar2(255) DEFAULT '' , - ip_exclude number(1) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_sitelist PRIMARY KEY (site_id) -) -/ - - -CREATE SEQUENCE phpbb_sitelist_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_sitelist -BEFORE INSERT ON phpbb_sitelist -FOR EACH ROW WHEN ( - new.site_id IS NULL OR new.site_id = 0 -) -BEGIN - SELECT phpbb_sitelist_seq.nextval - INTO :new.site_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_smilies' -*/ -CREATE TABLE phpbb_smilies ( - smiley_id number(8) NOT NULL, - code varchar2(150) DEFAULT '' , - emotion varchar2(150) DEFAULT '' , - smiley_url varchar2(50) DEFAULT '' , - smiley_width number(4) DEFAULT '0' NOT NULL, - smiley_height number(4) DEFAULT '0' NOT NULL, - smiley_order number(8) DEFAULT '0' NOT NULL, - display_on_posting number(1) DEFAULT '1' NOT NULL, - CONSTRAINT pk_phpbb_smilies PRIMARY KEY (smiley_id) -) -/ - -CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting) -/ - -CREATE SEQUENCE phpbb_smilies_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_smilies -BEFORE INSERT ON phpbb_smilies -FOR EACH ROW WHEN ( - new.smiley_id IS NULL OR new.smiley_id = 0 -) -BEGIN - SELECT phpbb_smilies_seq.nextval - INTO :new.smiley_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_styles' -*/ -CREATE TABLE phpbb_styles ( - style_id number(8) NOT NULL, - style_name varchar2(765) DEFAULT '' , - style_copyright varchar2(765) DEFAULT '' , - style_active number(1) DEFAULT '1' NOT NULL, - style_path varchar2(100) DEFAULT '' , - bbcode_bitfield varchar2(255) DEFAULT 'kNg=' NOT NULL, - style_parent_id number(4) DEFAULT '0' NOT NULL, - style_parent_tree clob DEFAULT '' , - CONSTRAINT pk_phpbb_styles PRIMARY KEY (style_id), - CONSTRAINT u_phpbb_style_name UNIQUE (style_name) -) -/ - - -CREATE SEQUENCE phpbb_styles_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_styles -BEFORE INSERT ON phpbb_styles -FOR EACH ROW WHEN ( - new.style_id IS NULL OR new.style_id = 0 -) -BEGIN - SELECT phpbb_styles_seq.nextval - INTO :new.style_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_teampage' -*/ -CREATE TABLE phpbb_teampage ( - teampage_id number(8) NOT NULL, - group_id number(8) DEFAULT '0' NOT NULL, - teampage_name varchar2(765) DEFAULT '' , - teampage_position number(8) DEFAULT '0' NOT NULL, - teampage_parent number(8) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_teampage PRIMARY KEY (teampage_id) -) -/ - - -CREATE SEQUENCE phpbb_teampage_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_teampage -BEFORE INSERT ON phpbb_teampage -FOR EACH ROW WHEN ( - new.teampage_id IS NULL OR new.teampage_id = 0 -) -BEGIN - SELECT phpbb_teampage_seq.nextval - INTO :new.teampage_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_topics' -*/ -CREATE TABLE phpbb_topics ( - topic_id number(8) NOT NULL, - forum_id number(8) DEFAULT '0' NOT NULL, - icon_id number(8) DEFAULT '0' NOT NULL, - topic_attachment number(1) DEFAULT '0' NOT NULL, - topic_visibility number(3) DEFAULT '0' NOT NULL, - topic_reported number(1) DEFAULT '0' NOT NULL, - topic_title varchar2(765) DEFAULT '' , - topic_poster number(8) DEFAULT '0' NOT NULL, - topic_time number(11) DEFAULT '0' NOT NULL, - topic_time_limit number(11) DEFAULT '0' NOT NULL, - topic_views number(8) DEFAULT '0' NOT NULL, - topic_posts_approved number(8) DEFAULT '0' NOT NULL, - topic_posts_unapproved number(8) DEFAULT '0' NOT NULL, - topic_posts_softdeleted number(8) DEFAULT '0' NOT NULL, - topic_status number(3) DEFAULT '0' NOT NULL, - topic_type number(3) DEFAULT '0' NOT NULL, - topic_first_post_id number(8) DEFAULT '0' NOT NULL, - topic_first_poster_name varchar2(765) DEFAULT '' , - topic_first_poster_colour varchar2(6) DEFAULT '' , - topic_last_post_id number(8) DEFAULT '0' NOT NULL, - topic_last_poster_id number(8) DEFAULT '0' NOT NULL, - topic_last_poster_name varchar2(765) DEFAULT '' , - topic_last_poster_colour varchar2(6) DEFAULT '' , - topic_last_post_subject varchar2(765) DEFAULT '' , - topic_last_post_time number(11) DEFAULT '0' NOT NULL, - topic_last_view_time number(11) DEFAULT '0' NOT NULL, - topic_moved_id number(8) DEFAULT '0' NOT NULL, - topic_bumped number(1) DEFAULT '0' NOT NULL, - topic_bumper number(8) DEFAULT '0' NOT NULL, - poll_title varchar2(765) DEFAULT '' , - poll_start number(11) DEFAULT '0' NOT NULL, - poll_length number(11) DEFAULT '0' NOT NULL, - poll_max_options number(4) DEFAULT '1' NOT NULL, - poll_last_vote number(11) DEFAULT '0' NOT NULL, - poll_vote_change number(1) DEFAULT '0' NOT NULL, - topic_delete_time number(11) DEFAULT '0' NOT NULL, - topic_delete_reason varchar2(765) DEFAULT '' , - topic_delete_user number(8) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_topics PRIMARY KEY (topic_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_last_post_time ON phpbb_topics (topic_last_post_time) -/ -CREATE INDEX phpbb_topics_topic_visibility ON phpbb_topics (topic_visibility) -/ -CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics (forum_id, topic_visibility, topic_last_post_id) -/ -CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id) -/ - -CREATE SEQUENCE phpbb_topics_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_topics -BEFORE INSERT ON phpbb_topics -FOR EACH ROW WHEN ( - new.topic_id IS NULL OR new.topic_id = 0 -) -BEGIN - SELECT phpbb_topics_seq.nextval - INTO :new.topic_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_topics_track' -*/ -CREATE TABLE phpbb_topics_track ( - user_id number(8) DEFAULT '0' NOT NULL, - topic_id number(8) DEFAULT '0' NOT NULL, - forum_id number(8) DEFAULT '0' NOT NULL, - mark_time number(11) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_topics_track PRIMARY KEY (user_id, topic_id) -) -/ - -CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id) -/ -CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id) -/ - -/* - Table: 'phpbb_topics_posted' -*/ -CREATE TABLE phpbb_topics_posted ( - user_id number(8) DEFAULT '0' NOT NULL, - topic_id number(8) DEFAULT '0' NOT NULL, - topic_posted number(1) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_topics_posted PRIMARY KEY (user_id, topic_id) -) -/ - - -/* - Table: 'phpbb_topics_watch' -*/ -CREATE TABLE phpbb_topics_watch ( - topic_id number(8) DEFAULT '0' NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - notify_status number(1) DEFAULT '0' NOT NULL -) -/ - -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_notify_stat ON phpbb_topics_watch (notify_status) -/ - -/* - Table: 'phpbb_user_notifications' -*/ -CREATE TABLE phpbb_user_notifications ( - item_type varchar2(255) DEFAULT '' , - item_id number(8) DEFAULT '0' NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - method varchar2(255) DEFAULT '' , - notify number(1) DEFAULT '1' NOT NULL -) -/ - - -/* - Table: 'phpbb_user_group' -*/ -CREATE TABLE phpbb_user_group ( - group_id number(8) DEFAULT '0' NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - group_leader number(1) DEFAULT '0' NOT NULL, - user_pending number(1) DEFAULT '1' NOT NULL -) -/ - -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_group_leader ON phpbb_user_group (group_leader) -/ - -/* - Table: 'phpbb_users' -*/ -CREATE TABLE phpbb_users ( - user_id number(8) NOT NULL, - user_type number(2) DEFAULT '0' NOT NULL, - group_id number(8) DEFAULT '3' NOT NULL, - user_permissions clob DEFAULT '' , - user_perm_from number(8) DEFAULT '0' NOT NULL, - user_ip varchar2(40) DEFAULT '' , - user_regdate number(11) DEFAULT '0' NOT NULL, - username varchar2(255) DEFAULT '' , - username_clean varchar2(255) DEFAULT '' , - user_password varchar2(765) DEFAULT '' , - user_passchg number(11) DEFAULT '0' NOT NULL, - user_pass_convert number(1) DEFAULT '0' NOT NULL, - user_actkey varchar2(32) DEFAULT '' , - user_newpasswd varchar2(765) DEFAULT '' , - user_email varchar2(300) DEFAULT '' , - user_email_hash number(20) DEFAULT '0' NOT NULL, - user_birthday varchar2(10) DEFAULT '' , - user_lastvisit number(11) DEFAULT '0' NOT NULL, - user_lastmark number(11) DEFAULT '0' NOT NULL, - user_lastpost_time number(11) DEFAULT '0' NOT NULL, - user_lastpage varchar2(600) DEFAULT '' , - user_last_confirm_key varchar2(10) DEFAULT '' , - user_last_search number(11) DEFAULT '0' NOT NULL, - user_warnings number(4) DEFAULT '0' NOT NULL, - user_last_warning number(11) DEFAULT '0' NOT NULL, - user_login_attempts number(4) DEFAULT '0' NOT NULL, - user_inactive_reason number(2) DEFAULT '0' NOT NULL, - user_inactive_time number(11) DEFAULT '0' NOT NULL, - user_posts number(8) DEFAULT '0' NOT NULL, - user_lang varchar2(30) DEFAULT '' , - user_timezone varchar2(100) DEFAULT 'UTC' NOT NULL, - user_dateformat varchar2(90) DEFAULT 'd M Y H:i' NOT NULL, - user_style number(8) DEFAULT '0' NOT NULL, - user_rank number(8) DEFAULT '0' NOT NULL, - user_colour varchar2(6) DEFAULT '' , - user_new_privmsg number(4) DEFAULT '0' NOT NULL, - user_unread_privmsg number(4) DEFAULT '0' NOT NULL, - user_last_privmsg number(11) DEFAULT '0' NOT NULL, - user_message_rules number(1) DEFAULT '0' NOT NULL, - user_full_folder number(11) DEFAULT '-3' NOT NULL, - user_emailtime number(11) DEFAULT '0' NOT NULL, - user_topic_show_days number(4) DEFAULT '0' NOT NULL, - user_topic_sortby_type varchar2(1) DEFAULT 't' NOT NULL, - user_topic_sortby_dir varchar2(1) DEFAULT 'd' NOT NULL, - user_post_show_days number(4) DEFAULT '0' NOT NULL, - user_post_sortby_type varchar2(1) DEFAULT 't' NOT NULL, - user_post_sortby_dir varchar2(1) DEFAULT 'a' NOT NULL, - user_notify number(1) DEFAULT '0' NOT NULL, - user_notify_pm number(1) DEFAULT '1' NOT NULL, - user_notify_type number(4) DEFAULT '0' NOT NULL, - user_allow_pm number(1) DEFAULT '1' NOT NULL, - user_allow_viewonline number(1) DEFAULT '1' NOT NULL, - user_allow_viewemail number(1) DEFAULT '1' NOT NULL, - user_allow_massemail number(1) DEFAULT '1' NOT NULL, - user_options number(11) DEFAULT '230271' NOT NULL, - user_avatar varchar2(255) DEFAULT '' , - user_avatar_type varchar2(255) DEFAULT '' , - user_avatar_width number(4) DEFAULT '0' NOT NULL, - user_avatar_height number(4) DEFAULT '0' NOT NULL, - user_sig clob DEFAULT '' , - user_sig_bbcode_uid varchar2(8) DEFAULT '' , - user_sig_bbcode_bitfield varchar2(255) DEFAULT '' , - user_jabber varchar2(765) DEFAULT '' , - user_form_salt varchar2(96) DEFAULT '' , - user_new number(1) DEFAULT '1' NOT NULL, - user_reminded number(4) DEFAULT '0' NOT NULL, - user_reminded_time number(11) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_users PRIMARY KEY (user_id), - CONSTRAINT u_phpbb_username_clean UNIQUE (username_clean) -) -/ - -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_type ON phpbb_users (user_type) -/ - -CREATE SEQUENCE phpbb_users_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_users -BEFORE INSERT ON phpbb_users -FOR EACH ROW WHEN ( - new.user_id IS NULL OR new.user_id = 0 -) -BEGIN - SELECT phpbb_users_seq.nextval - INTO :new.user_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_warnings' -*/ -CREATE TABLE phpbb_warnings ( - warning_id number(8) NOT NULL, - user_id number(8) DEFAULT '0' NOT NULL, - post_id number(8) DEFAULT '0' NOT NULL, - log_id number(8) DEFAULT '0' NOT NULL, - warning_time number(11) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_warnings PRIMARY KEY (warning_id) -) -/ - - -CREATE SEQUENCE phpbb_warnings_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_warnings -BEFORE INSERT ON phpbb_warnings -FOR EACH ROW WHEN ( - new.warning_id IS NULL OR new.warning_id = 0 -) -BEGIN - SELECT phpbb_warnings_seq.nextval - INTO :new.warning_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_words' -*/ -CREATE TABLE phpbb_words ( - word_id number(8) NOT NULL, - word varchar2(765) DEFAULT '' , - replacement varchar2(765) DEFAULT '' , - CONSTRAINT pk_phpbb_words PRIMARY KEY (word_id) -) -/ - - -CREATE SEQUENCE phpbb_words_seq -/ - -CREATE OR REPLACE TRIGGER t_phpbb_words -BEFORE INSERT ON phpbb_words -FOR EACH ROW WHEN ( - new.word_id IS NULL OR new.word_id = 0 -) -BEGIN - SELECT phpbb_words_seq.nextval - INTO :new.word_id - FROM dual; -END; -/ - - -/* - Table: 'phpbb_zebra' -*/ -CREATE TABLE phpbb_zebra ( - user_id number(8) DEFAULT '0' NOT NULL, - zebra_id number(8) DEFAULT '0' NOT NULL, - friend number(1) DEFAULT '0' NOT NULL, - foe number(1) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_zebra PRIMARY KEY (user_id, zebra_id) -) -/ - - diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 36eaddbb78..3fc8589844 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -83,1286 +83,5 @@ CREATE OPERATOR =( MERGES, SORT1= <); -/* - Table: 'phpbb_attachments' -*/ -CREATE SEQUENCE phpbb_attachments_seq; - -CREATE TABLE phpbb_attachments ( - attach_id INT4 DEFAULT nextval('phpbb_attachments_seq'), - post_msg_id INT4 DEFAULT '0' NOT NULL CHECK (post_msg_id >= 0), - topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0), - in_message INT2 DEFAULT '0' NOT NULL CHECK (in_message >= 0), - poster_id INT4 DEFAULT '0' NOT NULL CHECK (poster_id >= 0), - is_orphan INT2 DEFAULT '1' NOT NULL CHECK (is_orphan >= 0), - physical_filename varchar(255) DEFAULT '' NOT NULL, - real_filename varchar(255) DEFAULT '' NOT NULL, - download_count INT4 DEFAULT '0' NOT NULL CHECK (download_count >= 0), - attach_comment varchar(4000) DEFAULT '' NOT NULL, - extension varchar(100) DEFAULT '' NOT NULL, - mimetype varchar(100) DEFAULT '' NOT NULL, - filesize INT4 DEFAULT '0' NOT NULL CHECK (filesize >= 0), - filetime INT4 DEFAULT '0' NOT NULL CHECK (filetime >= 0), - thumbnail INT2 DEFAULT '0' NOT NULL CHECK (thumbnail >= 0), - PRIMARY KEY (attach_id) -); - -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_topic_id ON phpbb_attachments (topic_id); -CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id); -CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments (is_orphan); - -/* - Table: 'phpbb_acl_groups' -*/ -CREATE TABLE phpbb_acl_groups ( - group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0), - forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0), - auth_option_id INT4 DEFAULT '0' NOT NULL CHECK (auth_option_id >= 0), - auth_role_id INT4 DEFAULT '0' NOT NULL CHECK (auth_role_id >= 0), - auth_setting INT2 DEFAULT '0' NOT NULL -); - -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_role_id ON phpbb_acl_groups (auth_role_id); - -/* - Table: 'phpbb_acl_options' -*/ -CREATE SEQUENCE phpbb_acl_options_seq; - -CREATE TABLE phpbb_acl_options ( - auth_option_id INT4 DEFAULT nextval('phpbb_acl_options_seq'), - auth_option varchar(50) DEFAULT '' NOT NULL, - is_global INT2 DEFAULT '0' NOT NULL CHECK (is_global >= 0), - is_local INT2 DEFAULT '0' NOT NULL CHECK (is_local >= 0), - founder_only INT2 DEFAULT '0' NOT NULL CHECK (founder_only >= 0), - PRIMARY KEY (auth_option_id) -); - -CREATE UNIQUE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options (auth_option); - -/* - Table: 'phpbb_acl_roles' -*/ -CREATE SEQUENCE phpbb_acl_roles_seq; - -CREATE TABLE phpbb_acl_roles ( - role_id INT4 DEFAULT nextval('phpbb_acl_roles_seq'), - role_name varchar(255) DEFAULT '' NOT NULL, - role_description varchar(4000) DEFAULT '' NOT NULL, - role_type varchar(10) DEFAULT '' NOT NULL, - role_order INT2 DEFAULT '0' NOT NULL CHECK (role_order >= 0), - PRIMARY KEY (role_id) -); - -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); - -/* - Table: 'phpbb_acl_roles_data' -*/ -CREATE TABLE phpbb_acl_roles_data ( - role_id INT4 DEFAULT '0' NOT NULL CHECK (role_id >= 0), - auth_option_id INT4 DEFAULT '0' NOT NULL CHECK (auth_option_id >= 0), - auth_setting INT2 DEFAULT '0' NOT NULL, - PRIMARY KEY (role_id, auth_option_id) -); - -CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id); - -/* - Table: 'phpbb_acl_users' -*/ -CREATE TABLE phpbb_acl_users ( - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0), - auth_option_id INT4 DEFAULT '0' NOT NULL CHECK (auth_option_id >= 0), - auth_role_id INT4 DEFAULT '0' NOT NULL CHECK (auth_role_id >= 0), - auth_setting INT2 DEFAULT '0' NOT NULL -); - -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_role_id ON phpbb_acl_users (auth_role_id); - -/* - Table: 'phpbb_banlist' -*/ -CREATE SEQUENCE phpbb_banlist_seq; - -CREATE TABLE phpbb_banlist ( - ban_id INT4 DEFAULT nextval('phpbb_banlist_seq'), - ban_userid INT4 DEFAULT '0' NOT NULL CHECK (ban_userid >= 0), - ban_ip varchar(40) DEFAULT '' NOT NULL, - ban_email varchar(100) DEFAULT '' NOT NULL, - ban_start INT4 DEFAULT '0' NOT NULL CHECK (ban_start >= 0), - ban_end INT4 DEFAULT '0' NOT NULL CHECK (ban_end >= 0), - ban_exclude INT2 DEFAULT '0' NOT NULL CHECK (ban_exclude >= 0), - ban_reason varchar(255) DEFAULT '' NOT NULL, - ban_give_reason varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (ban_id) -); - -CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end); -CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist (ban_userid, ban_exclude); -CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist (ban_email, ban_exclude); -CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist (ban_ip, ban_exclude); - -/* - Table: 'phpbb_bbcodes' -*/ -CREATE TABLE phpbb_bbcodes ( - bbcode_id INT2 DEFAULT '0' NOT NULL CHECK (bbcode_id >= 0), - bbcode_tag varchar(16) DEFAULT '' NOT NULL, - bbcode_helpline varchar(255) DEFAULT '' NOT NULL, - display_on_posting INT2 DEFAULT '0' NOT NULL CHECK (display_on_posting >= 0), - bbcode_match varchar(4000) DEFAULT '' NOT NULL, - bbcode_tpl TEXT DEFAULT '' NOT NULL, - first_pass_match TEXT DEFAULT '' NOT NULL, - first_pass_replace TEXT DEFAULT '' NOT NULL, - second_pass_match TEXT DEFAULT '' NOT NULL, - second_pass_replace TEXT DEFAULT '' NOT NULL, - PRIMARY KEY (bbcode_id) -); - -CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting); - -/* - Table: 'phpbb_bookmarks' -*/ -CREATE TABLE phpbb_bookmarks ( - topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0), - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - PRIMARY KEY (topic_id, user_id) -); - - -/* - Table: 'phpbb_bots' -*/ -CREATE SEQUENCE phpbb_bots_seq; - -CREATE TABLE phpbb_bots ( - bot_id INT4 DEFAULT nextval('phpbb_bots_seq'), - bot_active INT2 DEFAULT '1' NOT NULL CHECK (bot_active >= 0), - bot_name varchar(255) DEFAULT '' NOT NULL, - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - bot_agent varchar(255) DEFAULT '' NOT NULL, - bot_ip varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (bot_id) -); - -CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active); - -/* - Table: 'phpbb_config' -*/ -CREATE TABLE phpbb_config ( - config_name varchar(255) DEFAULT '' NOT NULL, - config_value varchar(255) DEFAULT '' NOT NULL, - is_dynamic INT2 DEFAULT '0' NOT NULL CHECK (is_dynamic >= 0), - PRIMARY KEY (config_name) -); - -CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic); - -/* - Table: 'phpbb_config_text' -*/ -CREATE TABLE phpbb_config_text ( - config_name varchar(255) DEFAULT '' NOT NULL, - config_value TEXT DEFAULT '' NOT NULL, - PRIMARY KEY (config_name) -); - - -/* - Table: 'phpbb_confirm' -*/ -CREATE TABLE phpbb_confirm ( - confirm_id char(32) DEFAULT '' NOT NULL, - session_id char(32) DEFAULT '' NOT NULL, - confirm_type INT2 DEFAULT '0' NOT NULL, - code varchar(8) DEFAULT '' NOT NULL, - seed INT4 DEFAULT '0' NOT NULL CHECK (seed >= 0), - attempts INT4 DEFAULT '0' NOT NULL CHECK (attempts >= 0), - PRIMARY KEY (session_id, confirm_id) -); - -CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm (confirm_type); - -/* - Table: 'phpbb_disallow' -*/ -CREATE SEQUENCE phpbb_disallow_seq; - -CREATE TABLE phpbb_disallow ( - disallow_id INT4 DEFAULT nextval('phpbb_disallow_seq'), - disallow_username varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (disallow_id) -); - - -/* - Table: 'phpbb_drafts' -*/ -CREATE SEQUENCE phpbb_drafts_seq; - -CREATE TABLE phpbb_drafts ( - draft_id INT4 DEFAULT nextval('phpbb_drafts_seq'), - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0), - forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0), - save_time INT4 DEFAULT '0' NOT NULL CHECK (save_time >= 0), - draft_subject varchar(255) DEFAULT '' NOT NULL, - draft_message TEXT DEFAULT '' NOT NULL, - PRIMARY KEY (draft_id) -); - -CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time); - -/* - Table: 'phpbb_ext' -*/ -CREATE TABLE phpbb_ext ( - ext_name varchar(255) DEFAULT '' NOT NULL, - ext_active INT2 DEFAULT '0' NOT NULL CHECK (ext_active >= 0), - ext_state varchar(8000) DEFAULT '' NOT NULL -); - -CREATE UNIQUE INDEX phpbb_ext_ext_name ON phpbb_ext (ext_name); - -/* - Table: 'phpbb_extensions' -*/ -CREATE SEQUENCE phpbb_extensions_seq; - -CREATE TABLE phpbb_extensions ( - extension_id INT4 DEFAULT nextval('phpbb_extensions_seq'), - group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0), - extension varchar(100) DEFAULT '' NOT NULL, - PRIMARY KEY (extension_id) -); - - -/* - Table: 'phpbb_extension_groups' -*/ -CREATE SEQUENCE phpbb_extension_groups_seq; - -CREATE TABLE phpbb_extension_groups ( - group_id INT4 DEFAULT nextval('phpbb_extension_groups_seq'), - group_name varchar(255) DEFAULT '' NOT NULL, - cat_id INT2 DEFAULT '0' NOT NULL, - allow_group INT2 DEFAULT '0' NOT NULL CHECK (allow_group >= 0), - download_mode INT2 DEFAULT '1' NOT NULL CHECK (download_mode >= 0), - upload_icon varchar(255) DEFAULT '' NOT NULL, - max_filesize INT4 DEFAULT '0' NOT NULL CHECK (max_filesize >= 0), - allowed_forums varchar(8000) DEFAULT '' NOT NULL, - allow_in_pm INT2 DEFAULT '0' NOT NULL CHECK (allow_in_pm >= 0), - PRIMARY KEY (group_id) -); - - -/* - Table: 'phpbb_forums' -*/ -CREATE SEQUENCE phpbb_forums_seq; - -CREATE TABLE phpbb_forums ( - forum_id INT4 DEFAULT nextval('phpbb_forums_seq'), - parent_id INT4 DEFAULT '0' NOT NULL CHECK (parent_id >= 0), - left_id INT4 DEFAULT '0' NOT NULL CHECK (left_id >= 0), - right_id INT4 DEFAULT '0' NOT NULL CHECK (right_id >= 0), - forum_parents TEXT DEFAULT '' NOT NULL, - forum_name varchar(255) DEFAULT '' NOT NULL, - forum_desc varchar(4000) DEFAULT '' NOT NULL, - forum_desc_bitfield varchar(255) DEFAULT '' NOT NULL, - forum_desc_options INT4 DEFAULT '7' NOT NULL CHECK (forum_desc_options >= 0), - forum_desc_uid varchar(8) DEFAULT '' NOT NULL, - forum_link varchar(255) DEFAULT '' NOT NULL, - forum_password varchar(255) DEFAULT '' NOT NULL, - forum_style INT4 DEFAULT '0' NOT NULL CHECK (forum_style >= 0), - forum_image varchar(255) DEFAULT '' NOT NULL, - forum_rules varchar(4000) DEFAULT '' NOT NULL, - forum_rules_link varchar(255) DEFAULT '' NOT NULL, - forum_rules_bitfield varchar(255) DEFAULT '' NOT NULL, - forum_rules_options INT4 DEFAULT '7' NOT NULL CHECK (forum_rules_options >= 0), - forum_rules_uid varchar(8) DEFAULT '' NOT NULL, - forum_topics_per_page INT2 DEFAULT '0' NOT NULL, - forum_type INT2 DEFAULT '0' NOT NULL, - forum_status INT2 DEFAULT '0' NOT NULL, - forum_posts_approved INT4 DEFAULT '0' NOT NULL CHECK (forum_posts_approved >= 0), - forum_posts_unapproved INT4 DEFAULT '0' NOT NULL CHECK (forum_posts_unapproved >= 0), - forum_posts_softdeleted INT4 DEFAULT '0' NOT NULL CHECK (forum_posts_softdeleted >= 0), - forum_topics_approved INT4 DEFAULT '0' NOT NULL CHECK (forum_topics_approved >= 0), - forum_topics_unapproved INT4 DEFAULT '0' NOT NULL CHECK (forum_topics_unapproved >= 0), - forum_topics_softdeleted INT4 DEFAULT '0' NOT NULL CHECK (forum_topics_softdeleted >= 0), - forum_last_post_id INT4 DEFAULT '0' NOT NULL CHECK (forum_last_post_id >= 0), - forum_last_poster_id INT4 DEFAULT '0' NOT NULL CHECK (forum_last_poster_id >= 0), - forum_last_post_subject varchar(255) DEFAULT '' NOT NULL, - forum_last_post_time INT4 DEFAULT '0' NOT NULL CHECK (forum_last_post_time >= 0), - forum_last_poster_name varchar(255) DEFAULT '' NOT NULL, - forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL, - forum_flags INT2 DEFAULT '32' NOT NULL, - forum_options INT4 DEFAULT '0' NOT NULL CHECK (forum_options >= 0), - display_subforum_list INT2 DEFAULT '1' NOT NULL CHECK (display_subforum_list >= 0), - display_on_index INT2 DEFAULT '1' NOT NULL CHECK (display_on_index >= 0), - enable_indexing INT2 DEFAULT '1' NOT NULL CHECK (enable_indexing >= 0), - enable_icons INT2 DEFAULT '1' NOT NULL CHECK (enable_icons >= 0), - enable_prune INT2 DEFAULT '0' NOT NULL CHECK (enable_prune >= 0), - prune_next INT4 DEFAULT '0' NOT NULL CHECK (prune_next >= 0), - prune_days INT4 DEFAULT '0' NOT NULL CHECK (prune_days >= 0), - prune_viewed INT4 DEFAULT '0' NOT NULL CHECK (prune_viewed >= 0), - prune_freq INT4 DEFAULT '0' NOT NULL CHECK (prune_freq >= 0), - PRIMARY KEY (forum_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); - -/* - Table: 'phpbb_forums_access' -*/ -CREATE TABLE phpbb_forums_access ( - forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0), - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - session_id char(32) DEFAULT '' NOT NULL, - PRIMARY KEY (forum_id, user_id, session_id) -); - - -/* - Table: 'phpbb_forums_track' -*/ -CREATE TABLE phpbb_forums_track ( - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0), - mark_time INT4 DEFAULT '0' NOT NULL CHECK (mark_time >= 0), - PRIMARY KEY (user_id, forum_id) -); - - -/* - Table: 'phpbb_forums_watch' -*/ -CREATE TABLE phpbb_forums_watch ( - forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0), - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - notify_status INT2 DEFAULT '0' NOT NULL CHECK (notify_status >= 0) -); - -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_notify_stat ON phpbb_forums_watch (notify_status); - -/* - Table: 'phpbb_groups' -*/ -CREATE SEQUENCE phpbb_groups_seq; - -CREATE TABLE phpbb_groups ( - group_id INT4 DEFAULT nextval('phpbb_groups_seq'), - group_type INT2 DEFAULT '1' NOT NULL, - group_founder_manage INT2 DEFAULT '0' NOT NULL CHECK (group_founder_manage >= 0), - group_skip_auth INT2 DEFAULT '0' NOT NULL CHECK (group_skip_auth >= 0), - group_name varchar_ci DEFAULT '' NOT NULL, - group_desc varchar(4000) DEFAULT '' NOT NULL, - group_desc_bitfield varchar(255) DEFAULT '' NOT NULL, - group_desc_options INT4 DEFAULT '7' NOT NULL CHECK (group_desc_options >= 0), - group_desc_uid varchar(8) DEFAULT '' NOT NULL, - group_display INT2 DEFAULT '0' NOT NULL CHECK (group_display >= 0), - group_avatar varchar(255) DEFAULT '' NOT NULL, - group_avatar_type varchar(255) DEFAULT '' NOT NULL, - group_avatar_width INT2 DEFAULT '0' NOT NULL CHECK (group_avatar_width >= 0), - group_avatar_height INT2 DEFAULT '0' NOT NULL CHECK (group_avatar_height >= 0), - group_rank INT4 DEFAULT '0' NOT NULL CHECK (group_rank >= 0), - group_colour varchar(6) DEFAULT '' NOT NULL, - group_sig_chars INT4 DEFAULT '0' NOT NULL CHECK (group_sig_chars >= 0), - group_receive_pm INT2 DEFAULT '0' NOT NULL CHECK (group_receive_pm >= 0), - group_message_limit INT4 DEFAULT '0' NOT NULL CHECK (group_message_limit >= 0), - group_max_recipients INT4 DEFAULT '0' NOT NULL CHECK (group_max_recipients >= 0), - group_legend INT4 DEFAULT '0' NOT NULL CHECK (group_legend >= 0), - PRIMARY KEY (group_id) -); - -CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name); - -/* - Table: 'phpbb_icons' -*/ -CREATE SEQUENCE phpbb_icons_seq; - -CREATE TABLE phpbb_icons ( - icons_id INT4 DEFAULT nextval('phpbb_icons_seq'), - icons_url varchar(255) DEFAULT '' NOT NULL, - icons_width INT2 DEFAULT '0' NOT NULL, - icons_height INT2 DEFAULT '0' NOT NULL, - icons_order INT4 DEFAULT '0' NOT NULL CHECK (icons_order >= 0), - display_on_posting INT2 DEFAULT '1' NOT NULL CHECK (display_on_posting >= 0), - PRIMARY KEY (icons_id) -); - -CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons (display_on_posting); - -/* - Table: 'phpbb_lang' -*/ -CREATE SEQUENCE phpbb_lang_seq; - -CREATE TABLE phpbb_lang ( - lang_id INT2 DEFAULT nextval('phpbb_lang_seq'), - lang_iso varchar(30) DEFAULT '' NOT NULL, - lang_dir varchar(30) DEFAULT '' NOT NULL, - lang_english_name varchar(100) DEFAULT '' NOT NULL, - lang_local_name varchar(255) DEFAULT '' NOT NULL, - lang_author varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (lang_id) -); - -CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang (lang_iso); - -/* - Table: 'phpbb_log' -*/ -CREATE SEQUENCE phpbb_log_seq; - -CREATE TABLE phpbb_log ( - log_id INT4 DEFAULT nextval('phpbb_log_seq'), - log_type INT2 DEFAULT '0' NOT NULL, - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0), - topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0), - reportee_id INT4 DEFAULT '0' NOT NULL CHECK (reportee_id >= 0), - log_ip varchar(40) DEFAULT '' NOT NULL, - log_time INT4 DEFAULT '0' NOT NULL CHECK (log_time >= 0), - log_operation varchar(4000) DEFAULT '' NOT NULL, - log_data TEXT DEFAULT '' NOT NULL, - PRIMARY KEY (log_id) -); - -CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type); -CREATE INDEX phpbb_log_log_time ON phpbb_log (log_time); -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_reportee_id ON phpbb_log (reportee_id); -CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id); - -/* - Table: 'phpbb_login_attempts' -*/ -CREATE TABLE phpbb_login_attempts ( - attempt_ip varchar(40) DEFAULT '' NOT NULL, - attempt_browser varchar(150) DEFAULT '' NOT NULL, - attempt_forwarded_for varchar(255) DEFAULT '' NOT NULL, - attempt_time INT4 DEFAULT '0' NOT NULL CHECK (attempt_time >= 0), - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - username varchar(255) DEFAULT '0' NOT NULL, - username_clean varchar_ci DEFAULT '0' NOT NULL -); - -CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts (attempt_ip, attempt_time); -CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts (attempt_forwarded_for, attempt_time); -CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts (attempt_time); -CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts (user_id); - -/* - Table: 'phpbb_moderator_cache' -*/ -CREATE TABLE phpbb_moderator_cache ( - forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0), - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - username varchar(255) DEFAULT '' NOT NULL, - group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0), - group_name varchar(255) DEFAULT '' NOT NULL, - display_on_index INT2 DEFAULT '1' NOT NULL CHECK (display_on_index >= 0) -); - -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); - -/* - Table: 'phpbb_migrations' -*/ -CREATE TABLE phpbb_migrations ( - migration_name varchar(255) DEFAULT '' NOT NULL, - migration_depends_on varchar(8000) DEFAULT '' NOT NULL, - migration_schema_done INT2 DEFAULT '0' NOT NULL CHECK (migration_schema_done >= 0), - migration_data_done INT2 DEFAULT '0' NOT NULL CHECK (migration_data_done >= 0), - migration_data_state varchar(8000) DEFAULT '' NOT NULL, - migration_start_time INT4 DEFAULT '0' NOT NULL CHECK (migration_start_time >= 0), - migration_end_time INT4 DEFAULT '0' NOT NULL CHECK (migration_end_time >= 0), - PRIMARY KEY (migration_name) -); - - -/* - Table: 'phpbb_modules' -*/ -CREATE SEQUENCE phpbb_modules_seq; - -CREATE TABLE phpbb_modules ( - module_id INT4 DEFAULT nextval('phpbb_modules_seq'), - module_enabled INT2 DEFAULT '1' NOT NULL CHECK (module_enabled >= 0), - module_display INT2 DEFAULT '1' NOT NULL CHECK (module_display >= 0), - module_basename varchar(255) DEFAULT '' NOT NULL, - module_class varchar(10) DEFAULT '' NOT NULL, - parent_id INT4 DEFAULT '0' NOT NULL CHECK (parent_id >= 0), - left_id INT4 DEFAULT '0' NOT NULL CHECK (left_id >= 0), - right_id INT4 DEFAULT '0' NOT NULL CHECK (right_id >= 0), - module_langname varchar(255) DEFAULT '' NOT NULL, - module_mode varchar(255) DEFAULT '' NOT NULL, - module_auth varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (module_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_class_left_id ON phpbb_modules (module_class, left_id); - -/* - Table: 'phpbb_notification_types' -*/ -CREATE SEQUENCE phpbb_notification_types_seq; - -CREATE TABLE phpbb_notification_types ( - notification_type_id INT2 DEFAULT nextval('phpbb_notification_types_seq'), - notification_type_name varchar(255) DEFAULT '' NOT NULL, - notification_type_enabled INT2 DEFAULT '1' NOT NULL CHECK (notification_type_enabled >= 0), - PRIMARY KEY (notification_type_id) -); - -CREATE UNIQUE INDEX phpbb_notification_types_type ON phpbb_notification_types (notification_type_name); - -/* - Table: 'phpbb_notifications' -*/ -CREATE SEQUENCE phpbb_notifications_seq; - -CREATE TABLE phpbb_notifications ( - notification_id INT4 DEFAULT nextval('phpbb_notifications_seq'), - notification_type_id INT2 DEFAULT '0' NOT NULL CHECK (notification_type_id >= 0), - item_id INT4 DEFAULT '0' NOT NULL CHECK (item_id >= 0), - item_parent_id INT4 DEFAULT '0' NOT NULL CHECK (item_parent_id >= 0), - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - notification_read INT2 DEFAULT '0' NOT NULL CHECK (notification_read >= 0), - notification_time INT4 DEFAULT '1' NOT NULL CHECK (notification_time >= 0), - notification_data varchar(4000) DEFAULT '' NOT NULL, - PRIMARY KEY (notification_id) -); - -CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications (notification_type_id, item_id); -CREATE INDEX phpbb_notifications_user ON phpbb_notifications (user_id, notification_read); - -/* - Table: 'phpbb_oauth_accounts' -*/ -CREATE TABLE phpbb_oauth_accounts ( - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - provider varchar(255) DEFAULT '' NOT NULL, - oauth_provider_id varchar(4000) DEFAULT '' NOT NULL, - PRIMARY KEY (user_id, provider) -); - - -/* - Table: 'phpbb_oauth_tokens' -*/ -CREATE TABLE phpbb_oauth_tokens ( - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - session_id char(32) DEFAULT '' NOT NULL, - provider varchar(255) DEFAULT '' NOT NULL, - oauth_token TEXT DEFAULT '' NOT NULL -); - -CREATE INDEX phpbb_oauth_tokens_user_id ON phpbb_oauth_tokens (user_id); -CREATE INDEX phpbb_oauth_tokens_provider ON phpbb_oauth_tokens (provider); - -/* - Table: 'phpbb_poll_options' -*/ -CREATE TABLE phpbb_poll_options ( - poll_option_id INT2 DEFAULT '0' NOT NULL, - topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0), - poll_option_text varchar(4000) DEFAULT '' NOT NULL, - poll_option_total INT4 DEFAULT '0' NOT NULL CHECK (poll_option_total >= 0) -); - -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); - -/* - Table: 'phpbb_poll_votes' -*/ -CREATE TABLE phpbb_poll_votes ( - topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0), - poll_option_id INT2 DEFAULT '0' NOT NULL, - vote_user_id INT4 DEFAULT '0' NOT NULL CHECK (vote_user_id >= 0), - vote_user_ip varchar(40) DEFAULT '' NOT NULL -); - -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_ip ON phpbb_poll_votes (vote_user_ip); - -/* - Table: 'phpbb_posts' -*/ -CREATE SEQUENCE phpbb_posts_seq; - -CREATE TABLE phpbb_posts ( - post_id INT4 DEFAULT nextval('phpbb_posts_seq'), - topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0), - forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0), - poster_id INT4 DEFAULT '0' NOT NULL CHECK (poster_id >= 0), - icon_id INT4 DEFAULT '0' NOT NULL CHECK (icon_id >= 0), - poster_ip varchar(40) DEFAULT '' NOT NULL, - post_time INT4 DEFAULT '0' NOT NULL CHECK (post_time >= 0), - post_visibility INT2 DEFAULT '0' NOT NULL, - post_reported INT2 DEFAULT '0' NOT NULL CHECK (post_reported >= 0), - enable_bbcode INT2 DEFAULT '1' NOT NULL CHECK (enable_bbcode >= 0), - enable_smilies INT2 DEFAULT '1' NOT NULL CHECK (enable_smilies >= 0), - enable_magic_url INT2 DEFAULT '1' NOT NULL CHECK (enable_magic_url >= 0), - enable_sig INT2 DEFAULT '1' NOT NULL CHECK (enable_sig >= 0), - post_username varchar(255) DEFAULT '' NOT NULL, - post_subject varchar(255) DEFAULT '' NOT NULL, - post_text TEXT DEFAULT '' NOT NULL, - post_checksum varchar(32) DEFAULT '' NOT NULL, - post_attachment INT2 DEFAULT '0' NOT NULL CHECK (post_attachment >= 0), - bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, - bbcode_uid varchar(8) DEFAULT '' NOT NULL, - post_postcount INT2 DEFAULT '1' NOT NULL CHECK (post_postcount >= 0), - post_edit_time INT4 DEFAULT '0' NOT NULL CHECK (post_edit_time >= 0), - post_edit_reason varchar(255) DEFAULT '' NOT NULL, - post_edit_user INT4 DEFAULT '0' NOT NULL CHECK (post_edit_user >= 0), - post_edit_count INT2 DEFAULT '0' NOT NULL CHECK (post_edit_count >= 0), - post_edit_locked INT2 DEFAULT '0' NOT NULL CHECK (post_edit_locked >= 0), - post_delete_time INT4 DEFAULT '0' NOT NULL CHECK (post_delete_time >= 0), - post_delete_reason varchar(255) DEFAULT '' NOT NULL, - post_delete_user INT4 DEFAULT '0' NOT NULL CHECK (post_delete_user >= 0), - PRIMARY KEY (post_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_poster_ip ON phpbb_posts (poster_ip); -CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id); -CREATE INDEX phpbb_posts_post_visibility ON phpbb_posts (post_visibility); -CREATE INDEX phpbb_posts_post_username ON phpbb_posts (post_username); -CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time); - -/* - Table: 'phpbb_privmsgs' -*/ -CREATE SEQUENCE phpbb_privmsgs_seq; - -CREATE TABLE phpbb_privmsgs ( - msg_id INT4 DEFAULT nextval('phpbb_privmsgs_seq'), - root_level INT4 DEFAULT '0' NOT NULL CHECK (root_level >= 0), - author_id INT4 DEFAULT '0' NOT NULL CHECK (author_id >= 0), - icon_id INT4 DEFAULT '0' NOT NULL CHECK (icon_id >= 0), - author_ip varchar(40) DEFAULT '' NOT NULL, - message_time INT4 DEFAULT '0' NOT NULL CHECK (message_time >= 0), - enable_bbcode INT2 DEFAULT '1' NOT NULL CHECK (enable_bbcode >= 0), - enable_smilies INT2 DEFAULT '1' NOT NULL CHECK (enable_smilies >= 0), - enable_magic_url INT2 DEFAULT '1' NOT NULL CHECK (enable_magic_url >= 0), - enable_sig INT2 DEFAULT '1' NOT NULL CHECK (enable_sig >= 0), - message_subject varchar(255) DEFAULT '' NOT NULL, - message_text TEXT DEFAULT '' NOT NULL, - message_edit_reason varchar(255) DEFAULT '' NOT NULL, - message_edit_user INT4 DEFAULT '0' NOT NULL CHECK (message_edit_user >= 0), - message_attachment INT2 DEFAULT '0' NOT NULL CHECK (message_attachment >= 0), - bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, - bbcode_uid varchar(8) DEFAULT '' NOT NULL, - message_edit_time INT4 DEFAULT '0' NOT NULL CHECK (message_edit_time >= 0), - message_edit_count INT2 DEFAULT '0' NOT NULL CHECK (message_edit_count >= 0), - to_address varchar(4000) DEFAULT '' NOT NULL, - bcc_address varchar(4000) DEFAULT '' NOT NULL, - message_reported INT2 DEFAULT '0' NOT NULL CHECK (message_reported >= 0), - PRIMARY KEY (msg_id) -); - -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_author_id ON phpbb_privmsgs (author_id); -CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs (root_level); - -/* - Table: 'phpbb_privmsgs_folder' -*/ -CREATE SEQUENCE phpbb_privmsgs_folder_seq; - -CREATE TABLE phpbb_privmsgs_folder ( - folder_id INT4 DEFAULT nextval('phpbb_privmsgs_folder_seq'), - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - folder_name varchar(255) DEFAULT '' NOT NULL, - pm_count INT4 DEFAULT '0' NOT NULL CHECK (pm_count >= 0), - PRIMARY KEY (folder_id) -); - -CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id); - -/* - Table: 'phpbb_privmsgs_rules' -*/ -CREATE SEQUENCE phpbb_privmsgs_rules_seq; - -CREATE TABLE phpbb_privmsgs_rules ( - rule_id INT4 DEFAULT nextval('phpbb_privmsgs_rules_seq'), - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - rule_check INT4 DEFAULT '0' NOT NULL CHECK (rule_check >= 0), - rule_connection INT4 DEFAULT '0' NOT NULL CHECK (rule_connection >= 0), - rule_string varchar(255) DEFAULT '' NOT NULL, - rule_user_id INT4 DEFAULT '0' NOT NULL CHECK (rule_user_id >= 0), - rule_group_id INT4 DEFAULT '0' NOT NULL CHECK (rule_group_id >= 0), - rule_action INT4 DEFAULT '0' NOT NULL CHECK (rule_action >= 0), - rule_folder_id INT4 DEFAULT '0' NOT NULL, - PRIMARY KEY (rule_id) -); - -CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules (user_id); - -/* - Table: 'phpbb_privmsgs_to' -*/ -CREATE TABLE phpbb_privmsgs_to ( - msg_id INT4 DEFAULT '0' NOT NULL CHECK (msg_id >= 0), - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - author_id INT4 DEFAULT '0' NOT NULL CHECK (author_id >= 0), - pm_deleted INT2 DEFAULT '0' NOT NULL CHECK (pm_deleted >= 0), - pm_new INT2 DEFAULT '1' NOT NULL CHECK (pm_new >= 0), - pm_unread INT2 DEFAULT '1' NOT NULL CHECK (pm_unread >= 0), - pm_replied INT2 DEFAULT '0' NOT NULL CHECK (pm_replied >= 0), - pm_marked INT2 DEFAULT '0' NOT NULL CHECK (pm_marked >= 0), - pm_forwarded INT2 DEFAULT '0' NOT NULL CHECK (pm_forwarded >= 0), - folder_id INT4 DEFAULT '0' NOT NULL -); - -CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id); -CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to (author_id); -CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folder_id); - -/* - Table: 'phpbb_profile_fields' -*/ -CREATE SEQUENCE phpbb_profile_fields_seq; - -CREATE TABLE phpbb_profile_fields ( - field_id INT4 DEFAULT nextval('phpbb_profile_fields_seq'), - field_name varchar(255) DEFAULT '' NOT NULL, - field_type varchar(100) DEFAULT '' NOT NULL, - field_ident varchar(20) DEFAULT '' NOT NULL, - field_length varchar(20) DEFAULT '' NOT NULL, - field_minlen varchar(255) DEFAULT '' NOT NULL, - field_maxlen varchar(255) DEFAULT '' NOT NULL, - field_novalue varchar(255) DEFAULT '' NOT NULL, - field_default_value varchar(255) DEFAULT '' NOT NULL, - field_validation varchar(20) DEFAULT '' NOT NULL, - field_required INT2 DEFAULT '0' NOT NULL CHECK (field_required >= 0), - field_show_novalue INT2 DEFAULT '0' NOT NULL CHECK (field_show_novalue >= 0), - field_show_on_reg INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_reg >= 0), - field_show_on_pm INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_pm >= 0), - field_show_on_vt INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_vt >= 0), - field_show_on_ml INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_ml >= 0), - field_show_profile INT2 DEFAULT '0' NOT NULL CHECK (field_show_profile >= 0), - field_hide INT2 DEFAULT '0' NOT NULL CHECK (field_hide >= 0), - field_no_view INT2 DEFAULT '0' NOT NULL CHECK (field_no_view >= 0), - field_active INT2 DEFAULT '0' NOT NULL CHECK (field_active >= 0), - field_order INT4 DEFAULT '0' NOT NULL CHECK (field_order >= 0), - field_is_contact INT2 DEFAULT '0' NOT NULL CHECK (field_is_contact >= 0), - field_contact_desc varchar(255) DEFAULT '' NOT NULL, - field_contact_url varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (field_id) -); - -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); - -/* - Table: 'phpbb_profile_fields_data' -*/ -CREATE TABLE phpbb_profile_fields_data ( - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - pf_phpbb_location varchar(255) DEFAULT '' NOT NULL, - pf_phpbb_interests varchar(4000) DEFAULT '' NOT NULL, - pf_phpbb_occupation varchar(4000) DEFAULT '' NOT NULL, - pf_phpbb_icq varchar(255) DEFAULT '' NOT NULL, - pf_phpbb_aol varchar(255) DEFAULT '' NOT NULL, - pf_phpbb_wlm varchar(255) DEFAULT '' NOT NULL, - pf_phpbb_yahoo varchar(255) DEFAULT '' NOT NULL, - pf_phpbb_website varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (user_id) -); - - -/* - Table: 'phpbb_profile_fields_lang' -*/ -CREATE TABLE phpbb_profile_fields_lang ( - field_id INT4 DEFAULT '0' NOT NULL CHECK (field_id >= 0), - lang_id INT4 DEFAULT '0' NOT NULL CHECK (lang_id >= 0), - option_id INT4 DEFAULT '0' NOT NULL CHECK (option_id >= 0), - field_type varchar(100) DEFAULT '' NOT NULL, - lang_value varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (field_id, lang_id, option_id) -); - - -/* - Table: 'phpbb_profile_lang' -*/ -CREATE TABLE phpbb_profile_lang ( - field_id INT4 DEFAULT '0' NOT NULL CHECK (field_id >= 0), - lang_id INT4 DEFAULT '0' NOT NULL CHECK (lang_id >= 0), - lang_name varchar(255) DEFAULT '' NOT NULL, - lang_explain varchar(4000) DEFAULT '' NOT NULL, - lang_default_value varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (field_id, lang_id) -); - - -/* - Table: 'phpbb_ranks' -*/ -CREATE SEQUENCE phpbb_ranks_seq; - -CREATE TABLE phpbb_ranks ( - rank_id INT4 DEFAULT nextval('phpbb_ranks_seq'), - rank_title varchar(255) DEFAULT '' NOT NULL, - rank_min INT4 DEFAULT '0' NOT NULL CHECK (rank_min >= 0), - rank_special INT2 DEFAULT '0' NOT NULL CHECK (rank_special >= 0), - rank_image varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (rank_id) -); - - -/* - Table: 'phpbb_reports' -*/ -CREATE SEQUENCE phpbb_reports_seq; - -CREATE TABLE phpbb_reports ( - report_id INT4 DEFAULT nextval('phpbb_reports_seq'), - reason_id INT2 DEFAULT '0' NOT NULL CHECK (reason_id >= 0), - post_id INT4 DEFAULT '0' NOT NULL CHECK (post_id >= 0), - pm_id INT4 DEFAULT '0' NOT NULL CHECK (pm_id >= 0), - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - user_notify INT2 DEFAULT '0' NOT NULL CHECK (user_notify >= 0), - report_closed INT2 DEFAULT '0' NOT NULL CHECK (report_closed >= 0), - report_time INT4 DEFAULT '0' NOT NULL CHECK (report_time >= 0), - report_text TEXT DEFAULT '' NOT NULL, - reported_post_text TEXT DEFAULT '' NOT NULL, - reported_post_uid varchar(8) DEFAULT '' NOT NULL, - reported_post_bitfield varchar(255) DEFAULT '' NOT NULL, - reported_post_enable_magic_url INT2 DEFAULT '1' NOT NULL CHECK (reported_post_enable_magic_url >= 0), - reported_post_enable_smilies INT2 DEFAULT '1' NOT NULL CHECK (reported_post_enable_smilies >= 0), - reported_post_enable_bbcode INT2 DEFAULT '1' NOT NULL CHECK (reported_post_enable_bbcode >= 0), - PRIMARY KEY (report_id) -); - -CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id); -CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id); - -/* - Table: 'phpbb_reports_reasons' -*/ -CREATE SEQUENCE phpbb_reports_reasons_seq; - -CREATE TABLE phpbb_reports_reasons ( - reason_id INT2 DEFAULT nextval('phpbb_reports_reasons_seq'), - reason_title varchar(255) DEFAULT '' NOT NULL, - reason_description TEXT DEFAULT '' NOT NULL, - reason_order INT2 DEFAULT '0' NOT NULL CHECK (reason_order >= 0), - PRIMARY KEY (reason_id) -); - - -/* - Table: 'phpbb_search_results' -*/ -CREATE TABLE phpbb_search_results ( - search_key varchar(32) DEFAULT '' NOT NULL, - search_time INT4 DEFAULT '0' NOT NULL CHECK (search_time >= 0), - search_keywords TEXT DEFAULT '' NOT NULL, - search_authors TEXT DEFAULT '' NOT NULL, - PRIMARY KEY (search_key) -); - - -/* - Table: 'phpbb_search_wordlist' -*/ -CREATE SEQUENCE phpbb_search_wordlist_seq; - -CREATE TABLE phpbb_search_wordlist ( - word_id INT4 DEFAULT nextval('phpbb_search_wordlist_seq'), - word_text varchar(255) DEFAULT '' NOT NULL, - word_common INT2 DEFAULT '0' NOT NULL CHECK (word_common >= 0), - word_count INT4 DEFAULT '0' NOT NULL CHECK (word_count >= 0), - PRIMARY KEY (word_id) -); - -CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist (word_text); -CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist (word_count); - -/* - Table: 'phpbb_search_wordmatch' -*/ -CREATE TABLE phpbb_search_wordmatch ( - post_id INT4 DEFAULT '0' NOT NULL CHECK (post_id >= 0), - word_id INT4 DEFAULT '0' NOT NULL CHECK (word_id >= 0), - title_match INT2 DEFAULT '0' NOT NULL CHECK (title_match >= 0) -); - -CREATE UNIQUE INDEX phpbb_search_wordmatch_unq_mtch ON phpbb_search_wordmatch (word_id, post_id, title_match); -CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id); -CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id); - -/* - Table: 'phpbb_sessions' -*/ -CREATE TABLE phpbb_sessions ( - session_id char(32) DEFAULT '' NOT NULL, - session_user_id INT4 DEFAULT '0' NOT NULL CHECK (session_user_id >= 0), - session_forum_id INT4 DEFAULT '0' NOT NULL CHECK (session_forum_id >= 0), - session_last_visit INT4 DEFAULT '0' NOT NULL CHECK (session_last_visit >= 0), - session_start INT4 DEFAULT '0' NOT NULL CHECK (session_start >= 0), - session_time INT4 DEFAULT '0' NOT NULL CHECK (session_time >= 0), - session_ip varchar(40) DEFAULT '' NOT NULL, - session_browser varchar(150) DEFAULT '' NOT NULL, - session_forwarded_for varchar(255) DEFAULT '' NOT NULL, - session_page varchar(255) DEFAULT '' NOT NULL, - session_viewonline INT2 DEFAULT '1' NOT NULL CHECK (session_viewonline >= 0), - session_autologin INT2 DEFAULT '0' NOT NULL CHECK (session_autologin >= 0), - session_admin INT2 DEFAULT '0' NOT NULL CHECK (session_admin >= 0), - PRIMARY KEY (session_id) -); - -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_fid ON phpbb_sessions (session_forum_id); - -/* - Table: 'phpbb_sessions_keys' -*/ -CREATE TABLE phpbb_sessions_keys ( - key_id char(32) DEFAULT '' NOT NULL, - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - last_ip varchar(40) DEFAULT '' NOT NULL, - last_login INT4 DEFAULT '0' NOT NULL CHECK (last_login >= 0), - PRIMARY KEY (key_id, user_id) -); - -CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login); - -/* - Table: 'phpbb_sitelist' -*/ -CREATE SEQUENCE phpbb_sitelist_seq; - -CREATE TABLE phpbb_sitelist ( - site_id INT4 DEFAULT nextval('phpbb_sitelist_seq'), - site_ip varchar(40) DEFAULT '' NOT NULL, - site_hostname varchar(255) DEFAULT '' NOT NULL, - ip_exclude INT2 DEFAULT '0' NOT NULL CHECK (ip_exclude >= 0), - PRIMARY KEY (site_id) -); - - -/* - Table: 'phpbb_smilies' -*/ -CREATE SEQUENCE phpbb_smilies_seq; - -CREATE TABLE phpbb_smilies ( - smiley_id INT4 DEFAULT nextval('phpbb_smilies_seq'), - code varchar(50) DEFAULT '' NOT NULL, - emotion varchar(50) DEFAULT '' NOT NULL, - smiley_url varchar(50) DEFAULT '' NOT NULL, - smiley_width INT2 DEFAULT '0' NOT NULL CHECK (smiley_width >= 0), - smiley_height INT2 DEFAULT '0' NOT NULL CHECK (smiley_height >= 0), - smiley_order INT4 DEFAULT '0' NOT NULL CHECK (smiley_order >= 0), - display_on_posting INT2 DEFAULT '1' NOT NULL CHECK (display_on_posting >= 0), - PRIMARY KEY (smiley_id) -); - -CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting); - -/* - Table: 'phpbb_styles' -*/ -CREATE SEQUENCE phpbb_styles_seq; - -CREATE TABLE phpbb_styles ( - style_id INT4 DEFAULT nextval('phpbb_styles_seq'), - style_name varchar(255) DEFAULT '' NOT NULL, - style_copyright varchar(255) DEFAULT '' NOT NULL, - style_active INT2 DEFAULT '1' NOT NULL CHECK (style_active >= 0), - style_path varchar(100) DEFAULT '' NOT NULL, - bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL, - style_parent_id INT4 DEFAULT '0' NOT NULL CHECK (style_parent_id >= 0), - style_parent_tree varchar(8000) DEFAULT '' NOT NULL, - PRIMARY KEY (style_id) -); - -CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name); - -/* - Table: 'phpbb_teampage' -*/ -CREATE SEQUENCE phpbb_teampage_seq; - -CREATE TABLE phpbb_teampage ( - teampage_id INT4 DEFAULT nextval('phpbb_teampage_seq'), - group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0), - teampage_name varchar(255) DEFAULT '' NOT NULL, - teampage_position INT4 DEFAULT '0' NOT NULL CHECK (teampage_position >= 0), - teampage_parent INT4 DEFAULT '0' NOT NULL CHECK (teampage_parent >= 0), - PRIMARY KEY (teampage_id) -); - - -/* - Table: 'phpbb_topics' -*/ -CREATE SEQUENCE phpbb_topics_seq; - -CREATE TABLE phpbb_topics ( - topic_id INT4 DEFAULT nextval('phpbb_topics_seq'), - forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0), - icon_id INT4 DEFAULT '0' NOT NULL CHECK (icon_id >= 0), - topic_attachment INT2 DEFAULT '0' NOT NULL CHECK (topic_attachment >= 0), - topic_visibility INT2 DEFAULT '0' NOT NULL, - topic_reported INT2 DEFAULT '0' NOT NULL CHECK (topic_reported >= 0), - topic_title varchar(255) DEFAULT '' NOT NULL, - topic_poster INT4 DEFAULT '0' NOT NULL CHECK (topic_poster >= 0), - topic_time INT4 DEFAULT '0' NOT NULL CHECK (topic_time >= 0), - topic_time_limit INT4 DEFAULT '0' NOT NULL CHECK (topic_time_limit >= 0), - topic_views INT4 DEFAULT '0' NOT NULL CHECK (topic_views >= 0), - topic_posts_approved INT4 DEFAULT '0' NOT NULL CHECK (topic_posts_approved >= 0), - topic_posts_unapproved INT4 DEFAULT '0' NOT NULL CHECK (topic_posts_unapproved >= 0), - topic_posts_softdeleted INT4 DEFAULT '0' NOT NULL CHECK (topic_posts_softdeleted >= 0), - topic_status INT2 DEFAULT '0' NOT NULL, - topic_type INT2 DEFAULT '0' NOT NULL, - topic_first_post_id INT4 DEFAULT '0' NOT NULL CHECK (topic_first_post_id >= 0), - topic_first_poster_name varchar(255) DEFAULT '' NOT NULL, - topic_first_poster_colour varchar(6) DEFAULT '' NOT NULL, - topic_last_post_id INT4 DEFAULT '0' NOT NULL CHECK (topic_last_post_id >= 0), - topic_last_poster_id INT4 DEFAULT '0' NOT NULL CHECK (topic_last_poster_id >= 0), - topic_last_poster_name varchar(255) DEFAULT '' NOT NULL, - topic_last_poster_colour varchar(6) DEFAULT '' NOT NULL, - topic_last_post_subject varchar(255) DEFAULT '' NOT NULL, - topic_last_post_time INT4 DEFAULT '0' NOT NULL CHECK (topic_last_post_time >= 0), - topic_last_view_time INT4 DEFAULT '0' NOT NULL CHECK (topic_last_view_time >= 0), - topic_moved_id INT4 DEFAULT '0' NOT NULL CHECK (topic_moved_id >= 0), - topic_bumped INT2 DEFAULT '0' NOT NULL CHECK (topic_bumped >= 0), - topic_bumper INT4 DEFAULT '0' NOT NULL CHECK (topic_bumper >= 0), - poll_title varchar(255) DEFAULT '' NOT NULL, - poll_start INT4 DEFAULT '0' NOT NULL CHECK (poll_start >= 0), - poll_length INT4 DEFAULT '0' NOT NULL CHECK (poll_length >= 0), - poll_max_options INT2 DEFAULT '1' NOT NULL, - poll_last_vote INT4 DEFAULT '0' NOT NULL CHECK (poll_last_vote >= 0), - poll_vote_change INT2 DEFAULT '0' NOT NULL CHECK (poll_vote_change >= 0), - topic_delete_time INT4 DEFAULT '0' NOT NULL CHECK (topic_delete_time >= 0), - topic_delete_reason varchar(255) DEFAULT '' NOT NULL, - topic_delete_user INT4 DEFAULT '0' NOT NULL CHECK (topic_delete_user >= 0), - PRIMARY KEY (topic_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_last_post_time ON phpbb_topics (topic_last_post_time); -CREATE INDEX phpbb_topics_topic_visibility ON phpbb_topics (topic_visibility); -CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics (forum_id, topic_visibility, topic_last_post_id); -CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id); - -/* - Table: 'phpbb_topics_track' -*/ -CREATE TABLE phpbb_topics_track ( - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0), - forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0), - mark_time INT4 DEFAULT '0' NOT NULL CHECK (mark_time >= 0), - PRIMARY KEY (user_id, topic_id) -); - -CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id); -CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id); - -/* - Table: 'phpbb_topics_posted' -*/ -CREATE TABLE phpbb_topics_posted ( - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0), - topic_posted INT2 DEFAULT '0' NOT NULL CHECK (topic_posted >= 0), - PRIMARY KEY (user_id, topic_id) -); - - -/* - Table: 'phpbb_topics_watch' -*/ -CREATE TABLE phpbb_topics_watch ( - topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0), - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - notify_status INT2 DEFAULT '0' NOT NULL CHECK (notify_status >= 0) -); - -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_notify_stat ON phpbb_topics_watch (notify_status); - -/* - Table: 'phpbb_user_notifications' -*/ -CREATE TABLE phpbb_user_notifications ( - item_type varchar(255) DEFAULT '' NOT NULL, - item_id INT4 DEFAULT '0' NOT NULL CHECK (item_id >= 0), - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - method varchar(255) DEFAULT '' NOT NULL, - notify INT2 DEFAULT '1' NOT NULL CHECK (notify >= 0) -); - - -/* - Table: 'phpbb_user_group' -*/ -CREATE TABLE phpbb_user_group ( - group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0), - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - group_leader INT2 DEFAULT '0' NOT NULL CHECK (group_leader >= 0), - user_pending INT2 DEFAULT '1' NOT NULL CHECK (user_pending >= 0) -); - -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_group_leader ON phpbb_user_group (group_leader); - -/* - Table: 'phpbb_users' -*/ -CREATE SEQUENCE phpbb_users_seq; - -CREATE TABLE phpbb_users ( - user_id INT4 DEFAULT nextval('phpbb_users_seq'), - user_type INT2 DEFAULT '0' NOT NULL, - group_id INT4 DEFAULT '3' NOT NULL CHECK (group_id >= 0), - user_permissions TEXT DEFAULT '' NOT NULL, - user_perm_from INT4 DEFAULT '0' NOT NULL CHECK (user_perm_from >= 0), - user_ip varchar(40) DEFAULT '' NOT NULL, - user_regdate INT4 DEFAULT '0' NOT NULL CHECK (user_regdate >= 0), - username varchar_ci DEFAULT '' NOT NULL, - username_clean varchar_ci DEFAULT '' NOT NULL, - user_password varchar(255) DEFAULT '' NOT NULL, - user_passchg INT4 DEFAULT '0' NOT NULL CHECK (user_passchg >= 0), - user_pass_convert INT2 DEFAULT '0' NOT NULL CHECK (user_pass_convert >= 0), - user_actkey varchar(32) DEFAULT '' NOT NULL, - user_newpasswd varchar(255) DEFAULT '' NOT NULL, - user_email varchar(100) DEFAULT '' NOT NULL, - user_email_hash INT8 DEFAULT '0' NOT NULL, - user_birthday varchar(10) DEFAULT '' NOT NULL, - user_lastvisit INT4 DEFAULT '0' NOT NULL CHECK (user_lastvisit >= 0), - user_lastmark INT4 DEFAULT '0' NOT NULL CHECK (user_lastmark >= 0), - user_lastpost_time INT4 DEFAULT '0' NOT NULL CHECK (user_lastpost_time >= 0), - user_lastpage varchar(200) DEFAULT '' NOT NULL, - user_last_confirm_key varchar(10) DEFAULT '' NOT NULL, - user_last_search INT4 DEFAULT '0' NOT NULL CHECK (user_last_search >= 0), - user_warnings INT2 DEFAULT '0' NOT NULL, - user_last_warning INT4 DEFAULT '0' NOT NULL CHECK (user_last_warning >= 0), - user_login_attempts INT2 DEFAULT '0' NOT NULL, - user_inactive_reason INT2 DEFAULT '0' NOT NULL, - user_inactive_time INT4 DEFAULT '0' NOT NULL CHECK (user_inactive_time >= 0), - user_posts INT4 DEFAULT '0' NOT NULL CHECK (user_posts >= 0), - user_lang varchar(30) DEFAULT '' NOT NULL, - user_timezone varchar(100) DEFAULT 'UTC' NOT NULL, - user_dateformat varchar(30) DEFAULT 'd M Y H:i' NOT NULL, - user_style INT4 DEFAULT '0' NOT NULL CHECK (user_style >= 0), - user_rank INT4 DEFAULT '0' NOT NULL CHECK (user_rank >= 0), - user_colour varchar(6) DEFAULT '' NOT NULL, - user_new_privmsg INT4 DEFAULT '0' NOT NULL, - user_unread_privmsg INT4 DEFAULT '0' NOT NULL, - user_last_privmsg INT4 DEFAULT '0' NOT NULL CHECK (user_last_privmsg >= 0), - user_message_rules INT2 DEFAULT '0' NOT NULL CHECK (user_message_rules >= 0), - user_full_folder INT4 DEFAULT '-3' NOT NULL, - user_emailtime INT4 DEFAULT '0' NOT NULL CHECK (user_emailtime >= 0), - user_topic_show_days INT2 DEFAULT '0' NOT NULL CHECK (user_topic_show_days >= 0), - user_topic_sortby_type varchar(1) DEFAULT 't' NOT NULL, - user_topic_sortby_dir varchar(1) DEFAULT 'd' NOT NULL, - user_post_show_days INT2 DEFAULT '0' NOT NULL CHECK (user_post_show_days >= 0), - user_post_sortby_type varchar(1) DEFAULT 't' NOT NULL, - user_post_sortby_dir varchar(1) DEFAULT 'a' NOT NULL, - user_notify INT2 DEFAULT '0' NOT NULL CHECK (user_notify >= 0), - user_notify_pm INT2 DEFAULT '1' NOT NULL CHECK (user_notify_pm >= 0), - user_notify_type INT2 DEFAULT '0' NOT NULL, - user_allow_pm INT2 DEFAULT '1' NOT NULL CHECK (user_allow_pm >= 0), - user_allow_viewonline INT2 DEFAULT '1' NOT NULL CHECK (user_allow_viewonline >= 0), - user_allow_viewemail INT2 DEFAULT '1' NOT NULL CHECK (user_allow_viewemail >= 0), - user_allow_massemail INT2 DEFAULT '1' NOT NULL CHECK (user_allow_massemail >= 0), - user_options INT4 DEFAULT '230271' NOT NULL CHECK (user_options >= 0), - user_avatar varchar(255) DEFAULT '' NOT NULL, - user_avatar_type varchar(255) DEFAULT '' NOT NULL, - user_avatar_width INT2 DEFAULT '0' NOT NULL CHECK (user_avatar_width >= 0), - user_avatar_height INT2 DEFAULT '0' NOT NULL CHECK (user_avatar_height >= 0), - user_sig TEXT DEFAULT '' NOT NULL, - user_sig_bbcode_uid varchar(8) DEFAULT '' NOT NULL, - user_sig_bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, - user_jabber varchar(255) DEFAULT '' NOT NULL, - user_form_salt varchar(32) DEFAULT '' NOT NULL, - user_new INT2 DEFAULT '1' NOT NULL CHECK (user_new >= 0), - user_reminded INT2 DEFAULT '0' NOT NULL, - user_reminded_time INT4 DEFAULT '0' NOT NULL CHECK (user_reminded_time >= 0), - PRIMARY KEY (user_id) -); - -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_type ON phpbb_users (user_type); -CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users (username_clean); - -/* - Table: 'phpbb_warnings' -*/ -CREATE SEQUENCE phpbb_warnings_seq; - -CREATE TABLE phpbb_warnings ( - warning_id INT4 DEFAULT nextval('phpbb_warnings_seq'), - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - post_id INT4 DEFAULT '0' NOT NULL CHECK (post_id >= 0), - log_id INT4 DEFAULT '0' NOT NULL CHECK (log_id >= 0), - warning_time INT4 DEFAULT '0' NOT NULL CHECK (warning_time >= 0), - PRIMARY KEY (warning_id) -); - - -/* - Table: 'phpbb_words' -*/ -CREATE SEQUENCE phpbb_words_seq; - -CREATE TABLE phpbb_words ( - word_id INT4 DEFAULT nextval('phpbb_words_seq'), - word varchar(255) DEFAULT '' NOT NULL, - replacement varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (word_id) -); - - -/* - Table: 'phpbb_zebra' -*/ -CREATE TABLE phpbb_zebra ( - user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - zebra_id INT4 DEFAULT '0' NOT NULL CHECK (zebra_id >= 0), - friend INT2 DEFAULT '0' NOT NULL CHECK (friend >= 0), - foe INT2 DEFAULT '0' NOT NULL CHECK (foe >= 0), - PRIMARY KEY (user_id, zebra_id) -); - - +COMMIT; -COMMIT;
\ No newline at end of file diff --git a/phpBB/install/schemas/schema.json b/phpBB/install/schemas/schema.json new file mode 100644 index 0000000000..15d2fd6e84 --- /dev/null +++ b/phpBB/install/schemas/schema.json @@ -0,0 +1,3324 @@ +{ + "phpbb_acl_groups": { + "COLUMNS": { + "group_id": [ + "UINT", + 0 + ], + "forum_id": [ + "UINT", + 0 + ], + "auth_option_id": [ + "UINT", + 0 + ], + "auth_role_id": [ + "UINT", + 0 + ], + "auth_setting": [ + "TINT:2", + 0 + ] + }, + "KEYS": { + "group_id": [ + "INDEX", + "group_id" + ], + "auth_opt_id": [ + "INDEX", + "auth_option_id" + ], + "auth_role_id": [ + "INDEX", + "auth_role_id" + ] + } + }, + "phpbb_acl_options": { + "COLUMNS": { + "auth_option_id": [ + "UINT", + null, + "auto_increment" + ], + "auth_option": [ + "VCHAR:50", + "" + ], + "is_global": [ + "BOOL", + 0 + ], + "is_local": [ + "BOOL", + 0 + ], + "founder_only": [ + "BOOL", + 0 + ] + }, + "PRIMARY_KEY": "auth_option_id", + "KEYS": { + "auth_option": [ + "UNIQUE", + [ + "auth_option" + ] + ] + } + }, + "phpbb_acl_roles": { + "COLUMNS": { + "role_id": [ + "UINT", + null, + "auto_increment" + ], + "role_name": [ + "VCHAR_UNI", + "" + ], + "role_description": [ + "TEXT_UNI", + "" + ], + "role_type": [ + "VCHAR:10", + "" + ], + "role_order": [ + "USINT", + 0 + ] + }, + "PRIMARY_KEY": "role_id", + "KEYS": { + "role_type": [ + "INDEX", + "role_type" + ], + "role_order": [ + "INDEX", + "role_order" + ] + } + }, + "phpbb_acl_roles_data": { + "COLUMNS": { + "role_id": [ + "UINT", + 0 + ], + "auth_option_id": [ + "UINT", + 0 + ], + "auth_setting": [ + "TINT:2", + 0 + ] + }, + "PRIMARY_KEY": [ + "role_id", + "auth_option_id" + ], + "KEYS": { + "ath_op_id": [ + "INDEX", + "auth_option_id" + ] + } + }, + "phpbb_acl_users": { + "COLUMNS": { + "user_id": [ + "UINT", + 0 + ], + "forum_id": [ + "UINT", + 0 + ], + "auth_option_id": [ + "UINT", + 0 + ], + "auth_role_id": [ + "UINT", + 0 + ], + "auth_setting": [ + "TINT:2", + 0 + ] + }, + "KEYS": { + "user_id": [ + "INDEX", + "user_id" + ], + "auth_option_id": [ + "INDEX", + "auth_option_id" + ], + "auth_role_id": [ + "INDEX", + "auth_role_id" + ] + } + }, + "phpbb_attachments": { + "COLUMNS": { + "attach_id": [ + "UINT", + null, + "auto_increment" + ], + "post_msg_id": [ + "UINT", + 0 + ], + "topic_id": [ + "UINT", + 0 + ], + "in_message": [ + "BOOL", + 0 + ], + "poster_id": [ + "UINT", + 0 + ], + "is_orphan": [ + "BOOL", + 1 + ], + "physical_filename": [ + "VCHAR", + "" + ], + "real_filename": [ + "VCHAR", + "" + ], + "download_count": [ + "UINT", + 0 + ], + "attach_comment": [ + "TEXT_UNI", + "" + ], + "extension": [ + "VCHAR:100", + "" + ], + "mimetype": [ + "VCHAR:100", + "" + ], + "filesize": [ + "UINT:20", + 0 + ], + "filetime": [ + "TIMESTAMP", + 0 + ], + "thumbnail": [ + "BOOL", + 0 + ] + }, + "PRIMARY_KEY": "attach_id", + "KEYS": { + "filetime": [ + "INDEX", + "filetime" + ], + "post_msg_id": [ + "INDEX", + "post_msg_id" + ], + "topic_id": [ + "INDEX", + "topic_id" + ], + "poster_id": [ + "INDEX", + "poster_id" + ], + "is_orphan": [ + "INDEX", + "is_orphan" + ] + } + }, + "phpbb_banlist": { + "COLUMNS": { + "ban_id": [ + "UINT", + null, + "auto_increment" + ], + "ban_userid": [ + "UINT", + 0 + ], + "ban_ip": [ + "VCHAR:40", + "" + ], + "ban_email": [ + "VCHAR_UNI:100", + "" + ], + "ban_start": [ + "TIMESTAMP", + 0 + ], + "ban_end": [ + "TIMESTAMP", + 0 + ], + "ban_exclude": [ + "BOOL", + 0 + ], + "ban_reason": [ + "VCHAR_UNI", + "" + ], + "ban_give_reason": [ + "VCHAR_UNI", + "" + ] + }, + "PRIMARY_KEY": "ban_id", + "KEYS": { + "ban_end": [ + "INDEX", + "ban_end" + ], + "ban_user": [ + "INDEX", + [ + "ban_userid", + "ban_exclude" + ] + ], + "ban_email": [ + "INDEX", + [ + "ban_email", + "ban_exclude" + ] + ], + "ban_ip": [ + "INDEX", + [ + "ban_ip", + "ban_exclude" + ] + ] + } + }, + "phpbb_bbcodes": { + "COLUMNS": { + "bbcode_id": [ + "USINT", + 0 + ], + "bbcode_tag": [ + "VCHAR:16", + "" + ], + "bbcode_helpline": [ + "VCHAR_UNI", + "" + ], + "display_on_posting": [ + "BOOL", + 0 + ], + "bbcode_match": [ + "TEXT_UNI", + "" + ], + "bbcode_tpl": [ + "MTEXT_UNI", + "" + ], + "first_pass_match": [ + "MTEXT_UNI", + "" + ], + "first_pass_replace": [ + "MTEXT_UNI", + "" + ], + "second_pass_match": [ + "MTEXT_UNI", + "" + ], + "second_pass_replace": [ + "MTEXT_UNI", + "" + ] + }, + "PRIMARY_KEY": "bbcode_id", + "KEYS": { + "display_on_post": [ + "INDEX", + "display_on_posting" + ] + } + }, + "phpbb_bookmarks": { + "COLUMNS": { + "topic_id": [ + "UINT", + 0 + ], + "user_id": [ + "UINT", + 0 + ] + }, + "PRIMARY_KEY": [ + "topic_id", + "user_id" + ] + }, + "phpbb_bots": { + "COLUMNS": { + "bot_id": [ + "UINT", + null, + "auto_increment" + ], + "bot_active": [ + "BOOL", + 1 + ], + "bot_name": [ + "STEXT_UNI", + "" + ], + "user_id": [ + "UINT", + 0 + ], + "bot_agent": [ + "VCHAR", + "" + ], + "bot_ip": [ + "VCHAR", + "" + ] + }, + "PRIMARY_KEY": "bot_id", + "KEYS": { + "bot_active": [ + "INDEX", + "bot_active" + ] + } + }, + "phpbb_config": { + "COLUMNS": { + "config_name": [ + "VCHAR", + "" + ], + "config_value": [ + "VCHAR_UNI", + "" + ], + "is_dynamic": [ + "BOOL", + 0 + ] + }, + "PRIMARY_KEY": "config_name", + "KEYS": { + "is_dynamic": [ + "INDEX", + "is_dynamic" + ] + } + }, + "phpbb_config_text": { + "COLUMNS": { + "config_name": [ + "VCHAR", + "" + ], + "config_value": [ + "MTEXT", + "" + ] + }, + "PRIMARY_KEY": "config_name" + }, + "phpbb_confirm": { + "COLUMNS": { + "confirm_id": [ + "CHAR:32", + "" + ], + "session_id": [ + "CHAR:32", + "" + ], + "confirm_type": [ + "TINT:3", + 0 + ], + "code": [ + "VCHAR:8", + "" + ], + "seed": [ + "UINT:10", + 0 + ], + "attempts": [ + "UINT", + 0 + ] + }, + "PRIMARY_KEY": [ + "session_id", + "confirm_id" + ], + "KEYS": { + "confirm_type": [ + "INDEX", + "confirm_type" + ] + } + }, + "phpbb_disallow": { + "COLUMNS": { + "disallow_id": [ + "UINT", + null, + "auto_increment" + ], + "disallow_username": [ + "VCHAR_UNI:255", + "" + ] + }, + "PRIMARY_KEY": "disallow_id" + }, + "phpbb_drafts": { + "COLUMNS": { + "draft_id": [ + "UINT", + null, + "auto_increment" + ], + "user_id": [ + "UINT", + 0 + ], + "topic_id": [ + "UINT", + 0 + ], + "forum_id": [ + "UINT", + 0 + ], + "save_time": [ + "TIMESTAMP", + 0 + ], + "draft_subject": [ + "STEXT_UNI", + "" + ], + "draft_message": [ + "MTEXT_UNI", + "" + ] + }, + "PRIMARY_KEY": "draft_id", + "KEYS": { + "save_time": [ + "INDEX", + "save_time" + ] + } + }, + "phpbb_ext": { + "COLUMNS": { + "ext_name": [ + "VCHAR", + "" + ], + "ext_active": [ + "BOOL", + 0 + ], + "ext_state": [ + "TEXT", + "" + ] + }, + "KEYS": { + "ext_name": [ + "UNIQUE", + "ext_name" + ] + } + }, + "phpbb_extension_groups": { + "COLUMNS": { + "group_id": [ + "UINT", + null, + "auto_increment" + ], + "group_name": [ + "VCHAR_UNI", + "" + ], + "cat_id": [ + "TINT:2", + 0 + ], + "allow_group": [ + "BOOL", + 0 + ], + "download_mode": [ + "BOOL", + 1 + ], + "upload_icon": [ + "VCHAR", + "" + ], + "max_filesize": [ + "UINT:20", + 0 + ], + "allowed_forums": [ + "TEXT", + "" + ], + "allow_in_pm": [ + "BOOL", + 0 + ] + }, + "PRIMARY_KEY": "group_id" + }, + "phpbb_extensions": { + "COLUMNS": { + "extension_id": [ + "UINT", + null, + "auto_increment" + ], + "group_id": [ + "UINT", + 0 + ], + "extension": [ + "VCHAR:100", + "" + ] + }, + "PRIMARY_KEY": "extension_id" + }, + "phpbb_forums": { + "COLUMNS": { + "forum_id": [ + "UINT", + null, + "auto_increment" + ], + "parent_id": [ + "UINT", + 0 + ], + "left_id": [ + "UINT", + 0 + ], + "right_id": [ + "UINT", + 0 + ], + "forum_parents": [ + "MTEXT", + "" + ], + "forum_name": [ + "STEXT_UNI", + "" + ], + "forum_desc": [ + "TEXT_UNI", + "" + ], + "forum_desc_bitfield": [ + "VCHAR:255", + "" + ], + "forum_desc_options": [ + "UINT:11", + 7 + ], + "forum_desc_uid": [ + "VCHAR:8", + "" + ], + "forum_link": [ + "VCHAR_UNI", + "" + ], + "forum_password": [ + "VCHAR:255", + "" + ], + "forum_style": [ + "UINT", + 0 + ], + "forum_image": [ + "VCHAR", + "" + ], + "forum_rules": [ + "TEXT_UNI", + "" + ], + "forum_rules_link": [ + "VCHAR_UNI", + "" + ], + "forum_rules_bitfield": [ + "VCHAR:255", + "" + ], + "forum_rules_options": [ + "UINT:11", + 7 + ], + "forum_rules_uid": [ + "VCHAR:8", + "" + ], + "forum_topics_per_page": [ + "TINT:4", + 0 + ], + "forum_type": [ + "TINT:4", + 0 + ], + "forum_status": [ + "TINT:4", + 0 + ], + "forum_last_post_id": [ + "UINT", + 0 + ], + "forum_last_poster_id": [ + "UINT", + 0 + ], + "forum_last_post_subject": [ + "STEXT_UNI", + "" + ], + "forum_last_post_time": [ + "TIMESTAMP", + 0 + ], + "forum_last_poster_name": [ + "VCHAR_UNI", + "" + ], + "forum_last_poster_colour": [ + "VCHAR:6", + "" + ], + "forum_flags": [ + "TINT:4", + 32 + ], + "display_on_index": [ + "BOOL", + 1 + ], + "enable_indexing": [ + "BOOL", + 1 + ], + "enable_icons": [ + "BOOL", + 1 + ], + "enable_prune": [ + "BOOL", + 0 + ], + "prune_next": [ + "TIMESTAMP", + 0 + ], + "prune_days": [ + "UINT", + 0 + ], + "prune_viewed": [ + "UINT", + 0 + ], + "prune_freq": [ + "UINT", + 0 + ], + "display_subforum_list": [ + "BOOL", + 1 + ], + "forum_options": [ + "UINT:20", + 0 + ], + "forum_posts_approved": [ + "UINT", + 0 + ], + "forum_posts_unapproved": [ + "UINT", + 0 + ], + "forum_posts_softdeleted": [ + "UINT", + 0 + ], + "forum_topics_approved": [ + "UINT", + 0 + ], + "forum_topics_unapproved": [ + "UINT", + 0 + ], + "forum_topics_softdeleted": [ + "UINT", + 0 + ] + }, + "PRIMARY_KEY": "forum_id", + "KEYS": { + "left_right_id": [ + "INDEX", + [ + "left_id", + "right_id" + ] + ], + "forum_lastpost_id": [ + "INDEX", + "forum_last_post_id" + ] + } + }, + "phpbb_forums_access": { + "COLUMNS": { + "forum_id": [ + "UINT", + 0 + ], + "user_id": [ + "UINT", + 0 + ], + "session_id": [ + "CHAR:32", + "" + ] + }, + "PRIMARY_KEY": [ + "forum_id", + "user_id", + "session_id" + ] + }, + "phpbb_forums_track": { + "COLUMNS": { + "user_id": [ + "UINT", + 0 + ], + "forum_id": [ + "UINT", + 0 + ], + "mark_time": [ + "TIMESTAMP", + 0 + ] + }, + "PRIMARY_KEY": [ + "user_id", + "forum_id" + ] + }, + "phpbb_forums_watch": { + "COLUMNS": { + "forum_id": [ + "UINT", + 0 + ], + "user_id": [ + "UINT", + 0 + ], + "notify_status": [ + "BOOL", + 0 + ] + }, + "KEYS": { + "forum_id": [ + "INDEX", + "forum_id" + ], + "user_id": [ + "INDEX", + "user_id" + ], + "notify_stat": [ + "INDEX", + "notify_status" + ] + } + }, + "phpbb_groups": { + "COLUMNS": { + "group_id": [ + "UINT", + null, + "auto_increment" + ], + "group_type": [ + "TINT:4", + 1 + ], + "group_founder_manage": [ + "BOOL", + 0 + ], + "group_name": [ + "VCHAR_CI", + "" + ], + "group_desc": [ + "TEXT_UNI", + "" + ], + "group_desc_bitfield": [ + "VCHAR:255", + "" + ], + "group_desc_options": [ + "UINT:11", + 7 + ], + "group_desc_uid": [ + "VCHAR:8", + "" + ], + "group_display": [ + "BOOL", + 0 + ], + "group_avatar": [ + "VCHAR", + "" + ], + "group_avatar_type": [ + "VCHAR:255", + "" + ], + "group_avatar_width": [ + "USINT", + 0 + ], + "group_avatar_height": [ + "USINT", + 0 + ], + "group_rank": [ + "UINT", + 0 + ], + "group_colour": [ + "VCHAR:6", + "" + ], + "group_sig_chars": [ + "UINT", + 0 + ], + "group_receive_pm": [ + "BOOL", + 0 + ], + "group_message_limit": [ + "UINT", + 0 + ], + "group_legend": [ + "UINT", + 0 + ], + "group_max_recipients": [ + "UINT", + 0 + ], + "group_skip_auth": { + "0": "BOOL", + "1": 0, + "after": "group_founder_manage" + } + }, + "PRIMARY_KEY": "group_id", + "KEYS": { + "group_legend_name": [ + "INDEX", + [ + "group_legend", + "group_name" + ] + ] + } + }, + "phpbb_icons": { + "COLUMNS": { + "icons_id": [ + "UINT", + null, + "auto_increment" + ], + "icons_url": [ + "VCHAR", + "" + ], + "icons_width": [ + "TINT:4", + 0 + ], + "icons_height": [ + "TINT:4", + 0 + ], + "icons_order": [ + "UINT", + 0 + ], + "display_on_posting": [ + "BOOL", + 1 + ] + }, + "PRIMARY_KEY": "icons_id", + "KEYS": { + "display_on_posting": [ + "INDEX", + "display_on_posting" + ] + } + }, + "phpbb_lang": { + "COLUMNS": { + "lang_id": [ + "TINT:4", + null, + "auto_increment" + ], + "lang_iso": [ + "VCHAR:30", + "" + ], + "lang_dir": [ + "VCHAR:30", + "" + ], + "lang_english_name": [ + "VCHAR_UNI:100", + "" + ], + "lang_local_name": [ + "VCHAR_UNI:255", + "" + ], + "lang_author": [ + "VCHAR_UNI:255", + "" + ] + }, + "PRIMARY_KEY": "lang_id", + "KEYS": { + "lang_iso": [ + "INDEX", + "lang_iso" + ] + } + }, + "phpbb_log": { + "COLUMNS": { + "log_id": [ + "UINT", + null, + "auto_increment" + ], + "log_type": [ + "TINT:4", + 0 + ], + "user_id": [ + "UINT", + 0 + ], + "forum_id": [ + "UINT", + 0 + ], + "topic_id": [ + "UINT", + 0 + ], + "reportee_id": [ + "UINT", + 0 + ], + "log_ip": [ + "VCHAR:40", + "" + ], + "log_time": [ + "TIMESTAMP", + 0 + ], + "log_operation": [ + "TEXT_UNI", + "" + ], + "log_data": [ + "MTEXT_UNI", + "" + ] + }, + "PRIMARY_KEY": "log_id", + "KEYS": { + "log_type": [ + "INDEX", + "log_type" + ], + "forum_id": [ + "INDEX", + "forum_id" + ], + "topic_id": [ + "INDEX", + "topic_id" + ], + "reportee_id": [ + "INDEX", + "reportee_id" + ], + "user_id": [ + "INDEX", + "user_id" + ] + } + }, + "phpbb_login_attempts": { + "COLUMNS": { + "attempt_ip": [ + "VCHAR:40", + "" + ], + "attempt_browser": [ + "VCHAR:150", + "" + ], + "attempt_forwarded_for": [ + "VCHAR:255", + "" + ], + "attempt_time": [ + "TIMESTAMP", + 0 + ], + "user_id": [ + "UINT", + 0 + ], + "username": [ + "VCHAR_UNI:255", + 0 + ], + "username_clean": [ + "VCHAR_CI", + 0 + ] + }, + "KEYS": { + "att_ip": [ + "INDEX", + [ + "attempt_ip", + "attempt_time" + ] + ], + "att_for": [ + "INDEX", + [ + "attempt_forwarded_for", + "attempt_time" + ] + ], + "att_time": [ + "INDEX", + [ + "attempt_time" + ] + ], + "user_id": [ + "INDEX", + "user_id" + ] + } + }, + "phpbb_migrations": { + "COLUMNS": { + "migration_name": [ + "VCHAR", + "" + ], + "migration_depends_on": [ + "TEXT", + "" + ], + "migration_schema_done": [ + "BOOL", + 0 + ], + "migration_data_done": [ + "BOOL", + 0 + ], + "migration_data_state": [ + "TEXT", + "" + ], + "migration_start_time": [ + "TIMESTAMP", + 0 + ], + "migration_end_time": [ + "TIMESTAMP", + 0 + ] + }, + "PRIMARY_KEY": "migration_name" + }, + "phpbb_moderator_cache": { + "COLUMNS": { + "forum_id": [ + "UINT", + 0 + ], + "user_id": [ + "UINT", + 0 + ], + "username": [ + "VCHAR_UNI:255", + "" + ], + "group_id": [ + "UINT", + 0 + ], + "group_name": [ + "VCHAR_UNI", + "" + ], + "display_on_index": [ + "BOOL", + 1 + ] + }, + "KEYS": { + "disp_idx": [ + "INDEX", + "display_on_index" + ], + "forum_id": [ + "INDEX", + "forum_id" + ] + } + }, + "phpbb_modules": { + "COLUMNS": { + "module_id": [ + "UINT", + null, + "auto_increment" + ], + "module_enabled": [ + "BOOL", + 1 + ], + "module_display": [ + "BOOL", + 1 + ], + "module_basename": [ + "VCHAR", + "" + ], + "module_class": [ + "VCHAR:10", + "" + ], + "parent_id": [ + "UINT", + 0 + ], + "left_id": [ + "UINT", + 0 + ], + "right_id": [ + "UINT", + 0 + ], + "module_langname": [ + "VCHAR", + "" + ], + "module_mode": [ + "VCHAR", + "" + ], + "module_auth": [ + "VCHAR", + "" + ] + }, + "PRIMARY_KEY": "module_id", + "KEYS": { + "left_right_id": [ + "INDEX", + [ + "left_id", + "right_id" + ] + ], + "module_enabled": [ + "INDEX", + "module_enabled" + ], + "class_left_id": [ + "INDEX", + [ + "module_class", + "left_id" + ] + ] + } + }, + "phpbb_notification_types": { + "COLUMNS": { + "notification_type_id": [ + "USINT", + null, + "auto_increment" + ], + "notification_type_name": [ + "VCHAR:255", + "" + ], + "notification_type_enabled": [ + "BOOL", + 1 + ] + }, + "PRIMARY_KEY": [ + "notification_type_id" + ], + "KEYS": { + "type": [ + "UNIQUE", + [ + "notification_type_name" + ] + ] + } + }, + "phpbb_notifications": { + "COLUMNS": { + "notification_id": [ + "UINT:10", + null, + "auto_increment" + ], + "notification_type_id": [ + "USINT", + 0 + ], + "item_id": [ + "UINT", + 0 + ], + "item_parent_id": [ + "UINT", + 0 + ], + "user_id": [ + "UINT", + 0 + ], + "notification_read": [ + "BOOL", + 0 + ], + "notification_time": [ + "TIMESTAMP", + 1 + ], + "notification_data": [ + "TEXT_UNI", + "" + ] + }, + "PRIMARY_KEY": "notification_id", + "KEYS": { + "item_ident": [ + "INDEX", + [ + "notification_type_id", + "item_id" + ] + ], + "user": [ + "INDEX", + [ + "user_id", + "notification_read" + ] + ] + } + }, + "phpbb_oauth_accounts": { + "COLUMNS": { + "user_id": [ + "UINT", + 0 + ], + "provider": [ + "VCHAR", + "" + ], + "oauth_provider_id": [ + "TEXT_UNI", + "" + ] + }, + "PRIMARY_KEY": [ + "user_id", + "provider" + ] + }, + "phpbb_oauth_tokens": { + "COLUMNS": { + "user_id": [ + "UINT", + 0 + ], + "session_id": [ + "CHAR:32", + "" + ], + "provider": [ + "VCHAR", + "" + ], + "oauth_token": [ + "MTEXT", + "" + ] + }, + "KEYS": { + "user_id": [ + "INDEX", + "user_id" + ], + "provider": [ + "INDEX", + "provider" + ] + } + }, + "phpbb_poll_options": { + "COLUMNS": { + "poll_option_id": [ + "TINT:4", + 0 + ], + "topic_id": [ + "UINT", + 0 + ], + "poll_option_text": [ + "TEXT_UNI", + "" + ], + "poll_option_total": [ + "UINT", + 0 + ] + }, + "KEYS": { + "poll_opt_id": [ + "INDEX", + "poll_option_id" + ], + "topic_id": [ + "INDEX", + "topic_id" + ] + } + }, + "phpbb_poll_votes": { + "COLUMNS": { + "topic_id": [ + "UINT", + 0 + ], + "poll_option_id": [ + "TINT:4", + 0 + ], + "vote_user_id": [ + "UINT", + 0 + ], + "vote_user_ip": [ + "VCHAR:40", + "" + ] + }, + "KEYS": { + "topic_id": [ + "INDEX", + "topic_id" + ], + "vote_user_id": [ + "INDEX", + "vote_user_id" + ], + "vote_user_ip": [ + "INDEX", + "vote_user_ip" + ] + } + }, + "phpbb_posts": { + "COLUMNS": { + "post_id": [ + "UINT", + null, + "auto_increment" + ], + "topic_id": [ + "UINT", + 0 + ], + "forum_id": [ + "UINT", + 0 + ], + "poster_id": [ + "UINT", + 0 + ], + "icon_id": [ + "UINT", + 0 + ], + "poster_ip": [ + "VCHAR:40", + "" + ], + "post_time": [ + "TIMESTAMP", + 0 + ], + "post_reported": [ + "BOOL", + 0 + ], + "enable_bbcode": [ + "BOOL", + 1 + ], + "enable_smilies": [ + "BOOL", + 1 + ], + "enable_magic_url": [ + "BOOL", + 1 + ], + "enable_sig": [ + "BOOL", + 1 + ], + "post_username": [ + "VCHAR_UNI:255", + "" + ], + "post_subject": [ + "STEXT_UNI", + "", + "true_sort" + ], + "post_text": [ + "MTEXT_UNI", + "" + ], + "post_checksum": [ + "VCHAR:32", + "" + ], + "post_attachment": [ + "BOOL", + 0 + ], + "bbcode_bitfield": [ + "VCHAR:255", + "" + ], + "bbcode_uid": [ + "VCHAR:8", + "" + ], + "post_postcount": [ + "BOOL", + 1 + ], + "post_edit_time": [ + "TIMESTAMP", + 0 + ], + "post_edit_reason": [ + "STEXT_UNI", + "" + ], + "post_edit_user": [ + "UINT", + 0 + ], + "post_edit_count": [ + "USINT", + 0 + ], + "post_edit_locked": [ + "BOOL", + 0 + ], + "post_visibility": [ + "TINT:3", + 0 + ], + "post_delete_time": [ + "TIMESTAMP", + 0 + ], + "post_delete_reason": [ + "STEXT_UNI", + "" + ], + "post_delete_user": [ + "UINT", + 0 + ] + }, + "PRIMARY_KEY": "post_id", + "KEYS": { + "forum_id": [ + "INDEX", + "forum_id" + ], + "topic_id": [ + "INDEX", + "topic_id" + ], + "poster_ip": [ + "INDEX", + "poster_ip" + ], + "poster_id": [ + "INDEX", + "poster_id" + ], + "tid_post_time": [ + "INDEX", + [ + "topic_id", + "post_time" + ] + ], + "post_username": [ + "INDEX", + [ + "post_username:255" + ] + ], + "post_visibility": [ + "INDEX", + [ + "post_visibility" + ] + ] + } + }, + "phpbb_privmsgs": { + "COLUMNS": { + "msg_id": [ + "UINT", + null, + "auto_increment" + ], + "root_level": [ + "UINT", + 0 + ], + "author_id": [ + "UINT", + 0 + ], + "icon_id": [ + "UINT", + 0 + ], + "author_ip": [ + "VCHAR:40", + "" + ], + "message_time": [ + "TIMESTAMP", + 0 + ], + "enable_bbcode": [ + "BOOL", + 1 + ], + "enable_smilies": [ + "BOOL", + 1 + ], + "enable_magic_url": [ + "BOOL", + 1 + ], + "enable_sig": [ + "BOOL", + 1 + ], + "message_subject": [ + "STEXT_UNI", + "" + ], + "message_text": [ + "MTEXT_UNI", + "" + ], + "message_edit_reason": [ + "STEXT_UNI", + "" + ], + "message_edit_user": [ + "UINT", + 0 + ], + "message_attachment": [ + "BOOL", + 0 + ], + "bbcode_bitfield": [ + "VCHAR:255", + "" + ], + "bbcode_uid": [ + "VCHAR:8", + "" + ], + "message_edit_time": [ + "TIMESTAMP", + 0 + ], + "message_edit_count": [ + "USINT", + 0 + ], + "to_address": [ + "TEXT_UNI", + "" + ], + "bcc_address": [ + "TEXT_UNI", + "" + ], + "message_reported": [ + "BOOL", + 0 + ] + }, + "PRIMARY_KEY": "msg_id", + "KEYS": { + "author_ip": [ + "INDEX", + "author_ip" + ], + "message_time": [ + "INDEX", + "message_time" + ], + "author_id": [ + "INDEX", + "author_id" + ], + "root_level": [ + "INDEX", + "root_level" + ] + } + }, + "phpbb_privmsgs_folder": { + "COLUMNS": { + "folder_id": [ + "UINT", + null, + "auto_increment" + ], + "user_id": [ + "UINT", + 0 + ], + "folder_name": [ + "VCHAR_UNI", + "" + ], + "pm_count": [ + "UINT", + 0 + ] + }, + "PRIMARY_KEY": "folder_id", + "KEYS": { + "user_id": [ + "INDEX", + "user_id" + ] + } + }, + "phpbb_privmsgs_rules": { + "COLUMNS": { + "rule_id": [ + "UINT", + null, + "auto_increment" + ], + "user_id": [ + "UINT", + 0 + ], + "rule_check": [ + "UINT", + 0 + ], + "rule_connection": [ + "UINT", + 0 + ], + "rule_string": [ + "VCHAR_UNI", + "" + ], + "rule_user_id": [ + "UINT", + 0 + ], + "rule_group_id": [ + "UINT", + 0 + ], + "rule_action": [ + "UINT", + 0 + ], + "rule_folder_id": [ + "INT:11", + 0 + ] + }, + "PRIMARY_KEY": "rule_id", + "KEYS": { + "user_id": [ + "INDEX", + "user_id" + ] + } + }, + "phpbb_privmsgs_to": { + "COLUMNS": { + "msg_id": [ + "UINT", + 0 + ], + "user_id": [ + "UINT", + 0 + ], + "author_id": [ + "UINT", + 0 + ], + "pm_deleted": [ + "BOOL", + 0 + ], + "pm_new": [ + "BOOL", + 1 + ], + "pm_unread": [ + "BOOL", + 1 + ], + "pm_replied": [ + "BOOL", + 0 + ], + "pm_marked": [ + "BOOL", + 0 + ], + "pm_forwarded": [ + "BOOL", + 0 + ], + "folder_id": [ + "INT:11", + 0 + ] + }, + "KEYS": { + "msg_id": [ + "INDEX", + "msg_id" + ], + "author_id": [ + "INDEX", + "author_id" + ], + "usr_flder_id": [ + "INDEX", + [ + "user_id", + "folder_id" + ] + ] + } + }, + "phpbb_profile_fields": { + "COLUMNS": { + "field_id": [ + "UINT", + null, + "auto_increment" + ], + "field_name": [ + "VCHAR_UNI", + "" + ], + "field_type": [ + "VCHAR:100", + "" + ], + "field_ident": [ + "VCHAR:20", + "" + ], + "field_length": [ + "VCHAR:20", + "" + ], + "field_minlen": [ + "VCHAR", + "" + ], + "field_maxlen": [ + "VCHAR", + "" + ], + "field_novalue": [ + "VCHAR_UNI", + "" + ], + "field_default_value": [ + "VCHAR_UNI", + "" + ], + "field_validation": [ + "VCHAR_UNI:20", + "" + ], + "field_required": [ + "BOOL", + 0 + ], + "field_show_on_reg": [ + "BOOL", + 0 + ], + "field_hide": [ + "BOOL", + 0 + ], + "field_no_view": [ + "BOOL", + 0 + ], + "field_active": [ + "BOOL", + 0 + ], + "field_order": [ + "UINT", + 0 + ], + "field_show_profile": [ + "BOOL", + 0 + ], + "field_show_on_vt": [ + "BOOL", + 0 + ], + "field_show_novalue": [ + "BOOL", + 0 + ], + "field_show_on_pm": [ + "BOOL", + 0 + ], + "field_show_on_ml": [ + "BOOL", + 0 + ], + "field_is_contact": [ + "BOOL", + 0 + ], + "field_contact_desc": [ + "VCHAR", + "" + ], + "field_contact_url": [ + "VCHAR", + "" + ] + }, + "PRIMARY_KEY": "field_id", + "KEYS": { + "fld_type": [ + "INDEX", + "field_type" + ], + "fld_ordr": [ + "INDEX", + "field_order" + ] + } + }, + "phpbb_profile_fields_data": { + "COLUMNS": { + "user_id": [ + "UINT", + 0 + ], + "pf_phpbb_interests": [ + "MTEXT", + "" + ], + "pf_phpbb_occupation": [ + "MTEXT", + "" + ], + "pf_phpbb_icq": [ + "VCHAR", + "" + ], + "pf_phpbb_location": [ + "VCHAR", + "" + ], + "pf_phpbb_website": [ + "VCHAR", + "" + ], + "pf_phpbb_wlm": [ + "VCHAR", + "" + ], + "pf_phpbb_yahoo": [ + "VCHAR", + "" + ], + "pf_phpbb_aol": [ + "VCHAR", + "" + ] + }, + "PRIMARY_KEY": "user_id" + }, + "phpbb_profile_fields_lang": { + "COLUMNS": { + "field_id": [ + "UINT", + 0 + ], + "lang_id": [ + "UINT", + 0 + ], + "option_id": [ + "UINT", + 0 + ], + "field_type": [ + "VCHAR:100", + "" + ], + "lang_value": [ + "VCHAR_UNI", + "" + ] + }, + "PRIMARY_KEY": [ + "field_id", + "lang_id", + "option_id" + ] + }, + "phpbb_profile_lang": { + "COLUMNS": { + "field_id": [ + "UINT", + 0 + ], + "lang_id": [ + "UINT", + 0 + ], + "lang_name": [ + "VCHAR_UNI", + "" + ], + "lang_explain": [ + "TEXT_UNI", + "" + ], + "lang_default_value": [ + "VCHAR_UNI", + "" + ] + }, + "PRIMARY_KEY": [ + "field_id", + "lang_id" + ] + }, + "phpbb_ranks": { + "COLUMNS": { + "rank_id": [ + "UINT", + null, + "auto_increment" + ], + "rank_title": [ + "VCHAR_UNI", + "" + ], + "rank_min": [ + "UINT", + 0 + ], + "rank_special": [ + "BOOL", + 0 + ], + "rank_image": [ + "VCHAR", + "" + ] + }, + "PRIMARY_KEY": "rank_id" + }, + "phpbb_reports": { + "COLUMNS": { + "report_id": [ + "UINT", + null, + "auto_increment" + ], + "reason_id": [ + "USINT", + 0 + ], + "post_id": [ + "UINT", + 0 + ], + "user_id": [ + "UINT", + 0 + ], + "user_notify": [ + "BOOL", + 0 + ], + "report_closed": [ + "BOOL", + 0 + ], + "report_time": [ + "TIMESTAMP", + 0 + ], + "report_text": [ + "MTEXT_UNI", + "" + ], + "pm_id": [ + "UINT", + 0 + ], + "reported_post_enable_bbcode": [ + "BOOL", + 1 + ], + "reported_post_enable_smilies": [ + "BOOL", + 1 + ], + "reported_post_enable_magic_url": [ + "BOOL", + 1 + ], + "reported_post_text": [ + "MTEXT_UNI", + "" + ], + "reported_post_uid": [ + "VCHAR:8", + "" + ], + "reported_post_bitfield": [ + "VCHAR:255", + "" + ] + }, + "PRIMARY_KEY": "report_id", + "KEYS": { + "post_id": [ + "INDEX", + [ + "post_id" + ] + ], + "pm_id": [ + "INDEX", + [ + "pm_id" + ] + ] + } + }, + "phpbb_reports_reasons": { + "COLUMNS": { + "reason_id": [ + "USINT", + null, + "auto_increment" + ], + "reason_title": [ + "VCHAR_UNI", + "" + ], + "reason_description": [ + "MTEXT_UNI", + "" + ], + "reason_order": [ + "USINT", + 0 + ] + }, + "PRIMARY_KEY": "reason_id" + }, + "phpbb_search_results": { + "COLUMNS": { + "search_key": [ + "VCHAR:32", + "" + ], + "search_time": [ + "TIMESTAMP", + 0 + ], + "search_keywords": [ + "MTEXT_UNI", + "" + ], + "search_authors": [ + "MTEXT", + "" + ] + }, + "PRIMARY_KEY": "search_key" + }, + "phpbb_search_wordlist": { + "COLUMNS": { + "word_id": [ + "UINT", + null, + "auto_increment" + ], + "word_text": [ + "VCHAR_UNI", + "" + ], + "word_common": [ + "BOOL", + 0 + ], + "word_count": [ + "UINT", + 0 + ] + }, + "PRIMARY_KEY": "word_id", + "KEYS": { + "wrd_txt": [ + "UNIQUE", + "word_text" + ], + "wrd_cnt": [ + "INDEX", + "word_count" + ] + } + }, + "phpbb_search_wordmatch": { + "COLUMNS": { + "post_id": [ + "UINT", + 0 + ], + "word_id": [ + "UINT", + 0 + ], + "title_match": [ + "BOOL", + 0 + ] + }, + "KEYS": { + "unq_mtch": [ + "UNIQUE", + [ + "word_id", + "post_id", + "title_match" + ] + ], + "word_id": [ + "INDEX", + "word_id" + ], + "post_id": [ + "INDEX", + "post_id" + ] + } + }, + "phpbb_sessions": { + "COLUMNS": { + "session_id": [ + "CHAR:32", + "" + ], + "session_user_id": [ + "UINT", + 0 + ], + "session_last_visit": [ + "TIMESTAMP", + 0 + ], + "session_start": [ + "TIMESTAMP", + 0 + ], + "session_time": [ + "TIMESTAMP", + 0 + ], + "session_ip": [ + "VCHAR:40", + "" + ], + "session_browser": [ + "VCHAR:150", + "" + ], + "session_forwarded_for": [ + "VCHAR:255", + "" + ], + "session_page": [ + "VCHAR_UNI", + "" + ], + "session_viewonline": [ + "BOOL", + 1 + ], + "session_autologin": [ + "BOOL", + 0 + ], + "session_admin": [ + "BOOL", + 0 + ], + "session_forum_id": [ + "UINT", + 0 + ] + }, + "PRIMARY_KEY": "session_id", + "KEYS": { + "session_time": [ + "INDEX", + "session_time" + ], + "session_user_id": [ + "INDEX", + "session_user_id" + ], + "session_fid": [ + "INDEX", + [ + "session_forum_id" + ] + ] + } + }, + "phpbb_sessions_keys": { + "COLUMNS": { + "key_id": [ + "CHAR:32", + "" + ], + "user_id": [ + "UINT", + 0 + ], + "last_ip": [ + "VCHAR:40", + "" + ], + "last_login": [ + "TIMESTAMP", + 0 + ] + }, + "PRIMARY_KEY": [ + "key_id", + "user_id" + ], + "KEYS": { + "last_login": [ + "INDEX", + "last_login" + ] + } + }, + "phpbb_sitelist": { + "COLUMNS": { + "site_id": [ + "UINT", + null, + "auto_increment" + ], + "site_ip": [ + "VCHAR:40", + "" + ], + "site_hostname": [ + "VCHAR", + "" + ], + "ip_exclude": [ + "BOOL", + 0 + ] + }, + "PRIMARY_KEY": "site_id" + }, + "phpbb_smilies": { + "COLUMNS": { + "smiley_id": [ + "UINT", + null, + "auto_increment" + ], + "code": [ + "VCHAR_UNI:50", + "" + ], + "emotion": [ + "VCHAR_UNI:50", + "" + ], + "smiley_url": [ + "VCHAR:50", + "" + ], + "smiley_width": [ + "USINT", + 0 + ], + "smiley_height": [ + "USINT", + 0 + ], + "smiley_order": [ + "UINT", + 0 + ], + "display_on_posting": [ + "BOOL", + 1 + ] + }, + "PRIMARY_KEY": "smiley_id", + "KEYS": { + "display_on_post": [ + "INDEX", + "display_on_posting" + ] + } + }, + "phpbb_styles": { + "COLUMNS": { + "style_id": [ + "UINT", + null, + "auto_increment" + ], + "style_name": [ + "VCHAR_UNI:255", + "" + ], + "style_copyright": [ + "VCHAR_UNI", + "" + ], + "style_active": [ + "BOOL", + 1 + ], + "style_path": [ + "VCHAR:100", + "" + ], + "bbcode_bitfield": [ + "VCHAR:255", + "kNg=" + ], + "style_parent_id": [ + "UINT:4", + 0 + ], + "style_parent_tree": [ + "TEXT", + "" + ] + }, + "PRIMARY_KEY": "style_id", + "KEYS": { + "style_name": [ + "UNIQUE", + "style_name" + ] + } + }, + "phpbb_teampage": { + "COLUMNS": { + "teampage_id": [ + "UINT", + null, + "auto_increment" + ], + "group_id": [ + "UINT", + 0 + ], + "teampage_name": [ + "VCHAR_UNI:255", + "" + ], + "teampage_position": [ + "UINT", + 0 + ], + "teampage_parent": [ + "UINT", + 0 + ] + }, + "PRIMARY_KEY": "teampage_id" + }, + "phpbb_topics": { + "COLUMNS": { + "topic_id": [ + "UINT", + null, + "auto_increment" + ], + "forum_id": [ + "UINT", + 0 + ], + "icon_id": [ + "UINT", + 0 + ], + "topic_attachment": [ + "BOOL", + 0 + ], + "topic_reported": [ + "BOOL", + 0 + ], + "topic_title": [ + "STEXT_UNI", + "", + "true_sort" + ], + "topic_poster": [ + "UINT", + 0 + ], + "topic_time": [ + "TIMESTAMP", + 0 + ], + "topic_time_limit": [ + "TIMESTAMP", + 0 + ], + "topic_views": [ + "UINT", + 0 + ], + "topic_status": [ + "TINT:3", + 0 + ], + "topic_type": [ + "TINT:3", + 0 + ], + "topic_first_post_id": [ + "UINT", + 0 + ], + "topic_first_poster_name": [ + "VCHAR_UNI", + "" + ], + "topic_first_poster_colour": [ + "VCHAR:6", + "" + ], + "topic_last_post_id": [ + "UINT", + 0 + ], + "topic_last_poster_id": [ + "UINT", + 0 + ], + "topic_last_poster_name": [ + "VCHAR_UNI", + "" + ], + "topic_last_poster_colour": [ + "VCHAR:6", + "" + ], + "topic_last_post_subject": [ + "STEXT_UNI", + "" + ], + "topic_last_post_time": [ + "TIMESTAMP", + 0 + ], + "topic_last_view_time": [ + "TIMESTAMP", + 0 + ], + "topic_moved_id": [ + "UINT", + 0 + ], + "topic_bumped": [ + "BOOL", + 0 + ], + "topic_bumper": [ + "UINT", + 0 + ], + "poll_title": [ + "STEXT_UNI", + "" + ], + "poll_start": [ + "TIMESTAMP", + 0 + ], + "poll_length": [ + "TIMESTAMP", + 0 + ], + "poll_max_options": [ + "TINT:4", + 1 + ], + "poll_last_vote": [ + "TIMESTAMP", + 0 + ], + "poll_vote_change": [ + "BOOL", + 0 + ], + "topic_visibility": [ + "TINT:3", + 0 + ], + "topic_delete_time": [ + "TIMESTAMP", + 0 + ], + "topic_delete_reason": [ + "STEXT_UNI", + "" + ], + "topic_delete_user": [ + "UINT", + 0 + ], + "topic_posts_approved": [ + "UINT", + 0 + ], + "topic_posts_unapproved": [ + "UINT", + 0 + ], + "topic_posts_softdeleted": [ + "UINT", + 0 + ] + }, + "PRIMARY_KEY": "topic_id", + "KEYS": { + "forum_id": [ + "INDEX", + "forum_id" + ], + "forum_id_type": [ + "INDEX", + [ + "forum_id", + "topic_type" + ] + ], + "last_post_time": [ + "INDEX", + "topic_last_post_time" + ], + "fid_time_moved": [ + "INDEX", + [ + "forum_id", + "topic_last_post_time", + "topic_moved_id" + ] + ], + "topic_visibility": [ + "INDEX", + [ + "topic_visibility" + ] + ], + "forum_vis_last": [ + "INDEX", + [ + "forum_id", + "topic_visibility", + "topic_last_post_id" + ] + ] + } + }, + "phpbb_topics_posted": { + "COLUMNS": { + "user_id": [ + "UINT", + 0 + ], + "topic_id": [ + "UINT", + 0 + ], + "topic_posted": [ + "BOOL", + 0 + ] + }, + "PRIMARY_KEY": [ + "user_id", + "topic_id" + ] + }, + "phpbb_topics_track": { + "COLUMNS": { + "user_id": [ + "UINT", + 0 + ], + "topic_id": [ + "UINT", + 0 + ], + "forum_id": [ + "UINT", + 0 + ], + "mark_time": [ + "TIMESTAMP", + 0 + ] + }, + "PRIMARY_KEY": [ + "user_id", + "topic_id" + ], + "KEYS": { + "forum_id": [ + "INDEX", + "forum_id" + ], + "topic_id": [ + "INDEX", + [ + "topic_id" + ] + ] + } + }, + "phpbb_topics_watch": { + "COLUMNS": { + "topic_id": [ + "UINT", + 0 + ], + "user_id": [ + "UINT", + 0 + ], + "notify_status": [ + "BOOL", + 0 + ] + }, + "KEYS": { + "topic_id": [ + "INDEX", + "topic_id" + ], + "user_id": [ + "INDEX", + "user_id" + ], + "notify_stat": [ + "INDEX", + "notify_status" + ] + } + }, + "phpbb_user_group": { + "COLUMNS": { + "group_id": [ + "UINT", + 0 + ], + "user_id": [ + "UINT", + 0 + ], + "group_leader": [ + "BOOL", + 0 + ], + "user_pending": [ + "BOOL", + 1 + ] + }, + "KEYS": { + "group_id": [ + "INDEX", + "group_id" + ], + "user_id": [ + "INDEX", + "user_id" + ], + "group_leader": [ + "INDEX", + "group_leader" + ] + } + }, + "phpbb_user_notifications": { + "COLUMNS": { + "item_type": [ + "VCHAR:255", + "" + ], + "item_id": [ + "UINT", + 0 + ], + "user_id": [ + "UINT", + 0 + ], + "method": [ + "VCHAR:255", + "" + ], + "notify": [ + "BOOL", + 1 + ] + } + }, + "phpbb_users": { + "COLUMNS": { + "user_id": [ + "UINT", + null, + "auto_increment" + ], + "user_type": [ + "TINT:2", + 0 + ], + "group_id": [ + "UINT", + 3 + ], + "user_permissions": [ + "MTEXT", + "" + ], + "user_perm_from": [ + "UINT", + 0 + ], + "user_ip": [ + "VCHAR:40", + "" + ], + "user_regdate": [ + "TIMESTAMP", + 0 + ], + "username": [ + "VCHAR_CI", + "" + ], + "username_clean": [ + "VCHAR_CI", + "" + ], + "user_password": [ + "VCHAR:255", + "" + ], + "user_passchg": [ + "TIMESTAMP", + 0 + ], + "user_pass_convert": [ + "BOOL", + 0 + ], + "user_email": [ + "VCHAR_UNI:100", + "" + ], + "user_email_hash": [ + "BINT", + 0 + ], + "user_birthday": [ + "VCHAR:10", + "" + ], + "user_lastvisit": [ + "TIMESTAMP", + 0 + ], + "user_lastmark": [ + "TIMESTAMP", + 0 + ], + "user_lastpost_time": [ + "TIMESTAMP", + 0 + ], + "user_lastpage": [ + "VCHAR_UNI:200", + "" + ], + "user_last_confirm_key": [ + "VCHAR:10", + "" + ], + "user_last_search": [ + "TIMESTAMP", + 0 + ], + "user_warnings": [ + "TINT:4", + 0 + ], + "user_last_warning": [ + "TIMESTAMP", + 0 + ], + "user_login_attempts": [ + "TINT:4", + 0 + ], + "user_inactive_reason": [ + "TINT:2", + 0 + ], + "user_inactive_time": [ + "TIMESTAMP", + 0 + ], + "user_posts": [ + "UINT", + 0 + ], + "user_lang": [ + "VCHAR:30", + "" + ], + "user_timezone": [ + "VCHAR:100", + "" + ], + "user_dateformat": [ + "VCHAR_UNI:30", + "d M Y H:i" + ], + "user_style": [ + "UINT", + 0 + ], + "user_rank": [ + "UINT", + 0 + ], + "user_colour": [ + "VCHAR:6", + "" + ], + "user_new_privmsg": [ + "INT:4", + 0 + ], + "user_unread_privmsg": [ + "INT:4", + 0 + ], + "user_last_privmsg": [ + "TIMESTAMP", + 0 + ], + "user_message_rules": [ + "BOOL", + 0 + ], + "user_full_folder": [ + "INT:11", + -3 + ], + "user_emailtime": [ + "TIMESTAMP", + 0 + ], + "user_topic_show_days": [ + "USINT", + 0 + ], + "user_topic_sortby_type": [ + "VCHAR:1", + "t" + ], + "user_topic_sortby_dir": [ + "VCHAR:1", + "d" + ], + "user_post_show_days": [ + "USINT", + 0 + ], + "user_post_sortby_type": [ + "VCHAR:1", + "t" + ], + "user_post_sortby_dir": [ + "VCHAR:1", + "a" + ], + "user_notify": [ + "BOOL", + 0 + ], + "user_notify_pm": [ + "BOOL", + 1 + ], + "user_notify_type": [ + "TINT:4", + 0 + ], + "user_allow_pm": [ + "BOOL", + 1 + ], + "user_allow_viewonline": [ + "BOOL", + 1 + ], + "user_allow_viewemail": [ + "BOOL", + 1 + ], + "user_allow_massemail": [ + "BOOL", + 1 + ], + "user_options": [ + "UINT:11", + 230271 + ], + "user_avatar": [ + "VCHAR", + "" + ], + "user_avatar_type": [ + "VCHAR:255", + "" + ], + "user_avatar_width": [ + "USINT", + 0 + ], + "user_avatar_height": [ + "USINT", + 0 + ], + "user_sig": [ + "MTEXT_UNI", + "" + ], + "user_sig_bbcode_uid": [ + "VCHAR:8", + "" + ], + "user_sig_bbcode_bitfield": [ + "VCHAR:255", + "" + ], + "user_jabber": [ + "VCHAR_UNI", + "" + ], + "user_actkey": [ + "VCHAR:32", + "" + ], + "user_newpasswd": [ + "VCHAR:255", + "" + ], + "user_form_salt": [ + "VCHAR_UNI:32", + "" + ], + "user_new": [ + "BOOL", + 1 + ], + "user_reminded": [ + "TINT:4", + 0 + ], + "user_reminded_time": [ + "TIMESTAMP", + 0 + ] + }, + "PRIMARY_KEY": "user_id", + "KEYS": { + "user_birthday": [ + "INDEX", + "user_birthday" + ], + "user_email_hash": [ + "INDEX", + "user_email_hash" + ], + "user_type": [ + "INDEX", + "user_type" + ], + "username_clean": [ + "UNIQUE", + "username_clean" + ] + } + }, + "phpbb_warnings": { + "COLUMNS": { + "warning_id": [ + "UINT", + null, + "auto_increment" + ], + "user_id": [ + "UINT", + 0 + ], + "post_id": [ + "UINT", + 0 + ], + "log_id": [ + "UINT", + 0 + ], + "warning_time": [ + "TIMESTAMP", + 0 + ] + }, + "PRIMARY_KEY": "warning_id" + }, + "phpbb_words": { + "COLUMNS": { + "word_id": [ + "UINT", + null, + "auto_increment" + ], + "word": [ + "VCHAR_UNI", + "" + ], + "replacement": [ + "VCHAR_UNI", + "" + ] + }, + "PRIMARY_KEY": "word_id" + }, + "phpbb_zebra": { + "COLUMNS": { + "user_id": [ + "UINT", + 0 + ], + "zebra_id": [ + "UINT", + 0 + ], + "friend": [ + "BOOL", + 0 + ], + "foe": [ + "BOOL", + 0 + ] + }, + "PRIMARY_KEY": [ + "user_id", + "zebra_id" + ] + } +}
\ No newline at end of file diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 5d8ae220f4..28649dc54c 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -3,1052 +3,3 @@ # To change the contents of this file, edit # phpBB/develop/create_schema_files.php and # run it. -BEGIN TRANSACTION; - -# Table: 'phpbb_attachments' -CREATE TABLE phpbb_attachments ( - attach_id INTEGER PRIMARY KEY NOT NULL , - post_msg_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - in_message INTEGER UNSIGNED NOT NULL DEFAULT '0', - poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - is_orphan INTEGER UNSIGNED NOT NULL DEFAULT '1', - physical_filename varchar(255) NOT NULL DEFAULT '', - real_filename varchar(255) NOT NULL DEFAULT '', - download_count INTEGER UNSIGNED NOT NULL DEFAULT '0', - attach_comment text(65535) NOT NULL DEFAULT '', - extension varchar(100) NOT NULL DEFAULT '', - mimetype varchar(100) NOT NULL DEFAULT '', - filesize INTEGER UNSIGNED NOT NULL DEFAULT '0', - filetime 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_post_msg_id ON phpbb_attachments (post_msg_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_is_orphan ON phpbb_attachments (is_orphan); - -# Table: 'phpbb_acl_groups' -CREATE TABLE phpbb_acl_groups ( - group_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_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_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_auth_opt_id ON phpbb_acl_groups (auth_option_id); -CREATE INDEX phpbb_acl_groups_auth_role_id ON phpbb_acl_groups (auth_role_id); - -# Table: 'phpbb_acl_options' -CREATE TABLE phpbb_acl_options ( - auth_option_id INTEGER PRIMARY KEY NOT NULL , - auth_option varchar(50) NOT NULL DEFAULT '', - is_global INTEGER UNSIGNED NOT NULL DEFAULT '0', - is_local INTEGER UNSIGNED NOT NULL DEFAULT '0', - founder_only INTEGER UNSIGNED NOT NULL DEFAULT '0' -); - -CREATE UNIQUE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options (auth_option); - -# Table: 'phpbb_acl_roles' -CREATE TABLE phpbb_acl_roles ( - role_id INTEGER PRIMARY KEY NOT NULL , - role_name varchar(255) NOT NULL DEFAULT '', - role_description text(65535) NOT NULL DEFAULT '', - role_type varchar(10) NOT NULL DEFAULT '', - 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_order ON phpbb_acl_roles (role_order); - -# Table: 'phpbb_acl_roles_data' -CREATE TABLE phpbb_acl_roles_data ( - role_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - auth_setting tinyint(2) NOT NULL DEFAULT '0', - PRIMARY KEY (role_id, auth_option_id) -); - -CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id); - -# Table: 'phpbb_acl_users' -CREATE TABLE phpbb_acl_users ( - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_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_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_auth_option_id ON phpbb_acl_users (auth_option_id); -CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id); - -# Table: 'phpbb_banlist' -CREATE TABLE phpbb_banlist ( - ban_id INTEGER PRIMARY KEY NOT NULL , - ban_userid INTEGER UNSIGNED NOT NULL DEFAULT '0', - ban_ip varchar(40) NOT NULL DEFAULT '', - ban_email varchar(100) NOT NULL DEFAULT '', - ban_start INTEGER UNSIGNED NOT NULL DEFAULT '0', - ban_end INTEGER UNSIGNED NOT NULL DEFAULT '0', - ban_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0', - ban_reason varchar(255) NOT NULL DEFAULT '', - ban_give_reason varchar(255) NOT NULL DEFAULT '' -); - -CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end); -CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist (ban_userid, ban_exclude); -CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist (ban_email, ban_exclude); -CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist (ban_ip, ban_exclude); - -# Table: 'phpbb_bbcodes' -CREATE TABLE phpbb_bbcodes ( - bbcode_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - bbcode_tag varchar(16) NOT NULL DEFAULT '', - bbcode_helpline varchar(255) NOT NULL DEFAULT '', - display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '0', - bbcode_match text(65535) NOT NULL DEFAULT '', - bbcode_tpl mediumtext(16777215) NOT NULL DEFAULT '', - first_pass_match mediumtext(16777215) NOT NULL DEFAULT '', - first_pass_replace mediumtext(16777215) NOT NULL DEFAULT '', - second_pass_match mediumtext(16777215) NOT NULL DEFAULT '', - second_pass_replace mediumtext(16777215) NOT NULL DEFAULT '', - PRIMARY KEY (bbcode_id) -); - -CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting); - -# Table: 'phpbb_bookmarks' -CREATE TABLE phpbb_bookmarks ( - topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - PRIMARY KEY (topic_id, user_id) -); - - -# Table: 'phpbb_bots' -CREATE TABLE phpbb_bots ( - bot_id INTEGER PRIMARY KEY NOT NULL , - bot_active INTEGER UNSIGNED NOT NULL DEFAULT '1', - bot_name text(65535) NOT NULL DEFAULT '', - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - bot_agent varchar(255) NOT NULL DEFAULT '', - bot_ip varchar(255) NOT NULL DEFAULT '' -); - -CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active); - -# Table: 'phpbb_config' -CREATE TABLE phpbb_config ( - config_name varchar(255) NOT NULL DEFAULT '', - config_value varchar(255) NOT NULL DEFAULT '', - is_dynamic INTEGER UNSIGNED NOT NULL DEFAULT '0', - PRIMARY KEY (config_name) -); - -CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic); - -# Table: 'phpbb_config_text' -CREATE TABLE phpbb_config_text ( - config_name varchar(255) NOT NULL DEFAULT '', - config_value mediumtext(16777215) NOT NULL DEFAULT '', - PRIMARY KEY (config_name) -); - - -# Table: 'phpbb_confirm' -CREATE TABLE phpbb_confirm ( - confirm_id char(32) NOT NULL DEFAULT '', - session_id char(32) NOT NULL DEFAULT '', - confirm_type tinyint(3) NOT NULL DEFAULT '0', - code varchar(8) NOT NULL DEFAULT '', - seed INTEGER UNSIGNED NOT NULL DEFAULT '0', - attempts INTEGER UNSIGNED NOT NULL DEFAULT '0', - PRIMARY KEY (session_id, confirm_id) -); - -CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm (confirm_type); - -# Table: 'phpbb_disallow' -CREATE TABLE phpbb_disallow ( - disallow_id INTEGER PRIMARY KEY NOT NULL , - disallow_username varchar(255) NOT NULL DEFAULT '' -); - - -# Table: 'phpbb_drafts' -CREATE TABLE phpbb_drafts ( - draft_id INTEGER PRIMARY KEY NOT NULL , - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - save_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - draft_subject text(65535) NOT NULL DEFAULT '', - draft_message mediumtext(16777215) NOT NULL DEFAULT '' -); - -CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time); - -# Table: 'phpbb_ext' -CREATE TABLE phpbb_ext ( - ext_name varchar(255) NOT NULL DEFAULT '', - ext_active INTEGER UNSIGNED NOT NULL DEFAULT '0', - ext_state text(65535) NOT NULL DEFAULT '' -); - -CREATE UNIQUE INDEX phpbb_ext_ext_name ON phpbb_ext (ext_name); - -# Table: 'phpbb_extensions' -CREATE TABLE phpbb_extensions ( - extension_id INTEGER PRIMARY KEY NOT NULL , - group_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - extension varchar(100) NOT NULL DEFAULT '' -); - - -# Table: 'phpbb_extension_groups' -CREATE TABLE phpbb_extension_groups ( - group_id INTEGER PRIMARY KEY NOT NULL , - group_name varchar(255) NOT NULL DEFAULT '', - cat_id tinyint(2) NOT NULL DEFAULT '0', - allow_group INTEGER UNSIGNED NOT NULL DEFAULT '0', - download_mode INTEGER UNSIGNED NOT NULL DEFAULT '1', - upload_icon varchar(255) NOT NULL DEFAULT '', - max_filesize INTEGER UNSIGNED NOT NULL DEFAULT '0', - allowed_forums text(65535) NOT NULL DEFAULT '', - allow_in_pm INTEGER UNSIGNED NOT NULL DEFAULT '0' -); - - -# Table: 'phpbb_forums' -CREATE TABLE phpbb_forums ( - forum_id INTEGER PRIMARY KEY NOT NULL , - parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - left_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - right_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_parents mediumtext(16777215) NOT NULL DEFAULT '', - forum_name text(65535) NOT NULL DEFAULT '', - forum_desc text(65535) NOT NULL DEFAULT '', - forum_desc_bitfield varchar(255) NOT NULL DEFAULT '', - forum_desc_options INTEGER UNSIGNED NOT NULL DEFAULT '7', - forum_desc_uid varchar(8) NOT NULL DEFAULT '', - forum_link varchar(255) NOT NULL DEFAULT '', - forum_password varchar(255) NOT NULL DEFAULT '', - forum_style INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_image varchar(255) NOT NULL DEFAULT '', - forum_rules text(65535) NOT NULL DEFAULT '', - forum_rules_link varchar(255) NOT NULL DEFAULT '', - forum_rules_bitfield varchar(255) NOT NULL DEFAULT '', - forum_rules_options INTEGER UNSIGNED NOT NULL DEFAULT '7', - forum_rules_uid varchar(8) NOT NULL DEFAULT '', - forum_topics_per_page tinyint(4) NOT NULL DEFAULT '0', - forum_type tinyint(4) NOT NULL DEFAULT '0', - forum_status tinyint(4) NOT NULL DEFAULT '0', - forum_posts_approved INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_posts_unapproved INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_posts_softdeleted INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_topics_approved INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_topics_unapproved INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_topics_softdeleted INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_last_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_last_poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_last_post_subject text(65535) NOT NULL DEFAULT '', - forum_last_post_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_last_poster_name varchar(255) NOT NULL DEFAULT '', - forum_last_poster_colour varchar(6) NOT NULL DEFAULT '', - forum_flags tinyint(4) NOT NULL DEFAULT '32', - forum_options INTEGER UNSIGNED NOT NULL DEFAULT '0', - display_subforum_list INTEGER UNSIGNED NOT NULL DEFAULT '1', - display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1', - enable_indexing INTEGER UNSIGNED NOT NULL DEFAULT '1', - enable_icons INTEGER UNSIGNED NOT NULL DEFAULT '1', - enable_prune INTEGER UNSIGNED NOT NULL DEFAULT '0', - prune_next INTEGER UNSIGNED NOT NULL DEFAULT '0', - prune_days INTEGER UNSIGNED NOT NULL DEFAULT '0', - prune_viewed INTEGER UNSIGNED NOT NULL DEFAULT '0', - prune_freq INTEGER UNSIGNED NOT NULL DEFAULT '0' -); - -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); - -# Table: 'phpbb_forums_access' -CREATE TABLE phpbb_forums_access ( - forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - session_id char(32) NOT NULL DEFAULT '', - PRIMARY KEY (forum_id, user_id, session_id) -); - - -# Table: 'phpbb_forums_track' -CREATE TABLE phpbb_forums_track ( - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - mark_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - PRIMARY KEY (user_id, forum_id) -); - - -# Table: 'phpbb_forums_watch' -CREATE TABLE phpbb_forums_watch ( - forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_id 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_user_id ON phpbb_forums_watch (user_id); -CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch (notify_status); - -# Table: 'phpbb_groups' -CREATE TABLE phpbb_groups ( - group_id INTEGER PRIMARY KEY NOT NULL , - group_type tinyint(4) NOT NULL DEFAULT '1', - group_founder_manage INTEGER UNSIGNED NOT NULL DEFAULT '0', - group_skip_auth INTEGER UNSIGNED NOT NULL DEFAULT '0', - group_name varchar(255) NOT NULL DEFAULT '', - group_desc text(65535) NOT NULL DEFAULT '', - group_desc_bitfield varchar(255) NOT NULL DEFAULT '', - group_desc_options INTEGER UNSIGNED NOT NULL DEFAULT '7', - group_desc_uid varchar(8) NOT NULL DEFAULT '', - group_display INTEGER UNSIGNED NOT NULL DEFAULT '0', - group_avatar varchar(255) NOT NULL DEFAULT '', - group_avatar_type varchar(255) NOT NULL DEFAULT '', - group_avatar_width INTEGER UNSIGNED NOT NULL DEFAULT '0', - group_avatar_height INTEGER UNSIGNED NOT NULL DEFAULT '0', - group_rank INTEGER UNSIGNED NOT NULL DEFAULT '0', - group_colour varchar(6) NOT NULL DEFAULT '', - group_sig_chars 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_max_recipients INTEGER UNSIGNED NOT NULL DEFAULT '0', - group_legend INTEGER UNSIGNED NOT NULL DEFAULT '0' -); - -CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name); - -# Table: 'phpbb_icons' -CREATE TABLE phpbb_icons ( - icons_id INTEGER PRIMARY KEY NOT NULL , - icons_url varchar(255) NOT NULL DEFAULT '', - icons_width tinyint(4) NOT NULL DEFAULT '0', - icons_height tinyint(4) NOT NULL DEFAULT '0', - icons_order INTEGER UNSIGNED NOT NULL DEFAULT '0', - display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '1' -); - -CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons (display_on_posting); - -# Table: 'phpbb_lang' -CREATE TABLE phpbb_lang ( - lang_id INTEGER PRIMARY KEY NOT NULL , - lang_iso varchar(30) NOT NULL DEFAULT '', - lang_dir varchar(30) NOT NULL DEFAULT '', - lang_english_name varchar(100) NOT NULL DEFAULT '', - lang_local_name varchar(255) NOT NULL DEFAULT '', - lang_author varchar(255) NOT NULL DEFAULT '' -); - -CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang (lang_iso); - -# Table: 'phpbb_log' -CREATE TABLE phpbb_log ( - log_id INTEGER PRIMARY KEY NOT NULL , - log_type tinyint(4) NOT NULL DEFAULT '0', - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - reportee_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - log_ip varchar(40) NOT NULL DEFAULT '', - log_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - log_operation text(65535) 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_time ON phpbb_log (log_time); -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_reportee_id ON phpbb_log (reportee_id); -CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id); - -# Table: 'phpbb_login_attempts' -CREATE TABLE phpbb_login_attempts ( - attempt_ip varchar(40) NOT NULL DEFAULT '', - attempt_browser varchar(150) NOT NULL DEFAULT '', - attempt_forwarded_for varchar(255) NOT NULL DEFAULT '', - attempt_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - username varchar(255) NOT NULL DEFAULT '0', - username_clean varchar(255) NOT NULL DEFAULT '0' -); - -CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts (attempt_ip, attempt_time); -CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts (attempt_forwarded_for, attempt_time); -CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts (attempt_time); -CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts (user_id); - -# Table: 'phpbb_moderator_cache' -CREATE TABLE phpbb_moderator_cache ( - forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - username varchar(255) NOT NULL DEFAULT '', - group_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - group_name varchar(255) NOT NULL DEFAULT '', - 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_forum_id ON phpbb_moderator_cache (forum_id); - -# Table: 'phpbb_migrations' -CREATE TABLE phpbb_migrations ( - migration_name varchar(255) NOT NULL DEFAULT '', - migration_depends_on text(65535) NOT NULL DEFAULT '', - migration_schema_done INTEGER UNSIGNED NOT NULL DEFAULT '0', - migration_data_done INTEGER UNSIGNED NOT NULL DEFAULT '0', - migration_data_state text(65535) NOT NULL DEFAULT '', - migration_start_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - migration_end_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - PRIMARY KEY (migration_name) -); - - -# Table: 'phpbb_modules' -CREATE TABLE phpbb_modules ( - module_id INTEGER PRIMARY KEY NOT NULL , - module_enabled INTEGER UNSIGNED NOT NULL DEFAULT '1', - module_display INTEGER UNSIGNED NOT NULL DEFAULT '1', - module_basename varchar(255) NOT NULL DEFAULT '', - module_class varchar(10) NOT NULL DEFAULT '', - parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - left_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - right_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - module_langname varchar(255) NOT NULL DEFAULT '', - module_mode 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_module_enabled ON phpbb_modules (module_enabled); -CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id); - -# Table: 'phpbb_notification_types' -CREATE TABLE phpbb_notification_types ( - notification_type_id INTEGER PRIMARY KEY NOT NULL , - notification_type_name varchar(255) NOT NULL DEFAULT '', - notification_type_enabled INTEGER UNSIGNED NOT NULL DEFAULT '1' -); - -CREATE UNIQUE INDEX phpbb_notification_types_type ON phpbb_notification_types (notification_type_name); - -# Table: 'phpbb_notifications' -CREATE TABLE phpbb_notifications ( - notification_id INTEGER PRIMARY KEY NOT NULL , - notification_type_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - item_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - item_parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - notification_read INTEGER UNSIGNED NOT NULL DEFAULT '0', - notification_time INTEGER UNSIGNED NOT NULL DEFAULT '1', - notification_data text(65535) NOT NULL DEFAULT '' -); - -CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications (notification_type_id, item_id); -CREATE INDEX phpbb_notifications_user ON phpbb_notifications (user_id, notification_read); - -# Table: 'phpbb_oauth_accounts' -CREATE TABLE phpbb_oauth_accounts ( - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - provider varchar(255) NOT NULL DEFAULT '', - oauth_provider_id text(65535) NOT NULL DEFAULT '', - PRIMARY KEY (user_id, provider) -); - - -# Table: 'phpbb_oauth_tokens' -CREATE TABLE phpbb_oauth_tokens ( - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - session_id char(32) NOT NULL DEFAULT '', - provider varchar(255) NOT NULL DEFAULT '', - oauth_token mediumtext(16777215) NOT NULL DEFAULT '' -); - -CREATE INDEX phpbb_oauth_tokens_user_id ON phpbb_oauth_tokens (user_id); -CREATE INDEX phpbb_oauth_tokens_provider ON phpbb_oauth_tokens (provider); - -# Table: 'phpbb_poll_options' -CREATE TABLE phpbb_poll_options ( - poll_option_id tinyint(4) NOT NULL DEFAULT '0', - topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - poll_option_text text(65535) NOT NULL DEFAULT '', - 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_topic_id ON phpbb_poll_options (topic_id); - -# Table: 'phpbb_poll_votes' -CREATE TABLE phpbb_poll_votes ( - topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - poll_option_id tinyint(4) NOT NULL DEFAULT '0', - vote_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - 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_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); - -# Table: 'phpbb_posts' -CREATE TABLE phpbb_posts ( - post_id INTEGER PRIMARY KEY NOT NULL , - topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - icon_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - poster_ip varchar(40) NOT NULL DEFAULT '', - post_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - post_visibility tinyint(3) NOT NULL DEFAULT '0', - post_reported INTEGER UNSIGNED NOT NULL DEFAULT '0', - enable_bbcode INTEGER UNSIGNED NOT NULL DEFAULT '1', - enable_smilies INTEGER UNSIGNED NOT NULL DEFAULT '1', - enable_magic_url INTEGER UNSIGNED NOT NULL DEFAULT '1', - enable_sig INTEGER UNSIGNED NOT NULL DEFAULT '1', - post_username varchar(255) NOT NULL DEFAULT '', - post_subject text(65535) NOT NULL DEFAULT '', - post_text mediumtext(16777215) NOT NULL DEFAULT '', - post_checksum varchar(32) NOT NULL DEFAULT '', - post_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0', - bbcode_bitfield varchar(255) NOT NULL DEFAULT '', - bbcode_uid varchar(8) NOT NULL DEFAULT '', - post_postcount INTEGER UNSIGNED NOT NULL DEFAULT '1', - post_edit_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - post_edit_reason text(65535) NOT NULL DEFAULT '', - post_edit_user 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_delete_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - post_delete_reason text(65535) NOT NULL DEFAULT '', - post_delete_user INTEGER UNSIGNED NOT NULL DEFAULT '0' -); - -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_poster_ip ON phpbb_posts (poster_ip); -CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id); -CREATE INDEX phpbb_posts_post_visibility ON phpbb_posts (post_visibility); -CREATE INDEX phpbb_posts_post_username ON phpbb_posts (post_username); -CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time); - -# Table: 'phpbb_privmsgs' -CREATE TABLE phpbb_privmsgs ( - msg_id INTEGER PRIMARY KEY NOT NULL , - root_level INTEGER UNSIGNED NOT NULL DEFAULT '0', - author_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - icon_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - author_ip varchar(40) NOT NULL DEFAULT '', - message_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - enable_bbcode INTEGER UNSIGNED NOT NULL DEFAULT '1', - enable_smilies INTEGER UNSIGNED NOT NULL DEFAULT '1', - enable_magic_url INTEGER UNSIGNED NOT NULL DEFAULT '1', - enable_sig INTEGER UNSIGNED NOT NULL DEFAULT '1', - message_subject text(65535) NOT NULL DEFAULT '', - message_text mediumtext(16777215) NOT NULL DEFAULT '', - message_edit_reason text(65535) NOT NULL DEFAULT '', - message_edit_user INTEGER UNSIGNED NOT NULL DEFAULT '0', - message_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0', - bbcode_bitfield varchar(255) NOT NULL DEFAULT '', - bbcode_uid varchar(8) NOT NULL DEFAULT '', - message_edit_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - message_edit_count INTEGER UNSIGNED NOT NULL DEFAULT '0', - to_address text(65535) NOT NULL DEFAULT '', - bcc_address text(65535) NOT NULL DEFAULT '', - message_reported INTEGER UNSIGNED NOT NULL DEFAULT '0' -); - -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_author_id ON phpbb_privmsgs (author_id); -CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs (root_level); - -# Table: 'phpbb_privmsgs_folder' -CREATE TABLE phpbb_privmsgs_folder ( - folder_id INTEGER PRIMARY KEY NOT NULL , - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - folder_name varchar(255) NOT NULL DEFAULT '', - pm_count INTEGER UNSIGNED NOT NULL DEFAULT '0' -); - -CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id); - -# Table: 'phpbb_privmsgs_rules' -CREATE TABLE phpbb_privmsgs_rules ( - rule_id INTEGER PRIMARY KEY NOT NULL , - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - rule_check INTEGER UNSIGNED NOT NULL DEFAULT '0', - rule_connection INTEGER UNSIGNED NOT NULL DEFAULT '0', - rule_string varchar(255) NOT NULL DEFAULT '', - rule_user_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_folder_id int(11) NOT NULL DEFAULT '0' -); - -CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules (user_id); - -# Table: 'phpbb_privmsgs_to' -CREATE TABLE phpbb_privmsgs_to ( - msg_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - author_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - pm_deleted INTEGER UNSIGNED NOT NULL DEFAULT '0', - pm_new INTEGER UNSIGNED NOT NULL DEFAULT '1', - pm_unread INTEGER UNSIGNED NOT NULL DEFAULT '1', - pm_replied INTEGER UNSIGNED NOT NULL DEFAULT '0', - pm_marked INTEGER UNSIGNED NOT NULL DEFAULT '0', - pm_forwarded INTEGER UNSIGNED NOT NULL DEFAULT '0', - folder_id int(11) NOT NULL DEFAULT '0' -); - -CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id); -CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to (author_id); -CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folder_id); - -# Table: 'phpbb_profile_fields' -CREATE TABLE phpbb_profile_fields ( - field_id INTEGER PRIMARY KEY NOT NULL , - field_name varchar(255) NOT NULL DEFAULT '', - field_type varchar(100) NOT NULL DEFAULT '', - field_ident varchar(20) NOT NULL DEFAULT '', - field_length varchar(20) NOT NULL DEFAULT '', - field_minlen varchar(255) NOT NULL DEFAULT '', - field_maxlen varchar(255) NOT NULL DEFAULT '', - field_novalue varchar(255) NOT NULL DEFAULT '', - field_default_value varchar(255) NOT NULL DEFAULT '', - field_validation varchar(20) NOT NULL DEFAULT '', - field_required INTEGER UNSIGNED NOT NULL DEFAULT '0', - field_show_novalue INTEGER UNSIGNED NOT NULL DEFAULT '0', - field_show_on_reg INTEGER UNSIGNED NOT NULL DEFAULT '0', - field_show_on_pm INTEGER UNSIGNED NOT NULL DEFAULT '0', - field_show_on_vt INTEGER UNSIGNED NOT NULL DEFAULT '0', - field_show_on_ml INTEGER UNSIGNED NOT NULL DEFAULT '0', - field_show_profile INTEGER UNSIGNED NOT NULL DEFAULT '0', - field_hide INTEGER UNSIGNED NOT NULL DEFAULT '0', - field_no_view INTEGER UNSIGNED NOT NULL DEFAULT '0', - field_active INTEGER UNSIGNED NOT NULL DEFAULT '0', - field_order INTEGER UNSIGNED NOT NULL DEFAULT '0', - field_is_contact INTEGER UNSIGNED NOT NULL DEFAULT '0', - field_contact_desc varchar(255) NOT NULL DEFAULT '', - field_contact_url varchar(255) NOT NULL DEFAULT '' -); - -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); - -# Table: 'phpbb_profile_fields_data' -CREATE TABLE phpbb_profile_fields_data ( - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - pf_phpbb_location varchar(255) NOT NULL DEFAULT '', - pf_phpbb_interests text(65535) NOT NULL DEFAULT '', - pf_phpbb_occupation text(65535) NOT NULL DEFAULT '', - pf_phpbb_icq varchar(255) NOT NULL DEFAULT '', - pf_phpbb_aol varchar(255) NOT NULL DEFAULT '', - pf_phpbb_wlm varchar(255) NOT NULL DEFAULT '', - pf_phpbb_yahoo varchar(255) NOT NULL DEFAULT '', - pf_phpbb_website varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (user_id) -); - - -# Table: 'phpbb_profile_fields_lang' -CREATE TABLE phpbb_profile_fields_lang ( - field_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - lang_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - option_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - field_type varchar(100) NOT NULL DEFAULT '', - lang_value varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (field_id, lang_id, option_id) -); - - -# Table: 'phpbb_profile_lang' -CREATE TABLE phpbb_profile_lang ( - field_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - lang_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - lang_name varchar(255) NOT NULL DEFAULT '', - lang_explain text(65535) NOT NULL DEFAULT '', - lang_default_value varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (field_id, lang_id) -); - - -# Table: 'phpbb_ranks' -CREATE TABLE phpbb_ranks ( - rank_id INTEGER PRIMARY KEY NOT NULL , - rank_title varchar(255) NOT NULL DEFAULT '', - rank_min INTEGER UNSIGNED NOT NULL DEFAULT '0', - rank_special INTEGER UNSIGNED NOT NULL DEFAULT '0', - rank_image varchar(255) NOT NULL DEFAULT '' -); - - -# Table: 'phpbb_reports' -CREATE TABLE phpbb_reports ( - report_id INTEGER PRIMARY KEY NOT NULL , - reason_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - post_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - pm_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_notify INTEGER UNSIGNED NOT NULL DEFAULT '0', - report_closed INTEGER UNSIGNED NOT NULL DEFAULT '0', - report_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - report_text mediumtext(16777215) NOT NULL DEFAULT '', - reported_post_text mediumtext(16777215) NOT NULL DEFAULT '', - reported_post_uid varchar(8) NOT NULL DEFAULT '', - reported_post_bitfield varchar(255) NOT NULL DEFAULT '', - reported_post_enable_magic_url INTEGER UNSIGNED NOT NULL DEFAULT '1', - reported_post_enable_smilies INTEGER UNSIGNED NOT NULL DEFAULT '1', - reported_post_enable_bbcode INTEGER UNSIGNED NOT NULL DEFAULT '1' -); - -CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id); -CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id); - -# Table: 'phpbb_reports_reasons' -CREATE TABLE phpbb_reports_reasons ( - reason_id INTEGER PRIMARY KEY NOT NULL , - reason_title varchar(255) NOT NULL DEFAULT '', - reason_description mediumtext(16777215) NOT NULL DEFAULT '', - reason_order INTEGER UNSIGNED NOT NULL DEFAULT '0' -); - - -# Table: 'phpbb_search_results' -CREATE TABLE phpbb_search_results ( - search_key varchar(32) NOT NULL DEFAULT '', - search_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - search_keywords mediumtext(16777215) NOT NULL DEFAULT '', - search_authors mediumtext(16777215) NOT NULL DEFAULT '', - PRIMARY KEY (search_key) -); - - -# Table: 'phpbb_search_wordlist' -CREATE TABLE phpbb_search_wordlist ( - word_id INTEGER PRIMARY KEY NOT NULL , - word_text varchar(255) NOT NULL DEFAULT '', - word_common INTEGER UNSIGNED NOT NULL DEFAULT '0', - word_count INTEGER UNSIGNED NOT NULL DEFAULT '0' -); - -CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist (word_text); -CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist (word_count); - -# Table: 'phpbb_search_wordmatch' -CREATE TABLE phpbb_search_wordmatch ( - post_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - word_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - title_match INTEGER UNSIGNED NOT NULL DEFAULT '0' -); - -CREATE UNIQUE INDEX phpbb_search_wordmatch_unq_mtch ON phpbb_search_wordmatch (word_id, post_id, title_match); -CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id); -CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id); - -# Table: 'phpbb_sessions' -CREATE TABLE phpbb_sessions ( - session_id char(32) NOT NULL DEFAULT '', - session_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - session_forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - session_last_visit INTEGER UNSIGNED NOT NULL DEFAULT '0', - session_start INTEGER UNSIGNED NOT NULL DEFAULT '0', - session_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - session_ip varchar(40) NOT NULL DEFAULT '', - session_browser varchar(150) NOT NULL DEFAULT '', - session_forwarded_for varchar(255) NOT NULL DEFAULT '', - session_page varchar(255) NOT NULL DEFAULT '', - session_viewonline INTEGER UNSIGNED NOT NULL DEFAULT '1', - session_autologin INTEGER UNSIGNED NOT NULL DEFAULT '0', - session_admin INTEGER UNSIGNED NOT NULL DEFAULT '0', - PRIMARY KEY (session_id) -); - -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_fid ON phpbb_sessions (session_forum_id); - -# Table: 'phpbb_sessions_keys' -CREATE TABLE phpbb_sessions_keys ( - key_id char(32) NOT NULL DEFAULT '', - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - last_ip varchar(40) NOT NULL DEFAULT '', - last_login INTEGER UNSIGNED NOT NULL DEFAULT '0', - PRIMARY KEY (key_id, user_id) -); - -CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login); - -# Table: 'phpbb_sitelist' -CREATE TABLE phpbb_sitelist ( - site_id INTEGER PRIMARY KEY NOT NULL , - site_ip varchar(40) NOT NULL DEFAULT '', - site_hostname varchar(255) NOT NULL DEFAULT '', - ip_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0' -); - - -# Table: 'phpbb_smilies' -CREATE TABLE phpbb_smilies ( - smiley_id INTEGER PRIMARY KEY NOT NULL , - code varchar(50) NOT NULL DEFAULT '', - emotion varchar(50) NOT NULL DEFAULT '', - smiley_url varchar(50) NOT NULL DEFAULT '', - smiley_width INTEGER UNSIGNED NOT NULL DEFAULT '0', - smiley_height INTEGER UNSIGNED NOT NULL DEFAULT '0', - smiley_order INTEGER UNSIGNED NOT NULL DEFAULT '0', - display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '1' -); - -CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting); - -# Table: 'phpbb_styles' -CREATE TABLE phpbb_styles ( - style_id INTEGER PRIMARY KEY NOT NULL , - style_name varchar(255) NOT NULL DEFAULT '', - style_copyright varchar(255) NOT NULL DEFAULT '', - style_active INTEGER UNSIGNED NOT NULL DEFAULT '1', - style_path varchar(100) NOT NULL DEFAULT '', - bbcode_bitfield varchar(255) NOT NULL DEFAULT 'kNg=', - style_parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - style_parent_tree text(65535) NOT NULL DEFAULT '' -); - -CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name); - -# Table: 'phpbb_teampage' -CREATE TABLE phpbb_teampage ( - teampage_id INTEGER PRIMARY KEY NOT NULL , - group_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - teampage_name varchar(255) NOT NULL DEFAULT '', - teampage_position INTEGER UNSIGNED NOT NULL DEFAULT '0', - teampage_parent INTEGER UNSIGNED NOT NULL DEFAULT '0' -); - - -# Table: 'phpbb_topics' -CREATE TABLE phpbb_topics ( - topic_id INTEGER PRIMARY KEY NOT NULL , - forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - icon_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_visibility tinyint(3) NOT NULL DEFAULT '0', - topic_reported INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_title text(65535) NOT NULL DEFAULT '', - topic_poster INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_time_limit INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_views INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_posts_approved INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_posts_unapproved INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_posts_softdeleted INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_status tinyint(3) NOT NULL DEFAULT '0', - topic_type tinyint(3) NOT NULL DEFAULT '0', - topic_first_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_first_poster_name varchar(255) NOT NULL DEFAULT '', - topic_first_poster_colour varchar(6) NOT NULL DEFAULT '', - topic_last_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_last_poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_last_poster_name varchar(255) NOT NULL DEFAULT '', - topic_last_poster_colour varchar(6) NOT NULL DEFAULT '', - topic_last_post_subject text(65535) NOT NULL DEFAULT '', - topic_last_post_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_last_view_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_moved_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_bumped INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_bumper INTEGER UNSIGNED NOT NULL DEFAULT '0', - poll_title text(65535) NOT NULL DEFAULT '', - poll_start INTEGER UNSIGNED NOT NULL DEFAULT '0', - poll_length INTEGER UNSIGNED NOT NULL DEFAULT '0', - poll_max_options tinyint(4) NOT NULL DEFAULT '1', - poll_last_vote INTEGER UNSIGNED NOT NULL DEFAULT '0', - poll_vote_change INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_delete_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_delete_reason text(65535) NOT NULL DEFAULT '', - topic_delete_user INTEGER UNSIGNED NOT NULL DEFAULT '0' -); - -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_last_post_time ON phpbb_topics (topic_last_post_time); -CREATE INDEX phpbb_topics_topic_visibility ON phpbb_topics (topic_visibility); -CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics (forum_id, topic_visibility, topic_last_post_id); -CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id); - -# Table: 'phpbb_topics_track' -CREATE TABLE phpbb_topics_track ( - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - mark_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - PRIMARY KEY (user_id, topic_id) -); - -CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id); -CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id); - -# Table: 'phpbb_topics_posted' -CREATE TABLE phpbb_topics_posted ( - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - topic_posted INTEGER UNSIGNED NOT NULL DEFAULT '0', - PRIMARY KEY (user_id, topic_id) -); - - -# Table: 'phpbb_topics_watch' -CREATE TABLE phpbb_topics_watch ( - topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_id 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_user_id ON phpbb_topics_watch (user_id); -CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status); - -# Table: 'phpbb_user_notifications' -CREATE TABLE phpbb_user_notifications ( - item_type varchar(255) NOT NULL DEFAULT '', - item_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - method varchar(255) NOT NULL DEFAULT '', - notify INTEGER UNSIGNED NOT NULL DEFAULT '1' -); - - -# Table: 'phpbb_user_group' -CREATE TABLE phpbb_user_group ( - group_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - group_leader INTEGER UNSIGNED NOT NULL DEFAULT '0', - 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_user_id ON phpbb_user_group (user_id); -CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group (group_leader); - -# Table: 'phpbb_users' -CREATE TABLE phpbb_users ( - user_id INTEGER PRIMARY KEY NOT NULL , - user_type tinyint(2) NOT NULL DEFAULT '0', - group_id INTEGER UNSIGNED NOT NULL DEFAULT '3', - user_permissions mediumtext(16777215) NOT NULL DEFAULT '', - user_perm_from INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_ip varchar(40) NOT NULL DEFAULT '', - user_regdate INTEGER UNSIGNED NOT NULL DEFAULT '0', - username varchar(255) NOT NULL DEFAULT '', - username_clean varchar(255) NOT NULL DEFAULT '', - user_password varchar(255) NOT NULL DEFAULT '', - user_passchg INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_pass_convert INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_actkey varchar(32) NOT NULL DEFAULT '', - user_newpasswd varchar(255) NOT NULL DEFAULT '', - user_email varchar(100) NOT NULL DEFAULT '', - user_email_hash bigint(20) NOT NULL DEFAULT '0', - user_birthday varchar(10) NOT NULL DEFAULT '', - user_lastvisit INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_lastmark INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_lastpost_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_lastpage varchar(200) NOT NULL DEFAULT '', - user_last_confirm_key varchar(10) NOT NULL DEFAULT '', - user_last_search INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_warnings tinyint(4) NOT NULL DEFAULT '0', - user_last_warning INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_login_attempts tinyint(4) NOT NULL DEFAULT '0', - user_inactive_reason tinyint(2) NOT NULL DEFAULT '0', - user_inactive_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_posts INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_lang varchar(30) NOT NULL DEFAULT '', - user_timezone varchar(100) NOT NULL DEFAULT 'UTC', - user_dateformat varchar(30) NOT NULL DEFAULT 'd M Y H:i', - user_style INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_rank INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_colour varchar(6) NOT NULL DEFAULT '', - user_new_privmsg int(4) NOT NULL DEFAULT '0', - user_unread_privmsg int(4) NOT NULL DEFAULT '0', - user_last_privmsg INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_message_rules INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_full_folder int(11) NOT NULL DEFAULT '-3', - user_emailtime INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_topic_show_days INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_topic_sortby_type varchar(1) NOT NULL DEFAULT 't', - user_topic_sortby_dir varchar(1) NOT NULL DEFAULT 'd', - user_post_show_days INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_post_sortby_type varchar(1) NOT NULL DEFAULT 't', - user_post_sortby_dir varchar(1) NOT NULL DEFAULT 'a', - user_notify INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_notify_pm INTEGER UNSIGNED NOT NULL DEFAULT '1', - user_notify_type tinyint(4) NOT NULL DEFAULT '0', - user_allow_pm INTEGER UNSIGNED NOT NULL DEFAULT '1', - user_allow_viewonline INTEGER UNSIGNED NOT NULL DEFAULT '1', - user_allow_viewemail INTEGER UNSIGNED NOT NULL DEFAULT '1', - user_allow_massemail INTEGER UNSIGNED NOT NULL DEFAULT '1', - user_options INTEGER UNSIGNED NOT NULL DEFAULT '230271', - user_avatar varchar(255) NOT NULL DEFAULT '', - user_avatar_type varchar(255) NOT NULL DEFAULT '', - user_avatar_width INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_avatar_height INTEGER UNSIGNED NOT NULL DEFAULT '0', - user_sig mediumtext(16777215) NOT NULL DEFAULT '', - user_sig_bbcode_uid varchar(8) NOT NULL DEFAULT '', - user_sig_bbcode_bitfield varchar(255) NOT NULL DEFAULT '', - user_jabber varchar(255) NOT NULL DEFAULT '', - user_form_salt varchar(32) NOT NULL DEFAULT '', - user_new INTEGER UNSIGNED NOT NULL DEFAULT '1', - user_reminded tinyint(4) NOT NULL DEFAULT '0', - user_reminded_time INTEGER UNSIGNED NOT NULL DEFAULT '0' -); - -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_type ON phpbb_users (user_type); -CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users (username_clean); - -# Table: 'phpbb_warnings' -CREATE TABLE phpbb_warnings ( - warning_id INTEGER PRIMARY KEY NOT NULL , - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - post_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - log_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - warning_time INTEGER UNSIGNED NOT NULL DEFAULT '0' -); - - -# Table: 'phpbb_words' -CREATE TABLE phpbb_words ( - word_id INTEGER PRIMARY KEY NOT NULL , - word varchar(255) NOT NULL DEFAULT '', - replacement varchar(255) NOT NULL DEFAULT '' -); - - -# Table: 'phpbb_zebra' -CREATE TABLE phpbb_zebra ( - user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - zebra_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - friend INTEGER UNSIGNED NOT NULL DEFAULT '0', - foe INTEGER UNSIGNED NOT NULL DEFAULT '0', - PRIMARY KEY (user_id, zebra_id) -); - - - -COMMIT;
\ No newline at end of file diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_0.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_0.php new file mode 100644 index 0000000000..41ade22a29 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_0.php @@ -0,0 +1,1177 @@ +<?php +/** +* +* @package migration +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +namespace phpbb\db\migration\data\v30x; + +class release_3_0_0 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.0', '>='); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'attachments' => array( + 'COLUMNS' => array( + 'attach_id' => array('UINT', NULL, 'auto_increment'), + 'post_msg_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + 'in_message' => array('BOOL', 0), + 'poster_id' => array('UINT', 0), + 'is_orphan' => array('BOOL', 1), + 'physical_filename' => array('VCHAR', ''), + 'real_filename' => array('VCHAR', ''), + 'download_count' => array('UINT', 0), + 'attach_comment' => array('TEXT_UNI', ''), + 'extension' => array('VCHAR:100', ''), + 'mimetype' => array('VCHAR:100', ''), + 'filesize' => array('UINT:20', 0), + 'filetime' => array('TIMESTAMP', 0), + 'thumbnail' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'attach_id', + 'KEYS' => array( + 'filetime' => array('INDEX', 'filetime'), + 'post_msg_id' => array('INDEX', 'post_msg_id'), + 'topic_id' => array('INDEX', 'topic_id'), + 'poster_id' => array('INDEX', 'poster_id'), + 'is_orphan' => array('INDEX', 'is_orphan'), + ), + ), + + $this->table_prefix . 'acl_groups' => array( + 'COLUMNS' => array( + 'group_id' => array('UINT', 0), + 'forum_id' => array('UINT', 0), + 'auth_option_id' => array('UINT', 0), + 'auth_role_id' => array('UINT', 0), + 'auth_setting' => array('TINT:2', 0), + ), + 'KEYS' => array( + 'group_id' => array('INDEX', 'group_id'), + 'auth_opt_id' => array('INDEX', 'auth_option_id'), + 'auth_role_id' => array('INDEX', 'auth_role_id'), + ), + ), + + $this->table_prefix . 'acl_options' => array( + 'COLUMNS' => array( + 'auth_option_id' => array('UINT', NULL, 'auto_increment'), + 'auth_option' => array('VCHAR:50', ''), + 'is_global' => array('BOOL', 0), + 'is_local' => array('BOOL', 0), + 'founder_only' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'auth_option_id', + 'KEYS' => array( + 'auth_option' => array('INDEX', 'auth_option'), + ), + ), + + $this->table_prefix . 'acl_roles' => array( + 'COLUMNS' => array( + 'role_id' => array('UINT', NULL, 'auto_increment'), + 'role_name' => array('VCHAR_UNI', ''), + 'role_description' => array('TEXT_UNI', ''), + 'role_type' => array('VCHAR:10', ''), + 'role_order' => array('USINT', 0), + ), + 'PRIMARY_KEY' => 'role_id', + 'KEYS' => array( + 'role_type' => array('INDEX', 'role_type'), + 'role_order' => array('INDEX', 'role_order'), + ), + ), + + $this->table_prefix . 'acl_roles_data' => array( + 'COLUMNS' => array( + 'role_id' => array('UINT', 0), + 'auth_option_id' => array('UINT', 0), + 'auth_setting' => array('TINT:2', 0), + ), + 'PRIMARY_KEY' => array('role_id', 'auth_option_id'), + 'KEYS' => array( + 'ath_op_id' => array('INDEX', 'auth_option_id'), + ), + ), + + $this->table_prefix . 'acl_users' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'forum_id' => array('UINT', 0), + 'auth_option_id' => array('UINT', 0), + 'auth_role_id' => array('UINT', 0), + 'auth_setting' => array('TINT:2', 0), + ), + 'KEYS' => array( + 'user_id' => array('INDEX', 'user_id'), + 'auth_option_id' => array('INDEX', 'auth_option_id'), + 'auth_role_id' => array('INDEX', 'auth_role_id'), + ), + ), + + $this->table_prefix . 'banlist' => array( + 'COLUMNS' => array( + 'ban_id' => array('UINT', NULL, 'auto_increment'), + 'ban_userid' => array('UINT', 0), + 'ban_ip' => array('VCHAR:40', ''), + 'ban_email' => array('VCHAR_UNI:100', ''), + 'ban_start' => array('TIMESTAMP', 0), + 'ban_end' => array('TIMESTAMP', 0), + 'ban_exclude' => array('BOOL', 0), + 'ban_reason' => array('VCHAR_UNI', ''), + 'ban_give_reason' => array('VCHAR_UNI', ''), + ), + 'PRIMARY_KEY' => 'ban_id', + 'KEYS' => array( + 'ban_end' => array('INDEX', 'ban_end'), + 'ban_user' => array('INDEX', array('ban_userid', 'ban_exclude')), + 'ban_email' => array('INDEX', array('ban_email', 'ban_exclude')), + 'ban_ip' => array('INDEX', array('ban_ip', 'ban_exclude')), + ), + ), + + $this->table_prefix . 'bbcodes' => array( + 'COLUMNS' => array( + 'bbcode_id' => array('TINT:3', 0), + 'bbcode_tag' => array('VCHAR:16', ''), + 'bbcode_helpline' => array('VCHAR_UNI', ''), + 'display_on_posting' => array('BOOL', 0), + 'bbcode_match' => array('TEXT_UNI', ''), + 'bbcode_tpl' => array('MTEXT_UNI', ''), + 'first_pass_match' => array('MTEXT_UNI', ''), + 'first_pass_replace' => array('MTEXT_UNI', ''), + 'second_pass_match' => array('MTEXT_UNI', ''), + 'second_pass_replace' => array('MTEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'bbcode_id', + 'KEYS' => array( + 'display_on_post' => array('INDEX', 'display_on_posting'), + ), + ), + + $this->table_prefix . 'bookmarks' => array( + 'COLUMNS' => array( + 'topic_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + ), + 'PRIMARY_KEY' => array('topic_id', 'user_id'), + ), + + $this->table_prefix . 'bots' => array( + 'COLUMNS' => array( + 'bot_id' => array('UINT', NULL, 'auto_increment'), + 'bot_active' => array('BOOL', 1), + 'bot_name' => array('STEXT_UNI', ''), + 'user_id' => array('UINT', 0), + 'bot_agent' => array('VCHAR', ''), + 'bot_ip' => array('VCHAR', ''), + ), + 'PRIMARY_KEY' => 'bot_id', + 'KEYS' => array( + 'bot_active' => array('INDEX', 'bot_active'), + ), + ), + + $this->table_prefix . 'config' => array( + 'COLUMNS' => array( + 'config_name' => array('VCHAR', ''), + 'config_value' => array('VCHAR_UNI', ''), + 'is_dynamic' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'config_name', + 'KEYS' => array( + 'is_dynamic' => array('INDEX', 'is_dynamic'), + ), + ), + + $this->table_prefix . 'confirm' => array( + 'COLUMNS' => array( + 'confirm_id' => array('CHAR:32', ''), + 'session_id' => array('CHAR:32', ''), + 'confirm_type' => array('TINT:3', 0), + 'code' => array('VCHAR:8', ''), + 'seed' => array('UINT:10', 0), + ), + 'PRIMARY_KEY' => array('session_id', 'confirm_id'), + 'KEYS' => array( + 'confirm_type' => array('INDEX', 'confirm_type'), + ), + ), + + $this->table_prefix . 'disallow' => array( + 'COLUMNS' => array( + 'disallow_id' => array('UINT', NULL, 'auto_increment'), + 'disallow_username' => array('VCHAR_UNI:255', ''), + ), + 'PRIMARY_KEY' => 'disallow_id', + ), + + $this->table_prefix . 'drafts' => array( + 'COLUMNS' => array( + 'draft_id' => array('UINT', NULL, 'auto_increment'), + 'user_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + 'forum_id' => array('UINT', 0), + 'save_time' => array('TIMESTAMP', 0), + 'draft_subject' => array('XSTEXT_UNI', ''), + 'draft_message' => array('MTEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'draft_id', + 'KEYS' => array( + 'save_time' => array('INDEX', 'save_time'), + ), + ), + + $this->table_prefix . 'extensions' => array( + 'COLUMNS' => array( + 'extension_id' => array('UINT', NULL, 'auto_increment'), + 'group_id' => array('UINT', 0), + 'extension' => array('VCHAR:100', ''), + ), + 'PRIMARY_KEY' => 'extension_id', + ), + + $this->table_prefix . 'extension_groups' => array( + 'COLUMNS' => array( + 'group_id' => array('UINT', NULL, 'auto_increment'), + 'group_name' => array('VCHAR_UNI', ''), + 'cat_id' => array('TINT:2', 0), + 'allow_group' => array('BOOL', 0), + 'download_mode' => array('BOOL', 1), + 'upload_icon' => array('VCHAR', ''), + 'max_filesize' => array('UINT:20', 0), + 'allowed_forums' => array('TEXT', ''), + 'allow_in_pm' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'group_id', + ), + + $this->table_prefix . 'forums' => array( + 'COLUMNS' => array( + 'forum_id' => array('UINT', NULL, 'auto_increment'), + 'parent_id' => array('UINT', 0), + 'left_id' => array('UINT', 0), + 'right_id' => array('UINT', 0), + 'forum_parents' => array('MTEXT', ''), + 'forum_name' => array('STEXT_UNI', ''), + 'forum_desc' => array('TEXT_UNI', ''), + 'forum_desc_bitfield' => array('VCHAR:255', ''), + 'forum_desc_options' => array('UINT:11', 7), + 'forum_desc_uid' => array('VCHAR:8', ''), + 'forum_link' => array('VCHAR_UNI', ''), + 'forum_password' => array('VCHAR_UNI:40', ''), + 'forum_style' => array('USINT', 0), + 'forum_image' => array('VCHAR', ''), + 'forum_rules' => array('TEXT_UNI', ''), + 'forum_rules_link' => array('VCHAR_UNI', ''), + 'forum_rules_bitfield' => array('VCHAR:255', ''), + 'forum_rules_options' => array('UINT:11', 7), + 'forum_rules_uid' => array('VCHAR:8', ''), + 'forum_topics_per_page' => array('TINT:4', 0), + 'forum_type' => array('TINT:4', 0), + 'forum_status' => array('TINT:4', 0), + 'forum_posts' => array('UINT', 0), + 'forum_topics' => array('UINT', 0), + 'forum_topics_real' => array('UINT', 0), + 'forum_last_post_id' => array('UINT', 0), + 'forum_last_poster_id' => array('UINT', 0), + 'forum_last_post_subject' => array('XSTEXT_UNI', ''), + 'forum_last_post_time' => array('TIMESTAMP', 0), + 'forum_last_poster_name'=> array('VCHAR_UNI', ''), + 'forum_last_poster_colour'=> array('VCHAR:6', ''), + 'forum_flags' => array('TINT:4', 32), + 'display_on_index' => array('BOOL', 1), + 'enable_indexing' => array('BOOL', 1), + 'enable_icons' => array('BOOL', 1), + 'enable_prune' => array('BOOL', 0), + 'prune_next' => array('TIMESTAMP', 0), + 'prune_days' => array('UINT', 0), + 'prune_viewed' => array('UINT', 0), + 'prune_freq' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'forum_id', + 'KEYS' => array( + 'left_right_id' => array('INDEX', array('left_id', 'right_id')), + 'forum_lastpost_id' => array('INDEX', 'forum_last_post_id'), + ), + ), + + $this->table_prefix . 'forums_access' => array( + 'COLUMNS' => array( + 'forum_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'session_id' => array('CHAR:32', ''), + ), + 'PRIMARY_KEY' => array('forum_id', 'user_id', 'session_id'), + ), + + $this->table_prefix . 'forums_track' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'forum_id' => array('UINT', 0), + 'mark_time' => array('TIMESTAMP', 0), + ), + 'PRIMARY_KEY' => array('user_id', 'forum_id'), + ), + + $this->table_prefix . 'forums_watch' => array( + 'COLUMNS' => array( + 'forum_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'notify_status' => array('BOOL', 0), + ), + 'KEYS' => array( + 'forum_id' => array('INDEX', 'forum_id'), + 'user_id' => array('INDEX', 'user_id'), + 'notify_stat' => array('INDEX', 'notify_status'), + ), + ), + + $this->table_prefix . 'groups' => array( + 'COLUMNS' => array( + 'group_id' => array('UINT', NULL, 'auto_increment'), + 'group_type' => array('TINT:4', 1), + 'group_founder_manage' => array('BOOL', 0), + 'group_name' => array('VCHAR_CI', ''), + 'group_desc' => array('TEXT_UNI', ''), + 'group_desc_bitfield' => array('VCHAR:255', ''), + 'group_desc_options' => array('UINT:11', 7), + 'group_desc_uid' => array('VCHAR:8', ''), + 'group_display' => array('BOOL', 0), + 'group_avatar' => array('VCHAR', ''), + 'group_avatar_type' => array('TINT:2', 0), + 'group_avatar_width' => array('USINT', 0), + 'group_avatar_height' => array('USINT', 0), + 'group_rank' => array('UINT', 0), + 'group_colour' => array('VCHAR:6', ''), + 'group_sig_chars' => array('UINT', 0), + 'group_receive_pm' => array('BOOL', 0), + 'group_message_limit' => array('UINT', 0), + 'group_legend' => array('BOOL', 1), + ), + 'PRIMARY_KEY' => 'group_id', + 'KEYS' => array( + 'group_legend' => array('INDEX', 'group_legend'), + ), + ), + + $this->table_prefix . 'icons' => array( + 'COLUMNS' => array( + 'icons_id' => array('UINT', NULL, 'auto_increment'), + 'icons_url' => array('VCHAR', ''), + 'icons_width' => array('TINT:4', 0), + 'icons_height' => array('TINT:4', 0), + 'icons_order' => array('UINT', 0), + 'display_on_posting' => array('BOOL', 1), + ), + 'PRIMARY_KEY' => 'icons_id', + 'KEYS' => array( + 'display_on_posting' => array('INDEX', 'display_on_posting'), + ), + ), + + $this->table_prefix . 'lang' => array( + 'COLUMNS' => array( + 'lang_id' => array('TINT:4', NULL, 'auto_increment'), + 'lang_iso' => array('VCHAR:30', ''), + 'lang_dir' => array('VCHAR:30', ''), + 'lang_english_name' => array('VCHAR_UNI:100', ''), + 'lang_local_name' => array('VCHAR_UNI:255', ''), + 'lang_author' => array('VCHAR_UNI:255', ''), + ), + 'PRIMARY_KEY' => 'lang_id', + 'KEYS' => array( + 'lang_iso' => array('INDEX', 'lang_iso'), + ), + ), + + $this->table_prefix . 'log' => array( + 'COLUMNS' => array( + 'log_id' => array('UINT', NULL, 'auto_increment'), + 'log_type' => array('TINT:4', 0), + 'user_id' => array('UINT', 0), + 'forum_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + 'reportee_id' => array('UINT', 0), + 'log_ip' => array('VCHAR:40', ''), + 'log_time' => array('TIMESTAMP', 0), + 'log_operation' => array('TEXT_UNI', ''), + 'log_data' => array('MTEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'log_id', + 'KEYS' => array( + 'log_type' => array('INDEX', 'log_type'), + 'forum_id' => array('INDEX', 'forum_id'), + 'topic_id' => array('INDEX', 'topic_id'), + 'reportee_id' => array('INDEX', 'reportee_id'), + 'user_id' => array('INDEX', 'user_id'), + ), + ), + + $this->table_prefix . 'moderator_cache' => array( + 'COLUMNS' => array( + 'forum_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'username' => array('VCHAR_UNI:255', ''), + 'group_id' => array('UINT', 0), + 'group_name' => array('VCHAR_UNI', ''), + 'display_on_index' => array('BOOL', 1), + ), + 'KEYS' => array( + 'disp_idx' => array('INDEX', 'display_on_index'), + 'forum_id' => array('INDEX', 'forum_id'), + ), + ), + + $this->table_prefix . 'modules' => array( + 'COLUMNS' => array( + 'module_id' => array('UINT', NULL, 'auto_increment'), + 'module_enabled' => array('BOOL', 1), + 'module_display' => array('BOOL', 1), + 'module_basename' => array('VCHAR', ''), + 'module_class' => array('VCHAR:10', ''), + 'parent_id' => array('UINT', 0), + 'left_id' => array('UINT', 0), + 'right_id' => array('UINT', 0), + 'module_langname' => array('VCHAR', ''), + 'module_mode' => array('VCHAR', ''), + 'module_auth' => array('VCHAR', ''), + ), + 'PRIMARY_KEY' => 'module_id', + 'KEYS' => array( + 'left_right_id' => array('INDEX', array('left_id', 'right_id')), + 'module_enabled' => array('INDEX', 'module_enabled'), + 'class_left_id' => array('INDEX', array('module_class', 'left_id')), + ), + ), + + $this->table_prefix . 'poll_options' => array( + 'COLUMNS' => array( + 'poll_option_id' => array('TINT:4', 0), + 'topic_id' => array('UINT', 0), + 'poll_option_text' => array('TEXT_UNI', ''), + 'poll_option_total' => array('UINT', 0), + ), + 'KEYS' => array( + 'poll_opt_id' => array('INDEX', 'poll_option_id'), + 'topic_id' => array('INDEX', 'topic_id'), + ), + ), + + $this->table_prefix . 'poll_votes' => array( + 'COLUMNS' => array( + 'topic_id' => array('UINT', 0), + 'poll_option_id' => array('TINT:4', 0), + 'vote_user_id' => array('UINT', 0), + 'vote_user_ip' => array('VCHAR:40', ''), + ), + 'KEYS' => array( + 'topic_id' => array('INDEX', 'topic_id'), + 'vote_user_id' => array('INDEX', 'vote_user_id'), + 'vote_user_ip' => array('INDEX', 'vote_user_ip'), + ), + ), + + $this->table_prefix . 'posts' => array( + 'COLUMNS' => array( + 'post_id' => array('UINT', NULL, 'auto_increment'), + 'topic_id' => array('UINT', 0), + 'forum_id' => array('UINT', 0), + 'poster_id' => array('UINT', 0), + 'icon_id' => array('UINT', 0), + 'poster_ip' => array('VCHAR:40', ''), + 'post_time' => array('TIMESTAMP', 0), + 'post_approved' => array('BOOL', 1), + 'post_reported' => array('BOOL', 0), + 'enable_bbcode' => array('BOOL', 1), + 'enable_smilies' => array('BOOL', 1), + 'enable_magic_url' => array('BOOL', 1), + 'enable_sig' => array('BOOL', 1), + 'post_username' => array('VCHAR_UNI:255', ''), + 'post_subject' => array('XSTEXT_UNI', '', 'true_sort'), + 'post_text' => array('MTEXT_UNI', ''), + 'post_checksum' => array('VCHAR:32', ''), + 'post_attachment' => array('BOOL', 0), + 'bbcode_bitfield' => array('VCHAR:255', ''), + 'bbcode_uid' => array('VCHAR:8', ''), + 'post_postcount' => array('BOOL', 1), + 'post_edit_time' => array('TIMESTAMP', 0), + 'post_edit_reason' => array('STEXT_UNI', ''), + 'post_edit_user' => array('UINT', 0), + 'post_edit_count' => array('USINT', 0), + 'post_edit_locked' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'post_id', + 'KEYS' => array( + 'forum_id' => array('INDEX', 'forum_id'), + 'topic_id' => array('INDEX', 'topic_id'), + 'poster_ip' => array('INDEX', 'poster_ip'), + 'poster_id' => array('INDEX', 'poster_id'), + 'post_approved' => array('INDEX', 'post_approved'), + 'tid_post_time' => array('INDEX', array('topic_id', 'post_time')), + ), + ), + + $this->table_prefix . 'privmsgs' => array( + 'COLUMNS' => array( + 'msg_id' => array('UINT', NULL, 'auto_increment'), + 'root_level' => array('UINT', 0), + 'author_id' => array('UINT', 0), + 'icon_id' => array('UINT', 0), + 'author_ip' => array('VCHAR:40', ''), + 'message_time' => array('TIMESTAMP', 0), + 'enable_bbcode' => array('BOOL', 1), + 'enable_smilies' => array('BOOL', 1), + 'enable_magic_url' => array('BOOL', 1), + 'enable_sig' => array('BOOL', 1), + 'message_subject' => array('XSTEXT_UNI', ''), + 'message_text' => array('MTEXT_UNI', ''), + 'message_edit_reason' => array('STEXT_UNI', ''), + 'message_edit_user' => array('UINT', 0), + 'message_attachment' => array('BOOL', 0), + 'bbcode_bitfield' => array('VCHAR:255', ''), + 'bbcode_uid' => array('VCHAR:8', ''), + 'message_edit_time' => array('TIMESTAMP', 0), + 'message_edit_count' => array('USINT', 0), + 'to_address' => array('TEXT_UNI', ''), + 'bcc_address' => array('TEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'msg_id', + 'KEYS' => array( + 'author_ip' => array('INDEX', 'author_ip'), + 'message_time' => array('INDEX', 'message_time'), + 'author_id' => array('INDEX', 'author_id'), + 'root_level' => array('INDEX', 'root_level'), + ), + ), + + $this->table_prefix . 'privmsgs_folder' => array( + 'COLUMNS' => array( + 'folder_id' => array('UINT', NULL, 'auto_increment'), + 'user_id' => array('UINT', 0), + 'folder_name' => array('VCHAR_UNI', ''), + 'pm_count' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'folder_id', + 'KEYS' => array( + 'user_id' => array('INDEX', 'user_id'), + ), + ), + + $this->table_prefix . 'privmsgs_rules' => array( + 'COLUMNS' => array( + 'rule_id' => array('UINT', NULL, 'auto_increment'), + 'user_id' => array('UINT', 0), + 'rule_check' => array('UINT', 0), + 'rule_connection' => array('UINT', 0), + 'rule_string' => array('VCHAR_UNI', ''), + 'rule_user_id' => array('UINT', 0), + 'rule_group_id' => array('UINT', 0), + 'rule_action' => array('UINT', 0), + 'rule_folder_id' => array('INT:11', 0), + ), + 'PRIMARY_KEY' => 'rule_id', + 'KEYS' => array( + 'user_id' => array('INDEX', 'user_id'), + ), + ), + + $this->table_prefix . 'privmsgs_to' => array( + 'COLUMNS' => array( + 'msg_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'author_id' => array('UINT', 0), + 'pm_deleted' => array('BOOL', 0), + 'pm_new' => array('BOOL', 1), + 'pm_unread' => array('BOOL', 1), + 'pm_replied' => array('BOOL', 0), + 'pm_marked' => array('BOOL', 0), + 'pm_forwarded' => array('BOOL', 0), + 'folder_id' => array('INT:11', 0), + ), + 'KEYS' => array( + 'msg_id' => array('INDEX', 'msg_id'), + 'author_id' => array('INDEX', 'author_id'), + 'usr_flder_id' => array('INDEX', array('user_id', 'folder_id')), + ), + ), + + $this->table_prefix . 'profile_fields' => array( + 'COLUMNS' => array( + 'field_id' => array('UINT', NULL, 'auto_increment'), + 'field_name' => array('VCHAR_UNI', ''), + 'field_type' => array('TINT:4', 0), + 'field_ident' => array('VCHAR:20', ''), + 'field_length' => array('VCHAR:20', ''), + 'field_minlen' => array('VCHAR', ''), + 'field_maxlen' => array('VCHAR', ''), + 'field_novalue' => array('VCHAR_UNI', ''), + 'field_default_value' => array('VCHAR_UNI', ''), + 'field_validation' => array('VCHAR_UNI:20', ''), + 'field_required' => array('BOOL', 0), + 'field_show_on_reg' => array('BOOL', 0), + 'field_hide' => array('BOOL', 0), + 'field_no_view' => array('BOOL', 0), + 'field_active' => array('BOOL', 0), + 'field_order' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'field_id', + 'KEYS' => array( + 'fld_type' => array('INDEX', 'field_type'), + 'fld_ordr' => array('INDEX', 'field_order'), + ), + ), + + $this->table_prefix . 'profile_fields_data' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'user_id', + ), + + $this->table_prefix . 'profile_fields_lang' => array( + 'COLUMNS' => array( + 'field_id' => array('UINT', 0), + 'lang_id' => array('UINT', 0), + 'option_id' => array('UINT', 0), + 'field_type' => array('TINT:4', 0), + 'lang_value' => array('VCHAR_UNI', ''), + ), + 'PRIMARY_KEY' => array('field_id', 'lang_id', 'option_id'), + ), + + $this->table_prefix . 'profile_lang' => array( + 'COLUMNS' => array( + 'field_id' => array('UINT', 0), + 'lang_id' => array('UINT', 0), + 'lang_name' => array('VCHAR_UNI', ''), + 'lang_explain' => array('TEXT_UNI', ''), + 'lang_default_value' => array('VCHAR_UNI', ''), + ), + 'PRIMARY_KEY' => array('field_id', 'lang_id'), + ), + + $this->table_prefix . 'ranks' => array( + 'COLUMNS' => array( + 'rank_id' => array('UINT', NULL, 'auto_increment'), + 'rank_title' => array('VCHAR_UNI', ''), + 'rank_min' => array('UINT', 0), + 'rank_special' => array('BOOL', 0), + 'rank_image' => array('VCHAR', ''), + ), + 'PRIMARY_KEY' => 'rank_id', + ), + + $this->table_prefix . 'reports' => array( + 'COLUMNS' => array( + 'report_id' => array('UINT', NULL, 'auto_increment'), + 'reason_id' => array('USINT', 0), + 'post_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'user_notify' => array('BOOL', 0), + 'report_closed' => array('BOOL', 0), + 'report_time' => array('TIMESTAMP', 0), + 'report_text' => array('MTEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'report_id', + ), + + $this->table_prefix . 'reports_reasons' => array( + 'COLUMNS' => array( + 'reason_id' => array('USINT', NULL, 'auto_increment'), + 'reason_title' => array('VCHAR_UNI', ''), + 'reason_description' => array('MTEXT_UNI', ''), + 'reason_order' => array('USINT', 0), + ), + 'PRIMARY_KEY' => 'reason_id', + ), + + $this->table_prefix . 'search_results' => array( + 'COLUMNS' => array( + 'search_key' => array('VCHAR:32', ''), + 'search_time' => array('TIMESTAMP', 0), + 'search_keywords' => array('MTEXT_UNI', ''), + 'search_authors' => array('MTEXT', ''), + ), + 'PRIMARY_KEY' => 'search_key', + ), + + $this->table_prefix . 'search_wordlist' => array( + 'COLUMNS' => array( + 'word_id' => array('UINT', NULL, 'auto_increment'), + 'word_text' => array('VCHAR_UNI', ''), + 'word_common' => array('BOOL', 0), + 'word_count' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'word_id', + 'KEYS' => array( + 'wrd_txt' => array('UNIQUE', 'word_text'), + 'wrd_cnt' => array('INDEX', 'word_count'), + ), + ), + + $this->table_prefix . 'search_wordmatch' => array( + 'COLUMNS' => array( + 'post_id' => array('UINT', 0), + 'word_id' => array('UINT', 0), + 'title_match' => array('BOOL', 0), + ), + 'KEYS' => array( + 'unq_mtch' => array('UNIQUE', array('word_id', 'post_id', 'title_match')), + 'word_id' => array('INDEX', 'word_id'), + 'post_id' => array('INDEX', 'post_id'), + ), + ), + + $this->table_prefix . 'sessions' => array( + 'COLUMNS' => array( + 'session_id' => array('CHAR:32', ''), + 'session_user_id' => array('UINT', 0), + 'session_last_visit' => array('TIMESTAMP', 0), + 'session_start' => array('TIMESTAMP', 0), + 'session_time' => array('TIMESTAMP', 0), + 'session_ip' => array('VCHAR:40', ''), + 'session_browser' => array('VCHAR:150', ''), + 'session_forwarded_for' => array('VCHAR:255', ''), + 'session_page' => array('VCHAR_UNI', ''), + 'session_viewonline' => array('BOOL', 1), + 'session_autologin' => array('BOOL', 0), + 'session_admin' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'session_id', + 'KEYS' => array( + 'session_time' => array('INDEX', 'session_time'), + 'session_user_id' => array('INDEX', 'session_user_id'), + ), + ), + + $this->table_prefix . 'sessions_keys' => array( + 'COLUMNS' => array( + 'key_id' => array('CHAR:32', ''), + 'user_id' => array('UINT', 0), + 'last_ip' => array('VCHAR:40', ''), + 'last_login' => array('TIMESTAMP', 0), + ), + 'PRIMARY_KEY' => array('key_id', 'user_id'), + 'KEYS' => array( + 'last_login' => array('INDEX', 'last_login'), + ), + ), + + $this->table_prefix . 'sitelist' => array( + 'COLUMNS' => array( + 'site_id' => array('UINT', NULL, 'auto_increment'), + 'site_ip' => array('VCHAR:40', ''), + 'site_hostname' => array('VCHAR', ''), + 'ip_exclude' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'site_id', + ), + + $this->table_prefix . 'smilies' => array( + 'COLUMNS' => array( + 'smiley_id' => array('UINT', NULL, 'auto_increment'), +// We may want to set 'code' to VCHAR:50 or check if unicode support is possible... at the moment only ASCII characters are allowed. + 'code' => array('VCHAR_UNI:50', ''), + 'emotion' => array('VCHAR_UNI:50', ''), + 'smiley_url' => array('VCHAR:50', ''), + 'smiley_width' => array('USINT', 0), + 'smiley_height' => array('USINT', 0), + 'smiley_order' => array('UINT', 0), + 'display_on_posting'=> array('BOOL', 1), + ), + 'PRIMARY_KEY' => 'smiley_id', + 'KEYS' => array( + 'display_on_post' => array('INDEX', 'display_on_posting'), + ), + ), + + $this->table_prefix . 'styles' => array( + 'COLUMNS' => array( + 'style_id' => array('USINT', NULL, 'auto_increment'), + 'style_name' => array('VCHAR_UNI:255', ''), + 'style_copyright' => array('VCHAR_UNI', ''), + 'style_active' => array('BOOL', 1), + 'template_id' => array('USINT', 0), + 'theme_id' => array('USINT', 0), + 'imageset_id' => array('USINT', 0), + ), + 'PRIMARY_KEY' => 'style_id', + 'KEYS' => array( + 'style_name' => array('UNIQUE', 'style_name'), + 'template_id' => array('INDEX', 'template_id'), + 'theme_id' => array('INDEX', 'theme_id'), + 'imageset_id' => array('INDEX', 'imageset_id'), + ), + ), + + $this->table_prefix . 'styles_template' => array( + 'COLUMNS' => array( + 'template_id' => array('USINT', NULL, 'auto_increment'), + 'template_name' => array('VCHAR_UNI:255', ''), + 'template_copyright' => array('VCHAR_UNI', ''), + 'template_path' => array('VCHAR:100', ''), + 'bbcode_bitfield' => array('VCHAR:255', 'kNg='), + 'template_storedb' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'template_id', + 'KEYS' => array( + 'tmplte_nm' => array('UNIQUE', 'template_name'), + ), + ), + + $this->table_prefix . 'styles_template_data' => array( + 'COLUMNS' => array( + 'template_id' => array('USINT', 0), + 'template_filename' => array('VCHAR:100', ''), + 'template_included' => array('TEXT', ''), + 'template_mtime' => array('TIMESTAMP', 0), + 'template_data' => array('MTEXT_UNI', ''), + ), + 'KEYS' => array( + 'tid' => array('INDEX', 'template_id'), + 'tfn' => array('INDEX', 'template_filename'), + ), + ), + + $this->table_prefix . 'styles_theme' => array( + 'COLUMNS' => array( + 'theme_id' => array('USINT', NULL, 'auto_increment'), + 'theme_name' => array('VCHAR_UNI:255', ''), + 'theme_copyright' => array('VCHAR_UNI', ''), + 'theme_path' => array('VCHAR:100', ''), + 'theme_storedb' => array('BOOL', 0), + 'theme_mtime' => array('TIMESTAMP', 0), + 'theme_data' => array('MTEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'theme_id', + 'KEYS' => array( + 'theme_name' => array('UNIQUE', 'theme_name'), + ), + ), + + $this->table_prefix . 'styles_imageset' => array( + 'COLUMNS' => array( + 'imageset_id' => array('USINT', NULL, 'auto_increment'), + 'imageset_name' => array('VCHAR_UNI:255', ''), + 'imageset_copyright' => array('VCHAR_UNI', ''), + 'imageset_path' => array('VCHAR:100', ''), + ), + 'PRIMARY_KEY' => 'imageset_id', + 'KEYS' => array( + 'imgset_nm' => array('UNIQUE', 'imageset_name'), + ), + ), + + $this->table_prefix . 'styles_imageset_data' => array( + 'COLUMNS' => array( + 'image_id' => array('USINT', NULL, 'auto_increment'), + 'image_name' => array('VCHAR:200', ''), + 'image_filename' => array('VCHAR:200', ''), + 'image_lang' => array('VCHAR:30', ''), + 'image_height' => array('USINT', 0), + 'image_width' => array('USINT', 0), + 'imageset_id' => array('USINT', 0), + ), + 'PRIMARY_KEY' => 'image_id', + 'KEYS' => array( + 'i_d' => array('INDEX', 'imageset_id'), + ), + ), + + $this->table_prefix . 'topics' => array( + 'COLUMNS' => array( + 'topic_id' => array('UINT', NULL, 'auto_increment'), + 'forum_id' => array('UINT', 0), + 'icon_id' => array('UINT', 0), + 'topic_attachment' => array('BOOL', 0), + 'topic_approved' => array('BOOL', 1), + 'topic_reported' => array('BOOL', 0), + 'topic_title' => array('XSTEXT_UNI', '', 'true_sort'), + 'topic_poster' => array('UINT', 0), + 'topic_time' => array('TIMESTAMP', 0), + 'topic_time_limit' => array('TIMESTAMP', 0), + 'topic_views' => array('UINT', 0), + 'topic_replies' => array('UINT', 0), + 'topic_replies_real' => array('UINT', 0), + 'topic_status' => array('TINT:3', 0), + 'topic_type' => array('TINT:3', 0), + 'topic_first_post_id' => array('UINT', 0), + 'topic_first_poster_name' => array('VCHAR_UNI', ''), + 'topic_first_poster_colour' => array('VCHAR:6', ''), + 'topic_last_post_id' => array('UINT', 0), + 'topic_last_poster_id' => array('UINT', 0), + 'topic_last_poster_name' => array('VCHAR_UNI', ''), + 'topic_last_poster_colour' => array('VCHAR:6', ''), + 'topic_last_post_subject' => array('XSTEXT_UNI', ''), + 'topic_last_post_time' => array('TIMESTAMP', 0), + 'topic_last_view_time' => array('TIMESTAMP', 0), + 'topic_moved_id' => array('UINT', 0), + 'topic_bumped' => array('BOOL', 0), + 'topic_bumper' => array('UINT', 0), + 'poll_title' => array('STEXT_UNI', ''), + 'poll_start' => array('TIMESTAMP', 0), + 'poll_length' => array('TIMESTAMP', 0), + 'poll_max_options' => array('TINT:4', 1), + 'poll_last_vote' => array('TIMESTAMP', 0), + 'poll_vote_change' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => 'topic_id', + 'KEYS' => array( + 'forum_id' => array('INDEX', 'forum_id'), + 'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')), + 'last_post_time' => array('INDEX', 'topic_last_post_time'), + 'topic_approved' => array('INDEX', 'topic_approved'), + 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_approved', 'topic_last_post_id')), + 'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')), + ), + ), + + $this->table_prefix . 'topics_track' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + 'forum_id' => array('UINT', 0), + 'mark_time' => array('TIMESTAMP', 0), + ), + 'PRIMARY_KEY' => array('user_id', 'topic_id'), + 'KEYS' => array( + 'forum_id' => array('INDEX', 'forum_id'), + ), + ), + + $this->table_prefix . 'topics_posted' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + 'topic_posted' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => array('user_id', 'topic_id'), + ), + + $this->table_prefix . 'topics_watch' => array( + 'COLUMNS' => array( + 'topic_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'notify_status' => array('BOOL', 0), + ), + 'KEYS' => array( + 'topic_id' => array('INDEX', 'topic_id'), + 'user_id' => array('INDEX', 'user_id'), + 'notify_stat' => array('INDEX', 'notify_status'), + ), + ), + + $this->table_prefix . 'user_group' => array( + 'COLUMNS' => array( + 'group_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'group_leader' => array('BOOL', 0), + 'user_pending' => array('BOOL', 1), + ), + 'KEYS' => array( + 'group_id' => array('INDEX', 'group_id'), + 'user_id' => array('INDEX', 'user_id'), + 'group_leader' => array('INDEX', 'group_leader'), + ), + ), + + $this->table_prefix . 'users' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', NULL, 'auto_increment'), + 'user_type' => array('TINT:2', 0), + 'group_id' => array('UINT', 3), + 'user_permissions' => array('MTEXT', ''), + 'user_perm_from' => array('UINT', 0), + 'user_ip' => array('VCHAR:40', ''), + 'user_regdate' => array('TIMESTAMP', 0), + 'username' => array('VCHAR_CI', ''), + 'username_clean' => array('VCHAR_CI', ''), + 'user_password' => array('VCHAR_UNI:40', ''), + 'user_passchg' => array('TIMESTAMP', 0), + 'user_pass_convert' => array('BOOL', 0), + 'user_email' => array('VCHAR_UNI:100', ''), + 'user_email_hash' => array('BINT', 0), + 'user_birthday' => array('VCHAR:10', ''), + 'user_lastvisit' => array('TIMESTAMP', 0), + 'user_lastmark' => array('TIMESTAMP', 0), + 'user_lastpost_time' => array('TIMESTAMP', 0), + 'user_lastpage' => array('VCHAR_UNI:200', ''), + 'user_last_confirm_key' => array('VCHAR:10', ''), + 'user_last_search' => array('TIMESTAMP', 0), + 'user_warnings' => array('TINT:4', 0), + 'user_last_warning' => array('TIMESTAMP', 0), + 'user_login_attempts' => array('TINT:4', 0), + 'user_inactive_reason' => array('TINT:2', 0), + 'user_inactive_time' => array('TIMESTAMP', 0), + 'user_posts' => array('UINT', 0), + 'user_lang' => array('VCHAR:30', ''), + 'user_timezone' => array('DECIMAL', 0), + 'user_dst' => array('BOOL', 0), + 'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'), + 'user_style' => array('USINT', 0), + 'user_rank' => array('UINT', 0), + 'user_colour' => array('VCHAR:6', ''), + 'user_new_privmsg' => array('INT:4', 0), + 'user_unread_privmsg' => array('INT:4', 0), + 'user_last_privmsg' => array('TIMESTAMP', 0), + 'user_message_rules' => array('BOOL', 0), + 'user_full_folder' => array('INT:11', -3), + 'user_emailtime' => array('TIMESTAMP', 0), + 'user_topic_show_days' => array('USINT', 0), + 'user_topic_sortby_type' => array('VCHAR:1', 't'), + 'user_topic_sortby_dir' => array('VCHAR:1', 'd'), + 'user_post_show_days' => array('USINT', 0), + 'user_post_sortby_type' => array('VCHAR:1', 't'), + 'user_post_sortby_dir' => array('VCHAR:1', 'a'), + 'user_notify' => array('BOOL', 0), + 'user_notify_pm' => array('BOOL', 1), + 'user_notify_type' => array('TINT:4', 0), + 'user_allow_pm' => array('BOOL', 1), + 'user_allow_viewonline' => array('BOOL', 1), + 'user_allow_viewemail' => array('BOOL', 1), + 'user_allow_massemail' => array('BOOL', 1), + 'user_options' => array('UINT:11', 895), + 'user_avatar' => array('VCHAR', ''), + 'user_avatar_type' => array('TINT:2', 0), + 'user_avatar_width' => array('USINT', 0), + 'user_avatar_height' => array('USINT', 0), + 'user_sig' => array('MTEXT_UNI', ''), + 'user_sig_bbcode_uid' => array('VCHAR:8', ''), + 'user_sig_bbcode_bitfield' => array('VCHAR:255', ''), + 'user_from' => array('VCHAR_UNI:100', ''), + 'user_icq' => array('VCHAR:15', ''), + 'user_aim' => array('VCHAR_UNI', ''), + 'user_yim' => array('VCHAR_UNI', ''), + 'user_msnm' => array('VCHAR_UNI', ''), + 'user_jabber' => array('VCHAR_UNI', ''), + 'user_website' => array('VCHAR_UNI:200', ''), + 'user_occ' => array('TEXT_UNI', ''), + 'user_interests' => array('TEXT_UNI', ''), + 'user_actkey' => array('VCHAR:32', ''), + 'user_newpasswd' => array('VCHAR_UNI:40', ''), + 'user_form_salt' => array('VCHAR_UNI:32', ''), + + ), + 'PRIMARY_KEY' => 'user_id', + 'KEYS' => array( + 'user_birthday' => array('INDEX', 'user_birthday'), + 'user_email_hash' => array('INDEX', 'user_email_hash'), + 'user_type' => array('INDEX', 'user_type'), + 'username_clean' => array('UNIQUE', 'username_clean'), + ), + ), + + $this->table_prefix . 'warnings' => array( + 'COLUMNS' => array( + 'warning_id' => array('UINT', NULL, 'auto_increment'), + 'user_id' => array('UINT', 0), + 'post_id' => array('UINT', 0), + 'log_id' => array('UINT', 0), + 'warning_time' => array('TIMESTAMP', 0), + ), + 'PRIMARY_KEY' => 'warning_id', + ), + + $this->table_prefix . 'words' => array( + 'COLUMNS' => array( + 'word_id' => array('UINT', NULL, 'auto_increment'), + 'word' => array('VCHAR_UNI', ''), + 'replacement' => array('VCHAR_UNI', ''), + ), + 'PRIMARY_KEY' => 'word_id', + ), + + $this->table_prefix . 'zebra' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'zebra_id' => array('UINT', 0), + 'friend' => array('BOOL', 0), + 'foe' => array('BOOL', 0), + ), + 'PRIMARY_KEY' => array('user_id', 'zebra_id'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'attachments', + $this->table_prefix . 'acl_groups', + $this->table_prefix . 'acl_options', + $this->table_prefix . 'acl_roles', + $this->table_prefix . 'acl_roles_data', + $this->table_prefix . 'acl_users', + $this->table_prefix . 'banlist', + $this->table_prefix . 'bbcodes', + $this->table_prefix . 'bookmarks', + $this->table_prefix . 'bots', + $this->table_prefix . 'config', + $this->table_prefix . 'confirm', + $this->table_prefix . 'disallow', + $this->table_prefix . 'drafts', + $this->table_prefix . 'extensions', + $this->table_prefix . 'extension_groups', + $this->table_prefix . 'forums', + $this->table_prefix . 'forums_access', + $this->table_prefix . 'forums_track', + $this->table_prefix . 'forums_watch', + $this->table_prefix . 'groups', + $this->table_prefix . 'icons', + $this->table_prefix . 'lang', + $this->table_prefix . 'log', + $this->table_prefix . 'moderator_cache', + $this->table_prefix . 'modules', + $this->table_prefix . 'poll_options', + $this->table_prefix . 'poll_votes', + $this->table_prefix . 'posts', + $this->table_prefix . 'privmsgs', + $this->table_prefix . 'privmsgs_folder', + $this->table_prefix . 'privmsgs_rules', + $this->table_prefix . 'privmsgs_to', + $this->table_prefix . 'profile_fields', + $this->table_prefix . 'profile_fields_data', + $this->table_prefix . 'profile_fields_lang', + $this->table_prefix . 'profile_lang', + $this->table_prefix . 'ranks', + $this->table_prefix . 'reports', + $this->table_prefix . 'reports_reasons', + $this->table_prefix . 'search_results', + $this->table_prefix . 'search_wordlist', + $this->table_prefix . 'search_wordmatch', + $this->table_prefix . 'sessions', + $this->table_prefix . 'sessions_keys', + $this->table_prefix . 'sitelist', + $this->table_prefix . 'smilies', + $this->table_prefix . 'styles', + $this->table_prefix . 'styles_template', + $this->table_prefix . 'styles_template_data', + $this->table_prefix . 'styles_theme', + $this->table_prefix . 'styles_imageset', + $this->table_prefix . 'styles_imageset_data', + $this->table_prefix . 'topics', + $this->table_prefix . 'topics_track', + $this->table_prefix . 'topics_posted', + $this->table_prefix . 'topics_watch', + $this->table_prefix . 'user_group', + $this->table_prefix . 'users', + $this->table_prefix . 'warnings', + $this->table_prefix . 'words', + $this->table_prefix . 'zebra', + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/dev.php b/phpBB/phpbb/db/migration/data/v310/dev.php index c1db883616..83611d3731 100644 --- a/phpBB/phpbb/db/migration/data/v310/dev.php +++ b/phpBB/phpbb/db/migration/data/v310/dev.php @@ -23,6 +23,7 @@ class dev extends \phpbb\db\migration\migration '\phpbb\db\migration\data\v310\style_update_p2', '\phpbb\db\migration\data\v310\timezone_p2', '\phpbb\db\migration\data\v310\reported_posts_display', + '\phpbb\db\migration\data\v310\migrations_table', ); } diff --git a/phpBB/phpbb/db/migration/data/v310/migrations_table.php b/phpBB/phpbb/db/migration/data/v310/migrations_table.php new file mode 100644 index 0000000000..e70fd35819 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/migrations_table.php @@ -0,0 +1,47 @@ +<?php +/** +* +* @package migration +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +namespace phpbb\db\migration\data\v310; + +class migrations_table extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_table_exists($this->table_prefix . 'migrations'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'migrations' => array( + 'COLUMNS' => array( + 'migration_name' => array('VCHAR', ''), + 'migration_depends_on' => array('TEXT', ''), + 'migration_schema_done' => array('BOOL', 0), + 'migration_data_done' => array('BOOL', 0), + 'migration_data_state' => array('TEXT', ''), + 'migration_start_time' => array('TIMESTAMP', 0), + 'migration_end_time' => array('TIMESTAMP', 0), + ), + 'PRIMARY_KEY' => 'migration_name', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'migrations', + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/schema_generator.php b/phpBB/phpbb/db/migration/schema_generator.php new file mode 100644 index 0000000000..a7e2fa8f06 --- /dev/null +++ b/phpBB/phpbb/db/migration/schema_generator.php @@ -0,0 +1,179 @@ +<?php +/** +* +* @package db +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +namespace phpbb\db\migration; + +/** +* The schema generator generates the schema based on the existing migrations +* +* @package db +*/ +class schema_generator +{ + /** @var \phpbb\config\config */ + protected $config; + + /** @var \phpbb\db\driver\driver */ + protected $db; + + /** @var \phpbb\db\tools */ + protected $db_tools; + + /** @var array */ + protected $class_names; + + /** @var string */ + protected $table_prefix; + + /** @var string */ + protected $phpbb_root_path; + + /** @var string */ + protected $php_ext; + + /** @var array */ + protected $tables; + + /** + * Constructor + */ + public function __construct(array $class_names, \phpbb\config\config $config, \phpbb\db\driver\driver $db, \phpbb\db\tools $db_tools, $phpbb_root_path, $php_ext, $table_prefix) + { + $this->config = $config; + $this->db = $db; + $this->db_tools = $db_tools; + $this->class_names = $class_names; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->table_prefix = $table_prefix; + } + + /** + * Loads all migrations and their application state from the database. + * + * @return array + */ + public function get_schema() + { + if (!empty($this->tables)) + { + return $this->tables; + } + + $migrations = $this->class_names; + + $tree = array(); + while (!empty($migrations)) + { + foreach ($migrations as $migration_class) + { + $open_dependencies = array_diff($migration_class::depends_on(), $tree); + if (empty($open_dependencies)) + { + $migration = new $migration_class($this->config, $this->db, $this->db_tools, $this->phpbb_root_path, $this->php_ext, $this->table_prefix); + $tree[] = $migration_class; + $migration_key = array_search($migration_class, $migrations); + + foreach ($migration->update_schema() as $change_type => $data) + { + if ($change_type === 'add_tables') + { + foreach ($data as $table => $table_data) + { + $this->tables[$table] = $table_data; + } + } + else if ($change_type === 'drop_tables') + { + foreach ($data as $table) + { + unset($this->tables[$table]); + } + } + else if ($change_type === 'add_columns') + { + foreach ($data as $table => $add_columns) + { + foreach ($add_columns as $column => $column_data) + { + $this->tables[$table]['COLUMNS'][$column] = $column_data; + } + } + } + else if ($change_type === 'change_columns') + { + foreach ($data as $table => $change_columns) + { + foreach ($change_columns as $column => $column_data) + { + $this->tables[$table]['COLUMNS'][$column] = $column_data; + } + } + } + else if ($change_type === 'drop_columns') + { + foreach ($data as $table => $drop_columns) + { + if (is_array($drop_columns)) + { + foreach ($drop_columns as $column) + { + unset($this->tables[$table]['COLUMNS'][$column]); + } + } + else + { + unset($this->tables[$table]['COLUMNS'][$drop_columns]); + } + } + } + else if ($change_type === 'add_unique_index') + { + foreach ($data as $table => $add_index) + { + foreach ($add_index as $key => $index_data) + { + $this->tables[$table]['KEYS'][$key] = array('UNIQUE', $index_data); + } + } + } + else if ($change_type === 'add_index') + { + foreach ($data as $table => $add_index) + { + foreach ($add_index as $key => $index_data) + { + $this->tables[$table]['KEYS'][$key] = array('INDEX', $index_data); + } + } + } + else if ($change_type === 'drop_keys') + { + foreach ($data as $table => $drop_keys) + { + foreach ($drop_keys as $key) + { + unset($this->tables[$table]['KEYS'][$key]); + } + } + } + else + { + var_dump($change_type); + } + } + unset($migrations[$migration_key]); + } + } + } + + ksort($this->tables); + return $this->tables; + } +} diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php index 23d6910843..4b12abd62a 100644 --- a/tests/auth/provider_apache_test.php +++ b/tests/auth/provider_apache_test.php @@ -161,7 +161,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case 'user_inactive_time' => '0', 'user_posts' => '0', 'user_lang' => '', - 'user_timezone' => 'UTC', + 'user_timezone' => '', 'user_dateformat' => 'd M Y H:i', 'user_style' => '0', 'user_rank' => '0', diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php index 4c2e9ff600..aacdb1bef4 100644 --- a/tests/test_framework/phpbb_database_test_case.php +++ b/tests/test_framework/phpbb_database_test_case.php @@ -138,7 +138,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test if (!self::$already_connected) { - $manager->load_schema(); + $manager->load_schema($this->new_dbal()); self::$already_connected = true; } diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php index af9bd22662..5d8dae4a30 100644 --- a/tests/test_framework/phpbb_database_test_connection_manager.php +++ b/tests/test_framework/phpbb_database_test_connection_manager.php @@ -169,12 +169,12 @@ class phpbb_database_test_connection_manager /** * Load the phpBB database schema into the database */ - public function load_schema() + public function load_schema($db) { $this->ensure_connected(__METHOD__); $directory = dirname(__FILE__) . '/../../phpBB/install/schemas/'; - $this->load_schema_from_file($directory); + $this->load_schema_from_file($directory, $db); } /** @@ -321,7 +321,7 @@ class phpbb_database_test_connection_manager * Compile the correct schema filename (as per create_schema_files) and * load it into the database. */ - protected function load_schema_from_file($directory) + protected function load_schema_from_file($directory, \phpbb\db\driver\driver $db) { $schema = $this->dbms['SCHEMA']; @@ -351,6 +351,23 @@ class phpbb_database_test_connection_manager { $this->pdo->exec($query); } + + // Ok we have the db info go ahead and work on building the table + $db_table_schema = file_get_contents($directory . 'schema.json'); + $db_table_schema = json_decode($db_table_schema, true); + + $db_tools = new \phpbb\db\tools($db, true); + foreach ($db_table_schema as $table_name => $table_data) + { + $queries = $db_tools->sql_create_table( + $table_name, + $table_data + ); + foreach ($queries as $query) + { + $this->pdo->exec($query); + } + } } /** |