diff options
38 files changed, 3502 insertions, 3425 deletions
diff --git a/phpBB/adm/style/acp_permission_roles.html b/phpBB/adm/style/acp_permission_roles.html index ca50fed187..b24312d21d 100644 --- a/phpBB/adm/style/acp_permission_roles.html +++ b/phpBB/adm/style/acp_permission_roles.html @@ -112,15 +112,15 @@ <tr> <!-- BEGIN auth --> <!-- IF auth.S_YES --> - <td class="preset_yes"> + <td class="preset preset_yes"> <!-- ELSEIF auth.S_NO --> - <td class="preset_no"> + <td class="preset preset_no"> <!-- ELSEIF auth.S_UNSET --> - <td class="preset_unset"> + <td class="preset preset_unset"> <!-- ELSE --> - <td class="preset_custom"> + <td class="preset preset_custom"> <!-- ENDIF --> - <a href="javascript:swap_options('options{auth.S_ROW_COUNT}');"><span> </span></a></td> + <a href="javascript:swap_options('options{auth.S_ROW_COUNT}');"><span></span></a></td> <!-- END auth --> </tr> <tr class="row3"> diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 306f11ad8a..9defc15717 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -524,7 +524,7 @@ class acp_forums $s_show_display_on_index = false; - if ($action == 'edit' && $forum_data['parent_id'] > 0) + if ($forum_data['parent_id'] > 0) { // if this forum is a subforum put the "display on index" checkbox if ($parent_info = $this->get_forum_info($forum_data['parent_id'])) diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 2d855c0c08..e46a3ffaca 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -40,8 +40,8 @@ class acp_permissions $subforum_id = request_var('subforum_id', 0); $forum_id = request_var('forum_id', array(0)); - $username = request_var('username', array('')); - $usernames = request_var('usernames', ''); + $username = request_var('username', array(''), true); + $usernames = request_var('usernames', '', true); $user_id = request_var('user_id', array(0)); $group_id = request_var('group_id', array(0)); diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index f263f7480f..913b338ad1 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -214,7 +214,7 @@ class acp_prune } else { - $username = request_var('username', ''); + $username = request_var('username', '', true); $email = request_var('email', ''); $joined_select = request_var('joined_select', 'lt'); @@ -315,7 +315,7 @@ class acp_prune 'prune' => 1, 'users' => request_var('users', ''), - 'username' => request_var('username', ''), + 'username' => request_var('username', '', true), 'email' => request_var('email', ''), 'joined_select' => request_var('joined_select', ''), 'joined' => request_var('joined', ''), diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 89038ff2e6..29572b7147 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -28,7 +28,7 @@ class acp_users include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); $error = array(); - $username = request_var('username', ''); + $username = request_var('username', '', true); $user_id = request_var('u', 0); $action = request_var('action', ''); diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php index 35a5a6a87c..1431171f19 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -311,7 +311,7 @@ class dbal_oracle extends dbal { if (preg_match('#^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)#is', $this->last_query_text, $tablename)) { - $query = 'SELECT ' . $tablename[1] . '_id_seq.currval FROM DUAL'; + $query = 'SELECT ' . $tablename[1] . '_seq.currval FROM DUAL'; $stmt = @ociparse($this->db_connect_id, $query); @ociexecute($stmt, OCI_DEFAULT ); diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index d4ec19d421..55f4e27eff 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -295,7 +295,7 @@ class dbal_postgres extends dbal { if (preg_match("/^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)/is", $this->last_query_text, $tablename)) { - $query = "SELECT currval('" . $tablename[1] . "_id_seq') AS last_value"; + $query = "SELECT currval('" . $tablename[1] . "_seq') AS last_value"; $temp_q_id = @pg_query($this->db_connect_id, $query); if (!$temp_q_id) { diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 0a6bf8d126..52e0ab7cee 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -24,10 +24,13 @@ function set_var(&$result, $var, $type, $multibyte = false) if ($type == 'string') { - $result = trim(htmlspecialchars(str_replace(array("\r\n", "\r", "\xFF"), array("\n", "\n", ' '), $result))); + $result = trim(htmlspecialchars(str_replace(array("\r\n", "\r"), array("\n", "\n"), $result))); $result = (STRIP) ? stripslashes($result) : $result; - if ($multibyte) + + // Check for possible multibyte characters to save a preg_replace call if nothing is in there... + if ($multibyte && strpos($result, '&#') !== false) { + echo "HERE"; $result = preg_replace('#&(\#[0-9]+;)#', '&\1', $result); } } @@ -1387,7 +1390,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa if (isset($_POST['login'])) { - $username = request_var('username', ''); + $username = request_var('username', '', true); $password = request_var('password', ''); $autologin = (!empty($_POST['autologin'])) ? true : false; $viewonline = (!empty($_POST['viewonline'])) ? 0 : 1; @@ -2510,7 +2513,7 @@ function page_header($page_title = '') 'L_INDEX' => $user->lang['FORUM_INDEX'], 'L_ONLINE_EXPLAIN' => $l_online_time, - 'U_PRIVATEMSGS' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=" . (($user->data['user_new_privmsg'] || $l_privmsgs_text_unread) ? 'unread' : 'view'), + 'U_PRIVATEMSGS' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox", 'U_RETURN_INBOX' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox", 'U_JS_RETURN_INBOX' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox", 'U_POPUP_PM' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=popup", diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 261cbe3f45..33afcc4920 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1845,7 +1845,7 @@ function cache_moderators() 'user_id' => $user_id, 'username' => $usernames_ary[$user_id], 'group_id' => 0, - 'groupname' => '' + 'group_name' => '' ); } } @@ -1886,7 +1886,7 @@ function cache_moderators() 'user_id' => 0, 'username' => '', 'group_id' => $group_id, - 'groupname' => $groupnames_ary[$group_id] + 'group_name' => $groupnames_ary[$group_id] ); } } diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 5f4f8ed5f6..7384217c31 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -563,7 +563,7 @@ function get_moderators(&$forum_moderators, $forum_id = false) while ($row = $db->sql_fetchrow($result)) { - $forum_moderators[$row['forum_id']][] = (!empty($row['user_id'])) ? '<a href="' . $phpbb_root_path . "memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'] . '">' . $row['username'] . '</a>' : '<a href="' . $phpbb_root_path . "memberlist.$phpEx$SID&mode=group&g=" . $row['group_id'] . '">' . $row['groupname'] . '</a>'; + $forum_moderators[$row['forum_id']][] = (!empty($row['user_id'])) ? '<a href="' . $phpbb_root_path . "memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'] . '">' . $row['username'] . '</a>' : '<a href="' . $phpbb_root_path . "memberlist.$phpEx$SID&mode=group&g=" . $row['group_id'] . '">' . $row['group_name'] . '</a>'; } $db->sql_freeresult($result); diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 74c3037bf0..c106d4d717 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -145,7 +145,7 @@ class messenger // assign variables function assign_vars($vars) { - $this->vars = (empty($this->vars)) ? $vars : $this->vars . $vars; + $this->vars = (empty($this->vars)) ? $vars : $this->vars + $vars; } // Send the mail out to the recipients set previously in var $this->address @@ -209,14 +209,16 @@ class messenger { case NOTIFY_EMAIL: $result = $this->msg_email(); - break; + break; + case NOTIFY_IM: $result = $this->msg_jabber(); - break; + break; + case NOTIFY_BOTH: $result = $this->msg_email(); $this->msg_jabber(); - break; + break; } $this->reset(); @@ -394,7 +396,7 @@ class messenger foreach ($addresses as $address) { - $this->jabber->send_message($address, 'normal', NULL, array('body' => $this->msg)); + $this->jabber->send_message($address, 'normal', NULL, array('body' => htmlentities($this->msg))); } sleep(1); @@ -490,7 +492,7 @@ class queue unset($this->queue_data['email']); continue 2; } - break; + break; case 'jabber': if (!$config['jab_enable']) @@ -520,7 +522,8 @@ class queue continue 2; } $this->jabber->send_presence(NULL, NULL, 'online'); - break; + + break; default: return; @@ -547,14 +550,14 @@ class queue messenger::error('EMAIL', $message); continue 3; } - break; + break; case 'jabber': foreach ($addresses as $address) { $this->jabber->send_message($address, 'normal', NULL, array('body' => $msg)); } - break; + break; } } @@ -572,7 +575,7 @@ class queue // handled, then disconnect sleep(1); $this->jabber->disconnect(); - break; + break; } } diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index fe314eaac0..f77e65f003 100755 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -116,7 +116,7 @@ class mcp_logs 'TOTAL_LOGS' => ($log_count == 1) ? $user->lang['TOTAL_LOG'] : sprintf($user->lang['TOTAL_LOGS'], $log_count), 'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param", $log_count, $config['topics_per_page'], $start, true), - 'U_POST_ACTION' => "mcp.$phpEx$SID&i=$id&mode=$mode&u=$user_id", + 'U_POST_ACTION' => $this->u_action, 'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false, 'S_SELECT_SORT_DIR' => $s_sort_dir, 'S_SELECT_SORT_KEY' => $s_sort_key, diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index c1620f778e..b8280d4a9b 100755 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -64,7 +64,7 @@ function mcp_notes_user_view($id, $mode, $action) global $template, $db, $user, $auth; $user_id = request_var('u', 0); - $username = request_var('username', ''); + $username = request_var('username', '', true); $start = request_var('start', 0); $st = request_var('st', 0); $sk = request_var('sk', 'b'); diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 3880f036a8..3d9e743d9c 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -52,7 +52,7 @@ function mcp_post_details($id, $mode, $action) case 'chgposter': - $username = request_var('username', ''); + $username = request_var('username', '', true); $sql = 'SELECT user_id FROM ' . USERS_TABLE . ' diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 6b6e809930..fd75a86d21 100755 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -300,7 +300,7 @@ function mcp_warn_user_view($id, $mode, $action) global $template, $db, $user, $auth; $user_id = request_var('u', 0); - $username = request_var('username', ''); + $username = request_var('username', '', true); $notify = (isset($_REQUEST['notify_user'])) ? true : false; $warning = request_var('warning', '', true); diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index b6d95c0e9f..30e4c06f77 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -846,8 +846,8 @@ function handle_message_list_actions(&$address_list, $remove_u, $remove_g, $add_ $user_id_ary = array(); // Build usernames to add - $usernames = (isset($_REQUEST['username'])) ? array(request_var('username', '')) : array(); - $username_list = request_var('username_list', ''); + $usernames = (isset($_REQUEST['username'])) ? array(request_var('username', '', true)) : array(); + $username_list = request_var('username_list', '', true); if ($username_list) { $usernames = array_merge($usernames, explode("\n", $username_list)); diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index 17839ae674..dbc02d2a4a 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -151,7 +151,7 @@ function view_folder($id, $mode, $folder_id, $folder) // Generate all URIs ... $message_author = "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['author_id'] . '">' . $row['username'] . '</a>'; $view_message_url = "$url&i=$id&mode=view&f=$folder_id&p=$message_id"; - $remove_message_url = "$url&i=compose&action=delete&p=$message_id"; + $remove_message_url = "$url&i=$id&mode=compose&action=delete&p=$message_id"; $row_indicator = ''; foreach ($color_rows as $var) diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 200692d459..d8bfcc3ec7 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -201,10 +201,14 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) 'S_DISPLAY_NOTICE' => $display_notice && $message_row['message_attachment'], 'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '', - 'U_EMAIL_PM' => ($config['email_pm'] && $config['email_enable'] && $auth->acl_get('u_pm_emailpm')) ? 'Email' : '', + 'U_EMAIL_PM' => ($config['email_pm'] && $config['email_enable'] && $auth->acl_get('u_pm_emailpm')) ? '' : '', 'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '') ); + /** + * @todo U_EMAIL_PM add ability to send PM's by email + */ + // Display not already displayed Attachments for this post, we already parsed them. ;) if (isset($attachments) && sizeof($attachments)) { diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index b2a2d6d878..5e69e927a6 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -341,7 +341,9 @@ class ucp_profile $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error); } - if (!isset($bday_day)) + $bday_day = $bday_month = $bday_year = 0; + + if ($user->data['user_birthday']) { list($bday_day, $bday_month, $bday_year) = explode('-', $user->data['user_birthday']); } @@ -476,7 +478,27 @@ class ucp_profile 'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'], 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'],) ); - break; + + // Build custom bbcodes array + $sql = 'SELECT bbcode_id, bbcode_tag + FROM ' . BBCODES_TABLE . ' + WHERE display_on_posting = 1'; + $result = $db->sql_query($sql); + + $i = 0; + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('custom_tags', array( + 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'", + 'BBCODE_ID' => 22 + ($i * 2), + 'BBCODE_TAG' => $row['bbcode_tag']) + ); + + $i++; + } + $db->sql_freeresult($result); + + break; case 'avatar': diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 5970ac4d99..4b1aa41f25 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -99,7 +99,7 @@ class ucp_register { foreach ($var_ary as $var => $default) { - $$var = request_var($var, $default); + $$var = request_var($var, $default, true); } } @@ -108,7 +108,7 @@ class ucp_register { foreach ($var_ary as $var => $default) { - $data[$var] = request_var($var, $default); + $data[$var] = request_var($var, $default, true); } $var_ary = array( diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php index 7308d9b9f8..6b2c6240ae 100644 --- a/phpBB/includes/ucp/ucp_remind.php +++ b/phpBB/includes/ucp/ucp_remind.php @@ -23,7 +23,7 @@ class ucp_remind if ($submit) { - $username = request_var('username', ''); + $username = request_var('username', '', true); $email = request_var('email', ''); $sql = 'SELECT user_id, username, user_email, user_jabber, user_notify_type, user_type, user_lang diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php index 35cbed1522..8c2b55a04f 100644 --- a/phpBB/includes/ucp/ucp_resend.php +++ b/phpBB/includes/ucp/ucp_resend.php @@ -23,7 +23,7 @@ class ucp_resend if ($submit) { - $username = request_var('username', ''); + $username = request_var('username', '', true); $email = request_var('email', ''); $sql = 'SELECT user_id, username, user_email, user_type, user_lang, user_actkey diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index d86644a12d..d395704a62 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -13,7 +13,7 @@ CREATE TABLE phpbb_attachments ( physical_filename VARCHAR(255) NOT NULL, real_filename VARCHAR(255) NOT NULL, download_count INTEGER DEFAULT 0 NOT NULL, - comment VARCHAR(255), + comment BLOB SUB_TYPE TEXT, extension VARCHAR(100), mimetype VARCHAR(100), filesize INTEGER DEFAULT 0 NOT NULL, @@ -21,6 +21,25 @@ CREATE TABLE phpbb_attachments ( thumbnail INTEGER DEFAULT 0 NOT NULL );; +ALTER TABLE phpbb_attachments ADD PRIMARY KEY (attach_id);; + +CREATE INDEX phpbb_attachments_filesize ON phpbb_attachments(filesize);; +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_poster_id ON phpbb_attachments(poster_id);; +CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments(topic_id);; + +CREATE GENERATOR phpbb_attachments_gen;; +SET GENERATOR phpbb_attachments_gen TO 0;; + +CREATE TRIGGER t_phpbb_attachments_gen FOR phpbb_attachments +BEFORE INSERT +AS +BEGIN + NEW.attach_id = GEN_ID(phpbb_attachments_gen, 1); +END;; + + # phpbb_auth_groups CREATE TABLE phpbb_auth_groups ( group_id INTEGER DEFAULT 0 NOT NULL, @@ -30,6 +49,10 @@ CREATE TABLE phpbb_auth_groups ( auth_setting INTEGER DEFAULT 0 NOT NULL );; +CREATE INDEX phpbb_auth_groups_auth_option_id ON phpbb_auth_groups(auth_option_id);; +CREATE INDEX phpbb_auth_groups_group_id ON phpbb_auth_groups(group_id);; + + # phpbb_auth_options CREATE TABLE phpbb_auth_options ( auth_option_id INTEGER NOT NULL, @@ -39,14 +62,44 @@ CREATE TABLE phpbb_auth_options ( founder_only INTEGER DEFAULT 0 NOT NULL );; +ALTER TABLE phpbb_auth_options ADD PRIMARY KEY (auth_option_id);; + +CREATE INDEX phpbb_auth_options_auth_option ON phpbb_auth_options(auth_option);; + +CREATE GENERATOR phpbb_auth_options_gen;; +SET GENERATOR phpbb_auth_options_gen TO 0;; + +CREATE TRIGGER t_phpbb_auth_options_gen FOR phpbb_auth_options +BEFORE INSERT +AS +BEGIN + NEW.auth_option_id = GEN_ID(phpbb_auth_options_gen, 1); +END;; + + # phpbb_auth_roles CREATE TABLE phpbb_auth_roles ( role_id INTEGER NOT NULL, - role_name VARCHAR(50) NOT NULL, + role_name VARCHAR(255) NOT NULL, role_type VARCHAR(10) NOT NULL, role_group_ids VARCHAR(255) NOT NULL );; +ALTER TABLE phpbb_auth_roles ADD PRIMARY KEY (role_id);; + +CREATE INDEX phpbb_auth_roles_role_type ON phpbb_auth_roles(role_type);; + +CREATE GENERATOR phpbb_auth_roles_gen;; +SET GENERATOR phpbb_auth_roles_gen TO 0;; + +CREATE TRIGGER t_phpbb_auth_roles_gen FOR phpbb_auth_roles +BEFORE INSERT +AS +BEGIN + NEW.role_id = GEN_ID(phpbb_auth_roles_gen, 1); +END;; + + # phpbb_auth_roles_data CREATE TABLE phpbb_auth_roles_data ( role_id INTEGER DEFAULT 0 NOT NULL, @@ -54,6 +107,9 @@ CREATE TABLE phpbb_auth_roles_data ( auth_setting INTEGER DEFAULT 0 NOT NULL );; +ALTER TABLE phpbb_auth_roles_data ADD PRIMARY KEY (role_id, auth_option_id);; + + # phpbb_auth_users CREATE TABLE phpbb_auth_users ( user_id INTEGER DEFAULT 0 NOT NULL, @@ -63,32 +119,53 @@ CREATE TABLE phpbb_auth_users ( auth_setting INTEGER DEFAULT 0 NOT NULL );; +CREATE INDEX phpbb_auth_users_auth_option_id ON phpbb_auth_users(auth_option_id);; +CREATE INDEX phpbb_auth_users_user_id ON phpbb_auth_users(user_id);; + + # phpbb_banlist CREATE TABLE phpbb_banlist ( ban_id INTEGER NOT NULL, ban_userid INTEGER DEFAULT 0 NOT NULL, ban_ip VARCHAR(40) NOT NULL, - ban_email VARCHAR(50) NOT NULL, + ban_email VARCHAR(100) NOT NULL, 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) NOT NULL, - ban_give_reason VARCHAR(255) NOT NULL + ban_reason BLOB SUB_TYPE TEXT, + ban_give_reason BLOB SUB_TYPE TEXT );; +ALTER TABLE phpbb_banlist ADD PRIMARY KEY (ban_id);; + +CREATE GENERATOR phpbb_banlist_gen;; +SET GENERATOR phpbb_banlist_gen TO 0;; + +CREATE TRIGGER t_phpbb_banlist_gen FOR phpbb_banlist +BEFORE INSERT +AS +BEGIN + NEW.ban_id = GEN_ID(phpbb_banlist_gen, 1); +END;; + # phpbb_bbcodes CREATE TABLE phpbb_bbcodes ( bbcode_id INTEGER DEFAULT 0 NOT NULL, bbcode_tag VARCHAR(16) NOT NULL, display_on_posting INTEGER DEFAULT 0 NOT NULL, bbcode_match VARCHAR(255) NOT NULL, - bbcode_tpl BLOB SUB_TYPE TEXT NOT NULL, + bbcode_tpl BLOB SUB_TYPE TEXT, first_pass_match VARCHAR(255) NOT NULL, first_pass_replace VARCHAR(255) NOT NULL, second_pass_match VARCHAR(255) NOT NULL, - second_pass_replace BLOB SUB_TYPE TEXT NOT NULL + second_pass_replace BLOB SUB_TYPE TEXT );; +ALTER TABLE phpbb_bbcodes ADD PRIMARY KEY (bbcode_id);; + +CREATE INDEX phpbb_bbcodes_display_on_posting ON phpbb_bbcodes(display_on_posting);; + + # phpbb_bookmarks CREATE TABLE phpbb_bookmarks ( topic_id INTEGER DEFAULT 0 NOT NULL, @@ -96,23 +173,45 @@ CREATE TABLE phpbb_bookmarks ( order_id INTEGER DEFAULT 0 NOT NULL );; +CREATE INDEX phpbb_bookmarks_order_id ON phpbb_bookmarks(order_id);; +CREATE INDEX phpbb_bookmarks_topic_user_id ON phpbb_bookmarks(topic_id, user_id);; + + # phpbb_bots CREATE TABLE phpbb_bots ( bot_id INTEGER NOT NULL, bot_active INTEGER DEFAULT 1 NOT NULL, - bot_name VARCHAR(255) NOT NULL, + bot_name BLOB SUB_TYPE TEXT, user_id INTEGER DEFAULT 0 NOT NULL, bot_agent VARCHAR(255) NOT NULL, bot_ip VARCHAR(255) 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_gen FOR phpbb_bots +BEFORE INSERT +AS +BEGIN + NEW.bot_id = GEN_ID(phpbb_bots_gen, 1); +END;; + + # phpbb_cache CREATE TABLE phpbb_cache ( - var_name VARCHAR(200) NOT NULL, + var_name VARCHAR(255) NOT NULL, var_expires INTEGER DEFAULT 0 NOT NULL, - var_data BLOB SUB_TYPE TEXT NOT NULL + var_data BLOB SUB_TYPE TEXT );; +ALTER TABLE phpbb_cache ADD PRIMARY KEY (var_name);; + + # phpbb_config CREATE TABLE phpbb_config ( config_name VARCHAR(200) NOT NULL, @@ -120,6 +219,11 @@ CREATE TABLE phpbb_config ( 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);; + + # phpbb_confirm CREATE TABLE phpbb_confirm ( confirm_id VARCHAR(32) NOT NULL, @@ -128,12 +232,28 @@ CREATE TABLE phpbb_confirm ( code VARCHAR(8) NOT NULL );; +ALTER TABLE phpbb_confirm ADD PRIMARY KEY (session_id, confirm_id);; + + # phpbb_disallow CREATE TABLE phpbb_disallow ( disallow_id INTEGER NOT NULL, - disallow_username VARCHAR(30) NOT NULL + disallow_username VARCHAR(255) NOT NULL );; +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_gen FOR phpbb_disallow +BEFORE INSERT +AS +BEGIN + NEW.disallow_id = GEN_ID(phpbb_disallow_gen, 1); +END;; + + # phpbb_drafts CREATE TABLE phpbb_drafts ( draft_id INTEGER NOT NULL, @@ -141,23 +261,51 @@ CREATE TABLE phpbb_drafts ( topic_id INTEGER DEFAULT 0 NOT NULL, forum_id INTEGER DEFAULT 0 NOT NULL, save_time INTEGER DEFAULT 0 NOT NULL, - draft_subject VARCHAR(60), - draft_message BLOB SUB_TYPE TEXT NOT NULL + draft_subject BLOB SUB_TYPE TEXT, + draft_message BLOB SUB_TYPE TEXT );; +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_gen FOR phpbb_drafts +BEFORE INSERT +AS +BEGIN + NEW.draft_id = GEN_ID(phpbb_drafts_gen, 1); +END;; + + # phpbb_extension_groups CREATE TABLE phpbb_extension_groups ( group_id INTEGER NOT NULL, - group_name VARCHAR(20) NOT NULL, + group_name VARCHAR(255) NOT NULL, cat_id INTEGER DEFAULT 0 NOT NULL, allow_group INTEGER DEFAULT 0 NOT NULL, download_mode INTEGER DEFAULT 1 NOT NULL, - upload_icon VARCHAR(100) NOT NULL, + upload_icon VARCHAR(255) NOT NULL, max_filesize INTEGER DEFAULT 0 NOT NULL, - allowed_forums BLOB SUB_TYPE TEXT NOT NULL, + allowed_forums BLOB SUB_TYPE TEXT, 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_gen FOR phpbb_extension_groups +BEFORE INSERT +AS +BEGIN + NEW.group_id = GEN_ID(phpbb_extension_groups_gen, 1); +END;; + + # phpbb_extensions CREATE TABLE phpbb_extensions ( extension_id INTEGER NOT NULL, @@ -165,12 +313,18 @@ CREATE TABLE phpbb_extensions ( extension VARCHAR(100) NOT NULL );; -# phpbb_forum_access -CREATE TABLE phpbb_forum_access ( - forum_id INTEGER DEFAULT 0 NOT NULL, - user_id INTEGER DEFAULT 0 NOT NULL, - session_id VARCHAR(32) 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_gen FOR phpbb_extensions +BEFORE INSERT +AS +BEGIN + NEW.extension_id = GEN_ID(phpbb_extensions_gen, 1); +END;; + # phpbb_forums CREATE TABLE phpbb_forums ( @@ -179,16 +333,16 @@ CREATE TABLE phpbb_forums ( left_id INTEGER DEFAULT 0 NOT NULL, right_id INTEGER DEFAULT 0 NOT NULL, forum_parents BLOB SUB_TYPE TEXT, - forum_name VARCHAR(150) NOT NULL, + forum_name BLOB SUB_TYPE TEXT, forum_desc BLOB SUB_TYPE TEXT, forum_desc_bitfield INTEGER DEFAULT 0 NOT NULL, forum_desc_uid VARCHAR(5) NOT NULL, - forum_link VARCHAR(200) NOT NULL, - forum_password VARCHAR(32) NOT NULL, + forum_link VARCHAR(255) NOT NULL, + forum_password VARCHAR(40) NOT NULL, forum_style INTEGER, - forum_image VARCHAR(50) NOT NULL, - forum_rules BLOB SUB_TYPE TEXT NOT NULL, - forum_rules_link VARCHAR(200) NOT NULL, + forum_image VARCHAR(255) NOT NULL, + forum_rules BLOB SUB_TYPE TEXT, + forum_rules_link VARCHAR(255) NOT NULL, forum_rules_bitfield INTEGER DEFAULT 0 NOT NULL, forum_rules_uid VARCHAR(5) NOT NULL, forum_topics_per_page INTEGER DEFAULT 0 NOT NULL, @@ -200,7 +354,7 @@ CREATE TABLE phpbb_forums ( forum_last_post_id INTEGER DEFAULT 0 NOT NULL, forum_last_poster_id INTEGER DEFAULT 0 NOT NULL, forum_last_post_time INTEGER DEFAULT 0 NOT NULL, - forum_last_poster_name VARCHAR(30), + forum_last_poster_name VARCHAR(255), forum_flags INTEGER DEFAULT 0 NOT NULL, display_on_index INTEGER DEFAULT 1 NOT NULL, enable_indexing INTEGER DEFAULT 1 NOT NULL, @@ -212,6 +366,32 @@ CREATE TABLE phpbb_forums ( prune_freq INTEGER DEFAULT 0 NOT NULL );; +ALTER TABLE phpbb_forums ADD PRIMARY KEY (forum_id);; + +CREATE INDEX phpbb_forums_forum_last_post_id ON phpbb_forums(forum_last_post_id);; +CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums(left_id, right_id);; + +CREATE GENERATOR phpbb_forums_gen;; +SET GENERATOR phpbb_forums_gen TO 0;; + +CREATE TRIGGER t_phpbb_forums_gen FOR phpbb_forums +BEFORE INSERT +AS +BEGIN + NEW.forum_id = GEN_ID(phpbb_forums_gen, 1); +END;; + + +# phpbb_forum_access +CREATE TABLE phpbb_forum_access ( + forum_id INTEGER DEFAULT 0 NOT NULL, + user_id INTEGER DEFAULT 0 NOT NULL, + session_id VARCHAR(32) NOT NULL +);; + +ALTER TABLE phpbb_forum_access ADD PRIMARY KEY (forum_id, user_id, session_id);; + + # phpbb_forums_marking CREATE TABLE phpbb_forums_marking ( user_id INTEGER DEFAULT 0 NOT NULL, @@ -219,6 +399,9 @@ CREATE TABLE phpbb_forums_marking ( mark_time INTEGER DEFAULT 0 NOT NULL );; +ALTER TABLE phpbb_forums_marking ADD PRIMARY KEY (user_id, forum_id);; + + # phpbb_forums_watch CREATE TABLE phpbb_forums_watch ( forum_id INTEGER DEFAULT 0 NOT NULL, @@ -226,16 +409,21 @@ CREATE TABLE phpbb_forums_watch ( 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_notify_status ON phpbb_forums_watch(notify_status);; +CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch(user_id);; + + # phpbb_groups CREATE TABLE phpbb_groups ( group_id INTEGER NOT NULL, group_type INTEGER DEFAULT 1 NOT NULL, - group_name VARCHAR(40) NOT NULL, + group_name VARCHAR(255) NOT NULL, group_desc BLOB SUB_TYPE TEXT, group_desc_bitfield INTEGER DEFAULT 0 NOT NULL, group_desc_uid VARCHAR(5) NOT NULL, group_display INTEGER DEFAULT 0 NOT NULL, - group_avatar VARCHAR(100) NOT NULL, + group_avatar VARCHAR(255) NOT NULL, group_avatar_type INTEGER DEFAULT 0 NOT NULL, group_avatar_width INTEGER DEFAULT 0 NOT NULL, group_avatar_height INTEGER DEFAULT 0 NOT NULL, @@ -248,26 +436,67 @@ CREATE TABLE phpbb_groups ( group_legend INTEGER DEFAULT 1 NOT NULL );; +ALTER TABLE phpbb_groups ADD PRIMARY KEY (group_id);; + +CREATE INDEX phpbb_groups_group_legend ON phpbb_groups(group_legend);; + +CREATE GENERATOR phpbb_groups_gen;; +SET GENERATOR phpbb_groups_gen TO 0;; + +CREATE TRIGGER t_phpbb_groups_gen FOR phpbb_groups +BEFORE INSERT +AS +BEGIN + NEW.group_id = GEN_ID(phpbb_groups_gen, 1); +END;; + + # phpbb_icons CREATE TABLE phpbb_icons ( icons_id INTEGER NOT NULL, - icons_url VARCHAR(50), + icons_url VARCHAR(255), 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 GENERATOR phpbb_icons_gen;; +SET GENERATOR phpbb_icons_gen TO 0;; + +CREATE TRIGGER t_phpbb_icons_gen FOR phpbb_icons +BEFORE INSERT +AS +BEGIN + NEW.icons_id = GEN_ID(phpbb_icons_gen, 1); +END;; + + # phpbb_lang CREATE TABLE phpbb_lang ( lang_id INTEGER NOT NULL, lang_iso VARCHAR(5) NOT NULL, lang_dir VARCHAR(30) NOT NULL, - lang_english_name VARCHAR(30), - lang_local_name VARCHAR(100), - lang_author VARCHAR(100) + lang_english_name VARCHAR(100), + lang_local_name VARCHAR(255), + lang_author VARCHAR(255) );; +ALTER TABLE phpbb_lang ADD PRIMARY KEY (lang_id);; + +CREATE GENERATOR phpbb_lang_gen;; +SET GENERATOR phpbb_lang_gen TO 0;; + +CREATE TRIGGER t_phpbb_lang_gen FOR phpbb_lang +BEFORE INSERT +AS +BEGIN + NEW.lang_id = GEN_ID(phpbb_lang_gen, 1); +END;; + + # phpbb_log CREATE TABLE phpbb_log ( log_id INTEGER NOT NULL, @@ -282,39 +511,82 @@ CREATE TABLE phpbb_log ( log_data BLOB SUB_TYPE TEXT );; +ALTER TABLE phpbb_log ADD PRIMARY KEY (log_id);; + +CREATE INDEX phpbb_log_forum_id ON phpbb_log(forum_id);; +CREATE INDEX phpbb_log_log_type ON phpbb_log(log_type);; +CREATE INDEX phpbb_log_reportee_id ON phpbb_log(reportee_id);; +CREATE INDEX phpbb_log_topic_id ON phpbb_log(topic_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_gen FOR phpbb_log +BEFORE INSERT +AS +BEGIN + NEW.log_id = GEN_ID(phpbb_log_gen, 1); +END;; + + # phpbb_moderator_cache CREATE TABLE phpbb_moderator_cache ( forum_id INTEGER DEFAULT 0 NOT NULL, user_id INTEGER DEFAULT 0 NOT NULL, - username VARCHAR(30) NOT NULL, + username VARCHAR(255) NOT NULL, group_id INTEGER DEFAULT 0 NOT NULL, - groupname VARCHAR(30) NOT NULL, + group_name VARCHAR(255) NOT NULL, display_on_index INTEGER DEFAULT 1 NOT NULL );; +CREATE INDEX phpbb_moderator_cache_display_on_index ON phpbb_moderator_cache(display_on_index);; +CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache(forum_id);; + + # 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_name VARCHAR(20) NOT NULL, - module_class VARCHAR(4) NOT NULL, + module_name VARCHAR(255) NOT NULL, + module_class VARCHAR(10) NOT NULL, parent_id INTEGER NOT NULL, left_id INTEGER NOT NULL, right_id INTEGER NOT NULL, - module_langname VARCHAR(50) NOT NULL, + module_langname VARCHAR(255) NOT NULL, module_mode VARCHAR(255) NOT NULL, module_auth VARCHAR(255) NOT NULL );; +ALTER TABLE phpbb_modules ADD PRIMARY KEY (module_id);; + +CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules(module_enabled);; +CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules(left_id, right_id);; + +CREATE GENERATOR phpbb_modules_gen;; +SET GENERATOR phpbb_modules_gen TO 0;; + +CREATE TRIGGER t_phpbb_modules_gen FOR phpbb_modules +BEFORE INSERT +AS +BEGIN + NEW.module_id = GEN_ID(phpbb_modules_gen, 1); +END;; + + # phpbb_poll_results CREATE TABLE phpbb_poll_results ( poll_option_id INTEGER DEFAULT 0 NOT NULL, topic_id INTEGER DEFAULT 0 NOT NULL, - poll_option_text VARCHAR(255) NOT NULL, + poll_option_text BLOB SUB_TYPE TEXT, poll_option_total INTEGER DEFAULT 0 NOT NULL );; +CREATE INDEX phpbb_poll_results_poll_option_id ON phpbb_poll_results(poll_option_id);; +CREATE INDEX phpbb_poll_results_topic_id ON phpbb_poll_results(topic_id);; + + # phpbb_poll_voters CREATE TABLE phpbb_poll_voters ( topic_id INTEGER DEFAULT 0 NOT NULL, @@ -323,6 +595,10 @@ CREATE TABLE phpbb_poll_voters ( vote_user_ip VARCHAR(40) NOT NULL );; +CREATE INDEX phpbb_poll_voters_vote_user_id ON phpbb_poll_voters(vote_user_id);; +CREATE INDEX phpbb_poll_voters_vote_user_ip ON phpbb_poll_voters(vote_user_ip);; + + # phpbb_posts CREATE TABLE phpbb_posts ( post_id INTEGER NOT NULL, @@ -338,8 +614,8 @@ CREATE TABLE phpbb_posts ( 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(30), - post_subject VARCHAR(60), + post_username VARCHAR(255), + post_subject BLOB SUB_TYPE TEXT, post_text BLOB SUB_TYPE TEXT, post_checksum VARCHAR(32) NOT NULL, post_encoding VARCHAR(20) DEFAULT 'iso-8859-1' NOT NULL, @@ -347,12 +623,32 @@ CREATE TABLE phpbb_posts ( bbcode_bitfield INTEGER DEFAULT 0 NOT NULL, bbcode_uid VARCHAR(5) NOT NULL, post_edit_time INTEGER DEFAULT 0 NOT NULL, - post_edit_reason VARCHAR(100), + post_edit_reason BLOB SUB_TYPE TEXT, post_edit_user INTEGER DEFAULT 0 NOT NULL, post_edit_count INTEGER DEFAULT 0 NOT NULL, post_edit_locked 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_post_approved ON phpbb_posts(post_approved);; +CREATE INDEX phpbb_posts_post_time ON phpbb_posts(post_time);; +CREATE INDEX phpbb_posts_poster_id ON phpbb_posts(poster_id);; +CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts(poster_ip);; +CREATE INDEX phpbb_posts_topic_id ON phpbb_posts(topic_id);; + +CREATE GENERATOR phpbb_posts_gen;; +SET GENERATOR phpbb_posts_gen TO 0;; + +CREATE TRIGGER t_phpbb_posts_gen FOR phpbb_posts +BEFORE INSERT +AS +BEGIN + NEW.post_id = GEN_ID(phpbb_posts_gen, 1); +END;; + + # phpbb_privmsgs CREATE TABLE phpbb_privmsgs ( msg_id INTEGER NOT NULL, @@ -365,9 +661,9 @@ CREATE TABLE phpbb_privmsgs ( 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(60), + message_subject BLOB SUB_TYPE TEXT, message_text BLOB SUB_TYPE TEXT, - message_edit_reason VARCHAR(100), + message_edit_reason BLOB SUB_TYPE TEXT, message_edit_user INTEGER DEFAULT 0 NOT NULL, message_encoding VARCHAR(20) DEFAULT 'iso-8859-1' NOT NULL, message_attachment INTEGER DEFAULT 0 NOT NULL, @@ -379,14 +675,47 @@ CREATE TABLE phpbb_privmsgs ( bcc_address BLOB SUB_TYPE TEXT );; +ALTER TABLE phpbb_privmsgs ADD PRIMARY KEY (msg_id);; + +CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs(author_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_root_level ON phpbb_privmsgs(root_level);; + +CREATE GENERATOR phpbb_privmsgs_gen;; +SET GENERATOR phpbb_privmsgs_gen TO 0;; + +CREATE TRIGGER t_phpbb_privmsgs_gen FOR phpbb_privmsgs +BEFORE INSERT +AS +BEGIN + NEW.msg_id = GEN_ID(phpbb_privmsgs_gen, 1); +END;; + + # phpbb_privmsgs_folder CREATE TABLE phpbb_privmsgs_folder ( folder_id INTEGER NOT NULL, user_id INTEGER DEFAULT 0 NOT NULL, - folder_name VARCHAR(40) NOT NULL, + folder_name VARCHAR(255) NOT NULL, 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_gen FOR phpbb_privmsgs_folder +BEFORE INSERT +AS +BEGIN + NEW.folder_id = GEN_ID(phpbb_privmsgs_folder_gen, 1); +END;; + + # phpbb_privmsgs_rules CREATE TABLE phpbb_privmsgs_rules ( rule_id INTEGER NOT NULL, @@ -400,6 +729,19 @@ CREATE TABLE phpbb_privmsgs_rules ( rule_folder_id INTEGER DEFAULT 0 NOT NULL );; +ALTER TABLE phpbb_privmsgs_rules ADD PRIMARY KEY (rule_id);; + +CREATE GENERATOR phpbb_privmsgs_rules_gen;; +SET GENERATOR phpbb_privmsgs_rules_gen TO 0;; + +CREATE TRIGGER t_phpbb_privmsgs_rules_gen FOR phpbb_privmsgs_rules +BEFORE INSERT +AS +BEGIN + NEW.rule_id = GEN_ID(phpbb_privmsgs_rules_gen, 1); +END;; + + # phpbb_privmsgs_to CREATE TABLE phpbb_privmsgs_to ( msg_id INTEGER DEFAULT 0 NOT NULL, @@ -414,11 +756,15 @@ CREATE TABLE phpbb_privmsgs_to ( 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_user_id ON phpbb_privmsgs_to(user_id, folder_id);; + + # phpbb_profile_fields CREATE TABLE phpbb_profile_fields ( field_id INTEGER NOT NULL, - field_name VARCHAR(50) NOT NULL, - field_desc VARCHAR(255) NOT NULL, + field_name VARCHAR(255) NOT NULL, + field_desc BLOB SUB_TYPE TEXT, field_type INTEGER DEFAULT 0 NOT NULL, field_ident VARCHAR(20) NOT NULL, field_length VARCHAR(20) NOT NULL, @@ -435,38 +781,76 @@ CREATE TABLE phpbb_profile_fields ( field_order INTEGER DEFAULT 0 NOT NULL );; +ALTER TABLE phpbb_profile_fields ADD PRIMARY KEY (field_id);; + +CREATE INDEX phpbb_profile_fields_field_order ON phpbb_profile_fields(field_order);; +CREATE INDEX phpbb_profile_fields_field_type ON phpbb_profile_fields(field_type);; + +CREATE GENERATOR phpbb_profile_fields_gen;; +SET GENERATOR phpbb_profile_fields_gen TO 0;; + +CREATE TRIGGER t_phpbb_profile_fields_gen FOR phpbb_profile_fields +BEFORE INSERT +AS +BEGIN + NEW.field_id = GEN_ID(phpbb_profile_fields_gen, 1); +END;; + + # phpbb_profile_fields_data CREATE TABLE phpbb_profile_fields_data ( user_id INTEGER DEFAULT 0 NOT NULL );; +ALTER TABLE phpbb_profile_fields_data ADD PRIMARY KEY (user_id);; + + # 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 INTEGER DEFAULT 0 NOT NULL, - valueCol VARCHAR(255) NOT NULL + value VARCHAR(255) NOT NULL );; +ALTER TABLE phpbb_profile_fields_lang ADD PRIMARY KEY (field_id, lang_id, option_id);; + + # 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) NOT NULL, - lang_explain BLOB SUB_TYPE TEXT NOT NULL, + lang_explain BLOB SUB_TYPE TEXT, lang_default_value VARCHAR(255) NOT NULL );; +ALTER TABLE phpbb_profile_lang ADD PRIMARY KEY (field_id, lang_id);; + + # phpbb_ranks CREATE TABLE phpbb_ranks ( rank_id INTEGER NOT NULL, - rank_title VARCHAR(50) NOT NULL, + rank_title VARCHAR(255) NOT NULL, rank_min INTEGER DEFAULT 0 NOT NULL, rank_special INTEGER DEFAULT 0 , - rank_image VARCHAR(100) + rank_image VARCHAR(255) );; +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_gen FOR phpbb_ranks +BEFORE INSERT +AS +BEGIN + NEW.rank_id = GEN_ID(phpbb_ranks_gen, 1); +END;; + + # phpbb_reports CREATE TABLE phpbb_reports ( report_id INTEGER NOT NULL, @@ -476,25 +860,54 @@ CREATE TABLE phpbb_reports ( 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 NOT NULL + report_text BLOB SUB_TYPE TEXT );; +ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);; + +CREATE GENERATOR phpbb_reports_gen;; +SET GENERATOR phpbb_reports_gen TO 0;; + +CREATE TRIGGER t_phpbb_reports_gen FOR phpbb_reports +BEFORE INSERT +AS +BEGIN + NEW.report_id = GEN_ID(phpbb_reports_gen, 1); +END;; + + # phpbb_reports_reasons CREATE TABLE phpbb_reports_reasons ( reason_id INTEGER NOT NULL, reason_title VARCHAR(255) NOT NULL, - reason_description BLOB SUB_TYPE TEXT NOT NULL, + reason_description BLOB SUB_TYPE TEXT, 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_gen FOR phpbb_reports_reasons +BEFORE INSERT +AS +BEGIN + NEW.reason_id = GEN_ID(phpbb_reports_reasons_gen, 1); +END;; + + # phpbb_search_results CREATE TABLE phpbb_search_results ( search_key VARCHAR(32) NOT NULL, search_time INTEGER DEFAULT 0 NOT NULL, - search_keywords BLOB SUB_TYPE TEXT NOT NULL, - search_authors BLOB SUB_TYPE TEXT NOT NULL + search_keywords BLOB SUB_TYPE TEXT, + search_authors BLOB SUB_TYPE TEXT );; +ALTER TABLE phpbb_search_results ADD PRIMARY KEY (search_key);; + + # phpbb_search_wordlist CREATE TABLE phpbb_search_wordlist ( word_text VARCHAR(50) NOT NULL, @@ -502,6 +915,21 @@ CREATE TABLE phpbb_search_wordlist ( word_common INTEGER DEFAULT 0 NOT NULL );; +ALTER TABLE phpbb_search_wordlist ADD PRIMARY KEY (word_text);; + +CREATE INDEX phpbb_search_wordlist_word_id ON phpbb_search_wordlist(word_id);; + +CREATE GENERATOR phpbb_search_wordlist_gen;; +SET GENERATOR phpbb_search_wordlist_gen TO 0;; + +CREATE TRIGGER t_phpbb_search_wordlist_gen FOR phpbb_search_wordlist +BEFORE INSERT +AS +BEGIN + NEW.word_id = GEN_ID(phpbb_search_wordlist_gen, 1); +END;; + + # phpbb_search_wordmatch CREATE TABLE phpbb_search_wordmatch ( post_id INTEGER DEFAULT 0 NOT NULL, @@ -509,6 +937,8 @@ CREATE TABLE phpbb_search_wordmatch ( title_match INTEGER DEFAULT 0 NOT NULL );; +CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch(word_id);; + # phpbb_sessions CREATE TABLE phpbb_sessions ( session_id VARCHAR(32) NOT NULL, @@ -524,6 +954,12 @@ CREATE TABLE phpbb_sessions ( 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);; + + # phpbb_sessions_keys CREATE TABLE phpbb_sessions_keys ( key_id VARCHAR(32) NOT NULL, @@ -532,6 +968,11 @@ CREATE TABLE phpbb_sessions_keys ( 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);; + + # phpbb_sitelist CREATE TABLE phpbb_sitelist ( site_id INTEGER NOT NULL, @@ -540,6 +981,19 @@ CREATE TABLE phpbb_sitelist ( 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_gen FOR phpbb_sitelist +BEFORE INSERT +AS +BEGIN + NEW.site_id = GEN_ID(phpbb_sitelist_gen, 1); +END;; + + # phpbb_smilies CREATE TABLE phpbb_smilies ( smiley_id INTEGER NOT NULL, @@ -552,23 +1006,54 @@ CREATE TABLE phpbb_smilies ( display_on_posting INTEGER DEFAULT 1 NOT NULL );; +ALTER TABLE phpbb_smilies ADD PRIMARY KEY (smiley_id);; + +CREATE GENERATOR phpbb_smilies_gen;; +SET GENERATOR phpbb_smilies_gen TO 0;; + +CREATE TRIGGER t_phpbb_smilies_gen FOR phpbb_smilies +BEFORE INSERT +AS +BEGIN + NEW.smiley_id = GEN_ID(phpbb_smilies_gen, 1); +END;; + + # phpbb_styles CREATE TABLE phpbb_styles ( style_id INTEGER NOT NULL, - style_name VARCHAR(30) NOT NULL, - style_copyright VARCHAR(50) NOT NULL, + style_name VARCHAR(255) NOT NULL, + style_copyright VARCHAR(255) NOT NULL, style_active INTEGER DEFAULT 1 NOT NULL, template_id INTEGER DEFAULT 0 NOT NULL, theme_id INTEGER DEFAULT 0 NOT NULL, imageset_id INTEGER DEFAULT 0 NOT NULL );; +ALTER TABLE phpbb_styles ADD PRIMARY KEY (style_id);; + +CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles(style_name);; +CREATE INDEX phpbb_styles_imageset_id ON phpbb_styles(imageset_id);; +CREATE INDEX phpbb_styles_template_id ON phpbb_styles(template_id);; +CREATE INDEX phpbb_styles_theme_id ON phpbb_styles(theme_id);; + +CREATE GENERATOR phpbb_styles_gen;; +SET GENERATOR phpbb_styles_gen TO 0;; + +CREATE TRIGGER t_phpbb_styles_gen FOR phpbb_styles +BEFORE INSERT +AS +BEGIN + NEW.style_id = GEN_ID(phpbb_styles_gen, 1); +END;; + + # phpbb_styles_imageset CREATE TABLE phpbb_styles_imageset ( imageset_id INTEGER NOT NULL, - imageset_name VARCHAR(30) NOT NULL, - imageset_copyright VARCHAR(50) NOT NULL, - imageset_path VARCHAR(30) NOT NULL, + imageset_name VARCHAR(255) NOT NULL, + imageset_copyright VARCHAR(255) NOT NULL, + imageset_path VARCHAR(100) NOT NULL, site_logo VARCHAR(200) NOT NULL, btn_post VARCHAR(200) NOT NULL, btn_post_pm VARCHAR(200) NOT NULL, @@ -648,36 +1133,85 @@ CREATE TABLE phpbb_styles_imageset ( user_icon10 VARCHAR(200) NOT NULL );; +ALTER TABLE phpbb_styles_imageset ADD PRIMARY KEY (imageset_id);; + +CREATE UNIQUE INDEX phpbb_styles_imageset_imageset_name ON phpbb_styles_imageset(imageset_name);; + +CREATE GENERATOR phpbb_styles_imageset_gen;; +SET GENERATOR phpbb_styles_imageset_gen TO 0;; + +CREATE TRIGGER t_phpbb_styles_imageset_gen FOR phpbb_styles_imageset +BEFORE INSERT +AS +BEGIN + NEW.imageset_id = GEN_ID(phpbb_styles_imageset_gen, 1); +END;; + + # phpbb_styles_template CREATE TABLE phpbb_styles_template ( template_id INTEGER NOT NULL, - template_name VARCHAR(30) NOT NULL, - template_copyright VARCHAR(50) NOT NULL, - template_path VARCHAR(30) NOT NULL, + template_name VARCHAR(255) NOT NULL, + template_copyright VARCHAR(255) NOT NULL, + template_path VARCHAR(100) NOT NULL, bbcode_bitfield INTEGER DEFAULT 0 NOT NULL, template_storedb INTEGER DEFAULT 0 NOT NULL );; +ALTER TABLE phpbb_styles_template ADD PRIMARY KEY (template_id);; + +CREATE UNIQUE INDEX phpbb_styles_template_template_name ON phpbb_styles_template(template_name);; + + # phpbb_styles_template_data CREATE TABLE phpbb_styles_template_data ( template_id INTEGER DEFAULT 0 NOT NULL, - template_filename VARCHAR(50) NOT NULL, - template_included BLOB SUB_TYPE TEXT NOT NULL, + template_filename VARCHAR(100) NOT NULL, + template_included BLOB SUB_TYPE TEXT, template_mtime INTEGER DEFAULT 0 NOT NULL, template_data BLOB SUB_TYPE TEXT );; +CREATE INDEX phpbb_styles_template_data_template_filename ON phpbb_styles_template_data(template_filename);; +CREATE INDEX phpbb_styles_template_data_template_id ON phpbb_styles_template_data(template_id);; + +CREATE GENERATOR phpbb_styles_template_data_gen;; +SET GENERATOR phpbb_styles_template_data_gen TO 0;; + +CREATE TRIGGER t_phpbb_styles_template_data_gen FOR phpbb_styles_template +BEFORE INSERT +AS +BEGIN + NEW.template_id = GEN_ID(phpbb_styles_template_data_gen, 1); +END;; + + # phpbb_styles_theme CREATE TABLE phpbb_styles_theme ( theme_id INTEGER NOT NULL, - theme_name VARCHAR(30) NOT NULL, - theme_copyright VARCHAR(50) NOT NULL, - theme_path VARCHAR(30) NOT NULL, + theme_name VARCHAR(255) NOT NULL, + theme_copyright VARCHAR(255) NOT NULL, + theme_path VARCHAR(100) NOT NULL, theme_storedb INTEGER DEFAULT 0 NOT NULL, theme_mtime INTEGER DEFAULT 0 NOT NULL, - theme_data BLOB SUB_TYPE TEXT NOT NULL + theme_data BLOB SUB_TYPE TEXT );; +ALTER TABLE phpbb_styles_theme ADD PRIMARY KEY (theme_id);; + +CREATE UNIQUE INDEX phpbb_styles_theme_theme_name ON phpbb_styles_theme(theme_name);; + +CREATE GENERATOR phpbb_styles_theme_gen;; +SET GENERATOR phpbb_styles_theme_gen TO 0;; + +CREATE TRIGGER t_phpbb_styles_theme_gen FOR phpbb_styles_theme +BEFORE INSERT +AS +BEGIN + NEW.theme_id = GEN_ID(phpbb_styles_theme_gen, 1); +END;; + + # phpbb_topics CREATE TABLE phpbb_topics ( topic_id INTEGER NOT NULL, @@ -686,7 +1220,7 @@ CREATE TABLE phpbb_topics ( topic_attachment INTEGER DEFAULT 0 NOT NULL, topic_approved INTEGER DEFAULT 1 NOT NULL, topic_reported INTEGER DEFAULT 0 NOT NULL, - topic_title VARCHAR(60) NOT NULL, + topic_title BLOB SUB_TYPE TEXT, topic_poster INTEGER DEFAULT 0 NOT NULL, topic_time INTEGER DEFAULT 0 NOT NULL, topic_time_limit INTEGER DEFAULT 0 NOT NULL, @@ -696,16 +1230,16 @@ CREATE TABLE phpbb_topics ( 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(30), + topic_first_poster_name VARCHAR(255), topic_last_post_id INTEGER DEFAULT 0 NOT NULL, topic_last_poster_id INTEGER DEFAULT 0 NOT NULL, - topic_last_poster_name VARCHAR(30), + topic_last_poster_name VARCHAR(255), 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) NOT NULL, + poll_title BLOB SUB_TYPE TEXT, poll_start INTEGER DEFAULT 0 NOT NULL, poll_length INTEGER DEFAULT 0 NOT NULL, poll_max_options INTEGER DEFAULT 1 NOT NULL, @@ -713,6 +1247,23 @@ CREATE TABLE phpbb_topics ( poll_vote_change 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_topic_last_post_time ON phpbb_topics(topic_last_post_time);; + +CREATE GENERATOR phpbb_topics_gen;; +SET GENERATOR phpbb_topics_gen TO 0;; + +CREATE TRIGGER t_phpbb_topics_gen FOR phpbb_topics +BEFORE INSERT +AS +BEGIN + NEW.topic_id = GEN_ID(phpbb_topics_gen, 1); +END;; + + # phpbb_topics_marking CREATE TABLE phpbb_topics_marking ( user_id INTEGER DEFAULT 0 NOT NULL, @@ -721,6 +1272,11 @@ CREATE TABLE phpbb_topics_marking ( mark_time INTEGER DEFAULT 0 NOT NULL );; +ALTER TABLE phpbb_topics_marking ADD PRIMARY KEY (user_id, topic_id);; + +CREATE INDEX phpbb_topics_marking_forum_id ON phpbb_topics_marking(forum_id);; + + # phpbb_topics_posted CREATE TABLE phpbb_topics_posted ( user_id INTEGER DEFAULT 0 NOT NULL, @@ -728,6 +1284,9 @@ CREATE TABLE phpbb_topics_posted ( topic_posted INTEGER DEFAULT 0 NOT NULL );; +ALTER TABLE phpbb_topics_posted ADD PRIMARY KEY (user_id, topic_id);; + + # phpbb_topics_watch CREATE TABLE phpbb_topics_watch ( topic_id INTEGER DEFAULT 0 NOT NULL, @@ -735,6 +1294,11 @@ CREATE TABLE phpbb_topics_watch ( notify_status INTEGER DEFAULT 0 NOT NULL );; +CREATE INDEX phpbb_topics_watch_notify_status ON phpbb_topics_watch(notify_status);; +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);; + + # phpbb_user_group CREATE TABLE phpbb_user_group ( group_id INTEGER DEFAULT 0 NOT NULL, @@ -743,18 +1307,23 @@ CREATE TABLE phpbb_user_group ( user_pending INTEGER );; +CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group(group_id);; +CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group(group_leader);; +CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group(user_id);; + + # 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 NOT NULL, + user_permissions BLOB SUB_TYPE TEXT, user_ip VARCHAR(40) NOT NULL, user_regdate INTEGER DEFAULT 0 NOT NULL, - username VARCHAR(30) NOT NULL, - user_password VARCHAR(32) NOT NULL, + username VARCHAR(255) NOT NULL, + user_password VARCHAR(40) NOT NULL, user_passchg INTEGER DEFAULT 0 NOT NULL, - user_email VARCHAR(60) NOT NULL, + user_email VARCHAR(100) NOT NULL, user_email_hash DOUBLE PRECISION DEFAULT 0 NOT NULL, user_birthday VARCHAR(10) NOT NULL, user_lastvisit INTEGER DEFAULT 0 NOT NULL, @@ -779,8 +1348,6 @@ CREATE TABLE phpbb_users ( user_message_rules INTEGER DEFAULT 0 NOT NULL, user_full_folder INTEGER DEFAULT -3 NOT NULL, user_emailtime INTEGER DEFAULT 0 NOT NULL, - user_sortby_type VARCHAR(2) NOT NULL, - user_sortby_dir VARCHAR(2) NOT NULL, user_topic_show_days INTEGER DEFAULT 0 NOT NULL, user_topic_sortby_type VARCHAR(1) DEFAULT 't' NOT NULL, user_topic_sortby_dir VARCHAR(1) DEFAULT 'd' NOT NULL, @@ -796,11 +1363,11 @@ CREATE TABLE phpbb_users ( user_allow_viewemail INTEGER DEFAULT 1 NOT NULL, user_allow_massemail INTEGER DEFAULT 1 NOT NULL, user_options INTEGER DEFAULT 893 NOT NULL, - user_avatar VARCHAR(100) NOT NULL, + user_avatar VARCHAR(255) NOT NULL, user_avatar_type INTEGER DEFAULT 0 NOT NULL, user_avatar_width INTEGER DEFAULT 0 NOT NULL, user_avatar_height INTEGER DEFAULT 0 NOT NULL, - user_sig BLOB SUB_TYPE TEXT NOT NULL, + user_sig BLOB SUB_TYPE TEXT, user_sig_bbcode_uid VARCHAR(5) NOT NULL, user_sig_bbcode_bitfield INTEGER DEFAULT 0 NOT NULL, user_from VARCHAR(100) NOT NULL, @@ -809,1057 +1376,79 @@ CREATE TABLE phpbb_users ( user_yim VARCHAR(255) NOT NULL, user_msnm VARCHAR(255) NOT NULL, user_jabber VARCHAR(255) NOT NULL, - user_website VARCHAR(100) NOT NULL, + user_website VARCHAR(200) NOT NULL, user_occ VARCHAR(255) NOT NULL, user_interests VARCHAR(255) NOT NULL, user_actkey VARCHAR(32) NOT NULL, user_newpasswd VARCHAR(32) NOT NULL );; -# 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 NULLL, - warning_time INTEGER DEFAULT 0 NOT NULL, -);; - -# phpbb_words -CREATE TABLE phpbb_words ( - word_id INTEGER NOT NULL, - word VARCHAR(100) NOT NULL, - replacement VARCHAR(100) NOT NULL -);; - -# 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_users ADD PRIMARY KEY (user_id);; -ALTER TABLE phpbb_attachments -ADD PRIMARY KEY ( - attach_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_username ON phpbb_users(username);; -CREATE INDEX filesize1 -ON phpbb_attachments( - filesize -);; +CREATE GENERATOR phpbb_users_gen;; +SET GENERATOR phpbb_users_gen TO 0;; -CREATE INDEX filetime2 -ON phpbb_attachments( - filetime -);; - -CREATE INDEX post_msg_id4 -ON phpbb_attachments( - post_msg_id -);; - -CREATE INDEX poster_id5 -ON phpbb_attachments( - poster_id -);; - -CREATE INDEX topic_id6 -ON phpbb_attachments( - topic_id -);; - -CREATE INDEX auth_option_id7 -ON phpbb_auth_groups( - auth_option_id -);; - -CREATE INDEX group_id8 -ON phpbb_auth_groups( - group_id -);; - -ALTER TABLE phpbb_auth_options -ADD PRIMARY KEY ( - auth_option_id -);; - -CREATE INDEX auth_option9 -ON phpbb_auth_options( - auth_option -);; - -ALTER TABLE phpbb_auth_roles -ADD PRIMARY KEY ( - role_id -);; - -CREATE INDEX role_type10 -ON phpbb_auth_roles( - role_type -);; - -ALTER TABLE phpbb_auth_roles_data -ADD PRIMARY KEY ( - role_id, - auth_option_id -);; - -CREATE INDEX auth_option_id11 -ON phpbb_auth_users( - auth_option_id -);; - -CREATE INDEX user_id12 -ON phpbb_auth_users( - user_id -);; - -ALTER TABLE phpbb_banlist -ADD PRIMARY KEY ( - ban_id -);; - -ALTER TABLE phpbb_bbcodes -ADD PRIMARY KEY ( - bbcode_id -);; - -CREATE INDEX order_id13 -ON phpbb_bookmarks( - order_id -);; - -CREATE INDEX topic_user_id14 -ON phpbb_bookmarks( - topic_id, - user_id -);; - -ALTER TABLE phpbb_bots -ADD PRIMARY KEY ( - bot_id -);; - -CREATE INDEX bot_active15 -ON phpbb_bots( - bot_active -);; - -ALTER TABLE phpbb_cache -ADD PRIMARY KEY ( - var_name -);; - -ALTER TABLE phpbb_config -ADD PRIMARY KEY ( - config_name -);; - -CREATE INDEX is_dynamic16 -ON phpbb_config( - is_dynamic -);; - -ALTER TABLE phpbb_confirm -ADD PRIMARY KEY ( - session_id, - confirm_id -);; - -CREATE INDEX display_on_posting -ON phpbb_bbcodes( - display_on_posting -);; - -ALTER TABLE phpbb_disallow -ADD PRIMARY KEY ( - disallow_id -);; - -ALTER TABLE phpbb_drafts -ADD PRIMARY KEY ( - draft_id -);; - -CREATE INDEX save_time17 -ON phpbb_drafts( - save_time -);; - -ALTER TABLE phpbb_extension_groups -ADD PRIMARY KEY ( - group_id -);; - -ALTER TABLE phpbb_extensions -ADD PRIMARY KEY ( - extension_id -);; - -ALTER TABLE phpbb_forum_access -ADD PRIMARY KEY ( - forum_id, - user_id, - session_id -);; - -ALTER TABLE phpbb_forums -ADD PRIMARY KEY ( - forum_id -);; - -CREATE INDEX forum_last_post_id18 -ON phpbb_forums( - forum_last_post_id -);; - -CREATE INDEX left_right_id19 -ON phpbb_forums( - left_id, - right_id -);; - -ALTER TABLE phpbb_forums_marking -ADD PRIMARY KEY ( - user_id, - forum_id -);; - -CREATE INDEX forum_id20 -ON phpbb_forums_watch( - forum_id -);; - -CREATE INDEX notify_status21 -ON phpbb_forums_watch( - notify_status -);; - -CREATE INDEX user_id22 -ON phpbb_forums_watch( - user_id -);; - -ALTER TABLE phpbb_groups -ADD PRIMARY KEY ( - group_id -);; - -CREATE INDEX group_legend23 -ON phpbb_groups( - group_legend -);; - -ALTER TABLE phpbb_icons -ADD PRIMARY KEY ( - icons_id -);; - -ALTER TABLE phpbb_lang -ADD PRIMARY KEY ( - lang_id -);; - -ALTER TABLE phpbb_log -ADD PRIMARY KEY ( - log_id -);; - -CREATE INDEX forum_id24 -ON phpbb_log( - forum_id -);; - -CREATE INDEX log_type25 -ON phpbb_log( - log_type -);; - -CREATE INDEX reportee_id26 -ON phpbb_log( - reportee_id -);; - -CREATE INDEX topic_id27 -ON phpbb_log( - topic_id -);; - -CREATE INDEX user_id28 -ON phpbb_log( - user_id -);; - -CREATE INDEX display_on_index29 -ON phpbb_moderator_cache( - display_on_index -);; - -CREATE INDEX forum_id30 -ON phpbb_moderator_cache( - forum_id -);; - -ALTER TABLE phpbb_modules -ADD PRIMARY KEY ( - module_id -);; - -CREATE INDEX module_enabled31 -ON phpbb_modules( - module_enabled -);; - -CREATE INDEX left_id31_2 -ON phpbb_modules( - left_id -);; - -CREATE INDEX poll_option_id32 -ON phpbb_poll_results( - poll_option_id -);; - -CREATE INDEX topic_id33 -ON phpbb_poll_results( - topic_id -);; - -CREATE INDEX vote_user_id35 -ON phpbb_poll_voters( - vote_user_id -);; - -CREATE INDEX vote_user_ip36 -ON phpbb_poll_voters( - vote_user_ip -);; - -ALTER TABLE phpbb_posts -ADD PRIMARY KEY ( - post_id -);; - -CREATE INDEX forum_id37 -ON phpbb_posts( - forum_id -);; - -CREATE INDEX post_approved38 -ON phpbb_posts( - post_approved -);; - -CREATE INDEX post_time39 -ON phpbb_posts( - post_time -);; - -CREATE INDEX poster_id40 -ON phpbb_posts( - poster_id -);; - -CREATE INDEX poster_ip41 -ON phpbb_posts( - poster_ip -);; - -CREATE INDEX topic_id42 -ON phpbb_posts( - topic_id -);; - -ALTER TABLE phpbb_privmsgs -ADD PRIMARY KEY ( - msg_id -);; - -CREATE INDEX author_id43 -ON phpbb_privmsgs( - author_id -);; - -CREATE INDEX author_ip44 -ON phpbb_privmsgs( - author_ip -);; - -CREATE INDEX message_time45 -ON phpbb_privmsgs( - message_time -);; - -CREATE INDEX root_level46 -ON phpbb_privmsgs( - root_level -);; - -ALTER TABLE phpbb_privmsgs_folder -ADD PRIMARY KEY ( - folder_id -);; - -CREATE INDEX user_id47 -ON phpbb_privmsgs_folder( - user_id -);; - -ALTER TABLE phpbb_privmsgs_rules -ADD PRIMARY KEY ( - rule_id -);; - -CREATE INDEX msg_id48 -ON phpbb_privmsgs_to( - msg_id -);; - -CREATE INDEX user_id49 -ON phpbb_privmsgs_to( - user_id, - folder_id -);; - -ALTER TABLE phpbb_profile_fields -ADD PRIMARY KEY ( - field_id -);; - -CREATE INDEX field_order50 -ON phpbb_profile_fields( - field_order -);; - -CREATE INDEX field_type51 -ON phpbb_profile_fields( - field_type -);; - -ALTER TABLE phpbb_profile_fields_data -ADD PRIMARY KEY ( - user_id -);; - -ALTER TABLE phpbb_profile_fields_lang -ADD PRIMARY KEY ( - field_id, - lang_id, - option_id -);; - -ALTER TABLE phpbb_profile_lang -ADD PRIMARY KEY ( - field_id, - lang_id -);; - -ALTER TABLE phpbb_ranks -ADD PRIMARY KEY ( - rank_id -);; - -ALTER TABLE phpbb_reports -ADD PRIMARY KEY ( - report_id -);; - -ALTER TABLE phpbb_reports_reasons -ADD PRIMARY KEY ( - reason_id -);; - -ALTER TABLE phpbb_search_results -ADD PRIMARY KEY ( - search_key -);; - -ALTER TABLE phpbb_search_wordlist -ADD PRIMARY KEY ( - word_text -);; - -CREATE INDEX word_id55 -ON phpbb_search_wordlist( - word_id -);; - -ALTER TABLE phpbb_sessions -ADD PRIMARY KEY ( - session_id -);; - -CREATE INDEX session_time57 -ON phpbb_sessions( - session_time -);; - -CREATE INDEX session_user_id58 -ON phpbb_sessions( - session_user_id -);; - -ALTER TABLE phpbb_sitelist -ADD PRIMARY KEY ( - site_id -);; - -ALTER TABLE phpbb_smilies -ADD PRIMARY KEY ( - smiley_id -);; - -ALTER TABLE phpbb_styles -ADD PRIMARY KEY ( - style_id -);; - -CREATE UNIQUE INDEX style_name59 -ON phpbb_styles( - style_name -);; - -CREATE INDEX imageset_id60 -ON phpbb_styles( - imageset_id -);; - -CREATE INDEX template_id61 -ON phpbb_styles( - template_id -);; - -CREATE INDEX theme_id62 -ON phpbb_styles( - theme_id -);; - -CREATE UNIQUE INDEX imageset_name63 -ON phpbb_styles_imageset( - imageset_name -);; - -ALTER TABLE phpbb_styles_imageset -ADD PRIMARY KEY ( - imageset_id -);; - -ALTER TABLE phpbb_styles_template -ADD PRIMARY KEY ( - template_id -);; - -CREATE UNIQUE INDEX template_name64 -ON phpbb_styles_template( - template_name -);; - -CREATE INDEX template_filename65 -ON phpbb_styles_template_data( - template_filename -);; - -CREATE INDEX template_id66 -ON phpbb_styles_template_data( - template_id -);; - -ALTER TABLE phpbb_styles_theme -ADD PRIMARY KEY ( - theme_id -);; - -CREATE UNIQUE INDEX theme_name67 -ON phpbb_styles_theme( - theme_name -);; - -ALTER TABLE phpbb_topics -ADD PRIMARY KEY ( - topic_id -);; - -CREATE INDEX forum_id68 -ON phpbb_topics( - forum_id -);; - -CREATE INDEX forum_id_type69 -ON phpbb_topics( - forum_id, - topic_type -);; - -CREATE INDEX topic_last_post_time70 -ON phpbb_topics( - topic_last_post_time -);; - -ALTER TABLE phpbb_topics_marking -ADD PRIMARY KEY ( - user_id, - topic_id -);; - -CREATE INDEX forum_idtp -ON phpbb_topics_marking( - forum_id -);; - -ALTER TABLE phpbb_topics_posted -ADD PRIMARY KEY ( - user_id, - topic_id -);; - -CREATE INDEX notify_status71 -ON phpbb_topics_watch( - notify_status -);; - -CREATE INDEX topic_id72 -ON phpbb_topics_watch( - topic_id -);; - -CREATE INDEX user_id73 -ON phpbb_topics_watch( - user_id -);; - -CREATE INDEX group_id74 -ON phpbb_user_group( - group_id -);; - -CREATE INDEX group_leader75 -ON phpbb_user_group( - group_leader -);; - -CREATE INDEX user_id76 -ON phpbb_user_group( - user_id -);; - -CREATE INDEX user_birthday77 -ON phpbb_users( - user_birthday -);; - -CREATE INDEX user_email_hash78 -ON phpbb_users( - user_email_hash -);; - -CREATE INDEX username79 -ON phpbb_users( - username -);; - -ALTER TABLE phpbb_warnings -ADD PRIMARY KEY ( - warning_id -);; - -ALTER TABLE phpbb_words -ADD PRIMARY KEY ( - word_id -);; - -CREATE INDEX user_id80 -ON phpbb_zebra( - user_id -);; - -CREATE INDEX zebra_id81 -ON phpbb_zebra( - zebra_id -);; - -ALTER TABLE phpbb_sessions_keys -ADD PRIMARY KEY ( - key_id, - user_id -);; - -CREATE INDEX last_login82 -ON phpbb_sessions_keys( - last_login -);; - -CREATE GENERATOR G_phpbb_attachmentsattach_idGen;; - -SET GENERATOR G_phpbb_attachmentsattach_idGen TO 0;; - -CREATE GENERATOR b_auth_optionsauth_option_idGen;; - -SET GENERATOR b_auth_optionsauth_option_idGen TO 0;; - -CREATE GENERATOR G_auth_rolesrole_idGen;; - -SET GENERATOR G_auth_rolesrole_idGen TO 0;; - -CREATE GENERATOR G_phpbb_banlistban_idGen3;; - -SET GENERATOR G_phpbb_banlistban_idGen3 TO 0;; - -CREATE GENERATOR G_phpbb_botsbot_idGen4;; - -SET GENERATOR G_phpbb_botsbot_idGen4 TO 0;; - -CREATE GENERATOR G_phpbb_disallowdisallow_idGen5;; - -SET GENERATOR G_phpbb_disallowdisallow_idGen5 TO 0;; - -CREATE GENERATOR G_phpbb_draftsdraft_idGen6;; - -SET GENERATOR G_phpbb_draftsdraft_idGen6 TO 0;; - -CREATE GENERATOR pbb_extension_groupsgroup_idGen;; - -SET GENERATOR pbb_extension_groupsgroup_idGen TO 0;; - -CREATE GENERATOR phpbb_extensionsextension_idGen;; - -SET GENERATOR phpbb_extensionsextension_idGen TO 0;; - -CREATE GENERATOR G_phpbb_forumsforum_idGen9;; - -SET GENERATOR G_phpbb_forumsforum_idGen9 TO 0;; - -CREATE GENERATOR G_phpbb_groupsgroup_idGen10;; - -SET GENERATOR G_phpbb_groupsgroup_idGen10 TO 0;; - -CREATE GENERATOR G_phpbb_iconsicons_idGen11;; - -SET GENERATOR G_phpbb_iconsicons_idGen11 TO 0;; - -CREATE GENERATOR G_phpbb_langlang_idGen12;; - -SET GENERATOR G_phpbb_langlang_idGen12 TO 0;; - -CREATE GENERATOR G_phpbb_loglog_idGen13;; - -SET GENERATOR G_phpbb_loglog_idGen13 TO 0;; - -CREATE GENERATOR G_phpbb_modulesmodule_idGen14;; - -SET GENERATOR G_phpbb_modulesmodule_idGen14 TO 0;; - -CREATE GENERATOR G_phpbb_postspost_idGen15;; - -SET GENERATOR G_phpbb_postspost_idGen15 TO 0;; - -CREATE GENERATOR G_phpbb_privmsgsmsg_idGen16;; - -SET GENERATOR G_phpbb_privmsgsmsg_idGen16 TO 0;; - -CREATE GENERATOR bb_privmsgs_folderfolder_idGen1;; - -SET GENERATOR bb_privmsgs_folderfolder_idGen1 TO 0;; - -CREATE GENERATOR phpbb_privmsgs_rulesrule_idGen1;; - -SET GENERATOR phpbb_privmsgs_rulesrule_idGen1 TO 0;; - -CREATE GENERATOR hpbb_profile_fieldsfield_idGen1;; - -SET GENERATOR hpbb_profile_fieldsfield_idGen1 TO 0;; - -CREATE GENERATOR G_phpbb_ranksrank_idGen20;; - -SET GENERATOR G_phpbb_ranksrank_idGen20 TO 0;; - -CREATE GENERATOR G_phpbb_reportsreport_idGen21;; - -SET GENERATOR G_phpbb_reportsreport_idGen21 TO 0;; - -CREATE GENERATOR bb_reports_reasonsreason_idGen2;; - -SET GENERATOR bb_reports_reasonsreason_idGen2 TO 0;; - -CREATE GENERATOR hpbb_search_wordlistword_idGen2;; - -SET GENERATOR hpbb_search_wordlistword_idGen2 TO 0;; - -CREATE GENERATOR G_phpbb_sitelistsite_idGen24;; - -SET GENERATOR G_phpbb_sitelistsite_idGen24 TO 0;; - -CREATE GENERATOR G_phpbb_smiliessmiley_idGen25;; - -SET GENERATOR G_phpbb_smiliessmiley_idGen25 TO 0;; - -CREATE GENERATOR G_phpbb_stylesstyle_idGen26;; - -SET GENERATOR G_phpbb_stylesstyle_idGen26 TO 0;; - -CREATE GENERATOR G_styles_imagesetimageset_idGen;; - -SET GENERATOR G_styles_imagesetimageset_idGen TO 0;; - -CREATE GENERATOR G_styles_templatetemplate_idGen;; - -SET GENERATOR G_styles_templatetemplate_idGen TO 0;; - -CREATE GENERATOR G_phpbb_styles_themetheme_idGen;; - -SET GENERATOR G_phpbb_styles_themetheme_idGen TO 0;; - -CREATE GENERATOR G_phpbb_topicstopic_idGen30;; - -SET GENERATOR G_phpbb_topicstopic_idGen30 TO 0;; - -CREATE GENERATOR G_phpbb_usersuser_idGen31;; - -SET GENERATOR G_phpbb_usersuser_idGen31 TO 0;; - -CREATE GENERATOR G_phpbb_warningswarning_idGen32;; - -SET GENERATOR G_phpbb_warningswarning_idGen32 TO 0;; - -CREATE GENERATOR G_phpbb_wordsword_idGen33;; - -SET GENERATOR G_phpbb_wordsword_idGen33 TO 0;; - -CREATE TRIGGER tG_phpbb_attachmentsattach_idGe FOR phpbb_attachments -BEFORE INSERT -AS -BEGIN - NEW.attach_id = GEN_ID(G_phpbb_attachmentsattach_idGen, 1); -END;; - -CREATE TRIGGER tb_auth_optionsauth_option_idGe FOR phpbb_auth_options -BEFORE INSERT -AS -BEGIN - NEW.auth_option_id = GEN_ID(b_auth_optionsauth_option_idGen, 1); -END;; - -CREATE TRIGGER t_phpbb_auth_rolesrole_idGe FOR phpbb_auth_roles -BEFORE INSERT -AS -BEGIN - NEW.role_id = GEN_ID(G_auth_rolesrole_idGen, 1); -END;; - -CREATE TRIGGER GetNextG_phpbb_banlistban_idGen FOR phpbb_banlist -BEFORE INSERT -AS -BEGIN - NEW.ban_id = GEN_ID(G_phpbb_banlistban_idGen3, 1); -END;; - -CREATE TRIGGER GetNextG_phpbb_botsbot_idGen4 FOR phpbb_bots -BEFORE INSERT -AS -BEGIN - NEW.bot_id = GEN_ID(G_phpbb_botsbot_idGen4, 1); -END;; - -CREATE TRIGGER tG_phpbb_disallowdisallow_idGen FOR phpbb_disallow -BEFORE INSERT -AS -BEGIN - NEW.disallow_id = GEN_ID(G_phpbb_disallowdisallow_idGen5, 1); -END;; - -CREATE TRIGGER etNextG_phpbb_draftsdraft_idGen FOR phpbb_drafts -BEFORE INSERT -AS -BEGIN - NEW.draft_id = GEN_ID(G_phpbb_draftsdraft_idGen6, 1); -END;; - -CREATE TRIGGER tpbb_extension_groupsgroup_idGe FOR phpbb_extension_groups -BEFORE INSERT -AS -BEGIN - NEW.group_id = GEN_ID(pbb_extension_groupsgroup_idGen, 1); -END;; - -CREATE TRIGGER tphpbb_extensionsextension_idGe FOR phpbb_extensions -BEFORE INSERT -AS -BEGIN - NEW.extension_id = GEN_ID(phpbb_extensionsextension_idGen, 1); -END;; - -CREATE TRIGGER etNextG_phpbb_forumsforum_idGen FOR phpbb_forums -BEFORE INSERT -AS -BEGIN - NEW.forum_id = GEN_ID(G_phpbb_forumsforum_idGen9, 1); -END;; - -CREATE TRIGGER tNextG_phpbb_groupsgroup_idGen1 FOR phpbb_groups -BEFORE INSERT -AS -BEGIN - NEW.group_id = GEN_ID(G_phpbb_groupsgroup_idGen10, 1); -END;; - -CREATE TRIGGER etNextG_phpbb_iconsicons_idGen1 FOR phpbb_icons -BEFORE INSERT -AS -BEGIN - NEW.icons_id = GEN_ID(G_phpbb_iconsicons_idGen11, 1); -END;; - -CREATE TRIGGER GetNextG_phpbb_langlang_idGen12 FOR phpbb_lang -BEFORE INSERT -AS -BEGIN - NEW.lang_id = GEN_ID(G_phpbb_langlang_idGen12, 1); -END;; - -CREATE TRIGGER GetNextG_phpbb_loglog_idGen13 FOR phpbb_log +CREATE TRIGGER t_phpbb_users_gen FOR phpbb_users BEFORE INSERT AS BEGIN - NEW.log_id = GEN_ID(G_phpbb_loglog_idGen13, 1); + NEW.user_id = GEN_ID(phpbb_users_gen, 1); END;; -CREATE TRIGGER extG_phpbb_modulesmodule_idGen1 FOR phpbb_modules -BEFORE INSERT -AS -BEGIN - NEW.module_id = GEN_ID(G_phpbb_modulesmodule_idGen14, 1); -END;; -CREATE TRIGGER GetNextG_phpbb_postspost_idGen1 FOR phpbb_posts -BEFORE INSERT -AS -BEGIN - NEW.post_id = GEN_ID(G_phpbb_postspost_idGen15, 1); -END;; - -CREATE TRIGGER tNextG_phpbb_privmsgsmsg_idGen1 FOR phpbb_privmsgs -BEFORE INSERT -AS -BEGIN - NEW.msg_id = GEN_ID(G_phpbb_privmsgsmsg_idGen16, 1); -END;; - -CREATE TRIGGER tbb_privmsgs_folderfolder_idGen FOR phpbb_privmsgs_folder -BEFORE INSERT -AS -BEGIN - NEW.folder_id = GEN_ID(bb_privmsgs_folderfolder_idGen1, 1); -END;; - -CREATE TRIGGER tphpbb_privmsgs_rulesrule_idGen FOR phpbb_privmsgs_rules -BEFORE INSERT -AS -BEGIN - NEW.rule_id = GEN_ID(phpbb_privmsgs_rulesrule_idGen1, 1); -END;; - -CREATE TRIGGER thpbb_profile_fieldsfield_idGen FOR phpbb_profile_fields -BEFORE INSERT -AS -BEGIN - NEW.field_id = GEN_ID(hpbb_profile_fieldsfield_idGen1, 1); -END;; - -CREATE TRIGGER GetNextG_phpbb_ranksrank_idGen2 FOR phpbb_ranks -BEFORE INSERT -AS -BEGIN - NEW.rank_id = GEN_ID(G_phpbb_ranksrank_idGen20, 1); -END;; - -CREATE TRIGGER extG_phpbb_reportsreport_idGen2 FOR phpbb_reports -BEFORE INSERT -AS -BEGIN - NEW.report_id = GEN_ID(G_phpbb_reportsreport_idGen21, 1); -END;; - -CREATE TRIGGER tbb_reports_reasonsreason_idGen FOR phpbb_reports_reasons -BEFORE INSERT -AS -BEGIN - NEW.reason_id = GEN_ID(bb_reports_reasonsreason_idGen2, 1); -END;; +# 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 NULLL, + warning_time INTEGER DEFAULT 0 NOT NULL, +);; -CREATE TRIGGER thpbb_search_wordlistword_idGen FOR phpbb_search_wordlist -BEFORE INSERT -AS -BEGIN - NEW.word_id = GEN_ID(hpbb_search_wordlistword_idGen2, 1); -END;; +ALTER TABLE phpbb_warnings ADD PRIMARY KEY (warning_id);; -CREATE TRIGGER NextG_phpbb_sitelistsite_idGen2 FOR phpbb_sitelist -BEFORE INSERT -AS -BEGIN - NEW.site_id = GEN_ID(G_phpbb_sitelistsite_idGen24, 1); -END;; +CREATE GENERATOR phpbb_warnings_gen;; +SET GENERATOR phpbb_warnings_gen TO 0;; -CREATE TRIGGER NextG_phpbb_smiliessmiley_idGen2 FOR phpbb_smilies +CREATE TRIGGER t_phpbb_warnings_gen FOR phpbb_warnings BEFORE INSERT AS BEGIN - NEW.smiley_id = GEN_ID(G_phpbb_smiliessmiley_idGen25, 1); + NEW.warning_id = GEN_ID(phpbb_warnings_gen, 1); END;; -CREATE TRIGGER tNextG_phpbb_stylesstyle_idGen2 FOR phpbb_styles -BEFORE INSERT -AS -BEGIN - NEW.style_id = GEN_ID(G_phpbb_stylesstyle_idGen26, 1); -END;; -CREATE TRIGGER t_styles_imagesetimageset_idGen FOR phpbb_styles_imageset -BEFORE INSERT -AS -BEGIN - NEW.imageset_id = GEN_ID(G_styles_imagesetimageset_idGen, 1); -END;; +# phpbb_words +CREATE TABLE phpbb_words ( + word_id INTEGER NOT NULL, + word VARCHAR(255) NOT NULL, + replacement VARCHAR(255) NOT NULL +);; -CREATE TRIGGER t_styles_templatetemplate_idGen FOR phpbb_styles_template -BEFORE INSERT -AS -BEGIN - NEW.template_id = GEN_ID(G_styles_templatetemplate_idGen, 1); -END;; +ALTER TABLE phpbb_words ADD PRIMARY KEY (word_id);; -CREATE TRIGGER t_phpbb_styles_themetheme_idGen FOR phpbb_styles_theme -BEFORE INSERT -AS -BEGIN - NEW.theme_id = GEN_ID(G_phpbb_styles_themetheme_idGen, 1); -END;; +CREATE GENERATOR phpbb_words_gen;; +SET GENERATOR phpbb_words_gen TO 0;; -CREATE TRIGGER tNextG_phpbb_topicstopic_idGen3 FOR phpbb_topics +CREATE TRIGGER t_phpbb_words_gen FOR phpbb_words BEFORE INSERT AS BEGIN - NEW.topic_id = GEN_ID(G_phpbb_topicstopic_idGen30, 1); + NEW.word_id = GEN_ID(phpbb_words_gen, 1); END;; -CREATE TRIGGER GetNextG_phpbb_usersuser_idGen3 FOR phpbb_users -BEFORE INSERT -AS -BEGIN - NEW.user_id = GEN_ID(G_phpbb_usersuser_idGen31, 1); -END;; -CREATE TRIGGER GetNextG_phpbb_warningswarning_idGen3 FOR phpbb_warnings -BEFORE INSERT -AS -BEGIN - NEW.warning_id = GEN_ID(G_phpbb_warningswarning_idGen32, 1); -END;; +# 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 +);; -CREATE TRIGGER GetNextG_phpbb_wordsword_idGen3 FOR phpbb_words -BEFORE INSERT -AS -BEGIN - NEW.word_id = GEN_ID(G_phpbb_wordsword_idGen33, 1); -END;; +CREATE INDEX phpbb_zebra_user_id ON phpbb_zebra(user_id);; +CREATE INDEX phpbb_zebra_zebra_id ON phpbb_zebra(zebra_id);; diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index cc1ae96937..4bad827c8e 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -9,7 +9,9 @@ $Id$ BEGIN TRANSACTION GO - +/* + Table: phpbb_attachments +*/ CREATE TABLE [phpbb_attachments] ( [attach_id] [int] IDENTITY (1, 1) NOT NULL , [post_msg_id] [int] NOT NULL , @@ -19,15 +21,55 @@ CREATE TABLE [phpbb_attachments] ( [physical_filename] [varchar] (255) NOT NULL , [real_filename] [varchar] (255) NOT NULL , [download_count] [int] NOT NULL , - [comment] [varchar] (255) NULL , + [comment] [text] , [extension] [varchar] (100) NULL , [mimetype] [varchar] (100) NULL , [filesize] [int] NOT NULL , [filetime] [int] NOT NULL , [thumbnail] [int] NOT NULL -) ON [PRIMARY] +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +ALTER TABLE [phpbb_attachments] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_attachments] PRIMARY KEY CLUSTERED + ( + [attach_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_attachments] WITH NOCHECK ADD + CONSTRAINT [DF_attach_post_msg_id] DEFAULT (0) FOR [post_msg_id], + CONSTRAINT [DF_attach_topic_id] DEFAULT (0) FOR [topic_id], + CONSTRAINT [DF_attach_in_message] DEFAULT (0) FOR [in_message], + CONSTRAINT [DF_attach_poster_id] DEFAULT (0) FOR [poster_id], + CONSTRAINT [DF_attach_download_count] DEFAULT (0) FOR [download_count], + CONSTRAINT [DF_attach_filesize] DEFAULT (0) FOR [filesize], + CONSTRAINT [DF_attach_filetime] DEFAULT (0) FOR [filetime], + CONSTRAINT [DF_attach_thumbnail] DEFAULT (0) FOR [thumbnail] +GO + +CREATE INDEX [filetime] ON [phpbb_attachments]([filetime]) ON [PRIMARY] +GO + +CREATE INDEX [post_msg_id] ON [phpbb_attachments]([post_msg_id]) ON [PRIMARY] +GO + +CREATE INDEX [topic_id] ON [phpbb_attachments]([topic_id]) ON [PRIMARY] GO +CREATE INDEX [poster_id] ON [phpbb_attachments]([poster_id]) ON [PRIMARY] +GO + +CREATE INDEX [physical_filename] ON [phpbb_attachments]([physical_filename]) ON [PRIMARY] +GO + +CREATE INDEX [filesize] ON [phpbb_attachments]([filesize]) ON [PRIMARY] +GO + + +/* + Table: phpbb_auth_groups +*/ CREATE TABLE [phpbb_auth_groups] ( [group_id] [int] NOT NULL , [forum_id] [int] NOT NULL , @@ -37,6 +79,23 @@ CREATE TABLE [phpbb_auth_groups] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_auth_groups] WITH NOCHECK ADD + CONSTRAINT [DF_auth_g_group_id] DEFAULT (0) FOR [group_id], + CONSTRAINT [DF_auth_g_forum_id] DEFAULT (0) FOR [forum_id], + CONSTRAINT [DF_auth_g_auth_option_id] DEFAULT (0) FOR [auth_option_id], + CONSTRAINT [DF_auth_g_auth_setting] DEFAULT (0) FOR [auth_setting] +GO + +CREATE INDEX [group_id] ON [phpbb_auth_groups]([group_id]) ON [PRIMARY] +GO + +CREATE INDEX [auth_option_id] ON [phpbb_auth_groups]([auth_option_id]) ON [PRIMARY] +GO + + +/* + Table: phpbb_auth_options +*/ CREATE TABLE [phpbb_auth_options] ( [auth_option_id] [int] IDENTITY (1, 1) NOT NULL , [auth_option] [varchar] (20) NOT NULL , @@ -46,14 +105,52 @@ CREATE TABLE [phpbb_auth_options] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_auth_options] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_auth_options] PRIMARY KEY CLUSTERED + ( + [auth_option_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_auth_options] WITH NOCHECK ADD + CONSTRAINT [DF_auth_o_is_global] DEFAULT (0) FOR [is_global], + CONSTRAINT [DF_auth_o_is_local] DEFAULT (0) FOR [is_local], + CONSTRAINT [DF_auth_o_founder_only] DEFAULT (0) FOR [founder_only] +GO + +CREATE INDEX [auth_option] ON [phpbb_auth_options]([auth_option]) ON [PRIMARY] +GO + + +/* + Table: phpbb_auth_roles +*/ CREATE TABLE [phpbb_auth_roles] ( [role_id] [int] IDENTITY (1, 1) NOT NULL , - [role_name] [varchar] (50) NOT NULL , + [role_name] [varchar] (255) NOT NULL , [role_type] [varchar] (10) NOT NULL , [role_group_ids] [varchar] (255) NOT NULL ) ON [PRIMARY] GO +ALTER TABLE [phpbb_auth_roles] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_auth_roles] PRIMARY KEY CLUSTERED + ( + [role_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_auth_roles] WITH NOCHECK ADD + CONSTRAINT [DF_auth_p_role_group_ids] DEFAULT ('') FOR [role_group_ids] +GO + +CREATE INDEX [role_type] ON [phpbb_auth_roles]([role_type]) ON [PRIMARY] +GO + + +/* + Table: phpbb_auth_roles_data +*/ CREATE TABLE [phpbb_auth_roles_data] ( [role_id] [int] NOT NULL , [auth_option_id] [int] NOT NULL , @@ -61,6 +158,24 @@ CREATE TABLE [phpbb_auth_roles_data] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_auth_roles_data] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_auth_roles_data] PRIMARY KEY CLUSTERED + ( + [role_id], + [auth_option_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_auth_roles_data] WITH NOCHECK ADD + CONSTRAINT [DF_auth_d_role_id] DEFAULT (0) FOR [role_id], + CONSTRAINT [DF_auth_d_auth_option_id] DEFAULT (0) FOR [auth_option_id], + CONSTRAINT [DF_auth_d_auth_setting] DEFAULT (0) FOR [auth_setting] +GO + + +/* + Table: phpbb_auth_users +*/ CREATE TABLE [phpbb_auth_users] ( [user_id] [int] NOT NULL , [forum_id] [int] NOT NULL , @@ -70,32 +185,86 @@ CREATE TABLE [phpbb_auth_users] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_auth_users] WITH NOCHECK ADD + CONSTRAINT [DF_auth_u_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_auth_u_forum_id] DEFAULT (0) FOR [forum_id], + CONSTRAINT [DF_auth_u_auth_option_id] DEFAULT (0) FOR [auth_option_id], + CONSTRAINT [DF_auth_u_auth_setting] DEFAULT (0) FOR [auth_setting] +GO + +CREATE INDEX [user_id] ON [phpbb_auth_users]([user_id]) ON [PRIMARY] +GO + +CREATE INDEX [auth_option_id] ON [phpbb_auth_users]([auth_option_id]) ON [PRIMARY] +GO + + +/* + Table: phpbb_banlist +*/ CREATE TABLE [phpbb_banlist] ( [ban_id] [int] IDENTITY (1, 1) NOT NULL , [ban_userid] [int] NOT NULL , [ban_ip] [varchar] (40) NOT NULL , - [ban_email] [varchar] (50) NOT NULL , + [ban_email] [varchar] (100) NOT NULL , [ban_start] [int] NOT NULL , [ban_end] [int] NOT NULL , [ban_exclude] [int] NOT NULL , - [ban_reason] [varchar] (255) NOT NULL , - [ban_give_reason] [varchar] (255) NOT NULL -) ON [PRIMARY] + [ban_reason] [text] , + [ban_give_reason] [text] +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_banlist] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_banlist] PRIMARY KEY CLUSTERED + ( + [ban_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_banlist] WITH NOCHECK ADD + CONSTRAINT [DF_banlis_ban_userid] DEFAULT (0) FOR [ban_userid], + CONSTRAINT [DF_banlis_ban_start] DEFAULT (0) FOR [ban_start], + CONSTRAINT [DF_banlis_ban_end] DEFAULT (0) FOR [ban_end], + CONSTRAINT [DF_banlis_ban_exclude] DEFAULT (0) FOR [ban_exclude] +GO + + +/* + Table: phpbb_bbcodes +*/ CREATE TABLE [phpbb_bbcodes] ( [bbcode_id] [int] NOT NULL , [bbcode_tag] [varchar] (16) NOT NULL , [display_on_posting] [int] NOT NULL , [bbcode_match] [varchar] (255) NOT NULL , - [bbcode_tpl] [text] NOT NULL , + [bbcode_tpl] [text] , [first_pass_match] [varchar] (255) NOT NULL , [first_pass_replace] [varchar] (255) NOT NULL , [second_pass_match] [varchar] (255) NOT NULL , - [second_pass_replace] [text] NOT NULL + [second_pass_replace] [text] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_bbcodes] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_bbcodes] PRIMARY KEY CLUSTERED + ( + [bbcode_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_bbcodes] WITH NOCHECK ADD + CONSTRAINT [DF_bbcode_bbcode_id] DEFAULT (0) FOR [bbcode_id], + CONSTRAINT [DF_bbcode_display_on_posting] DEFAULT (0) FOR [display_on_posting] +GO + +CREATE INDEX [display_on_posting] ON [phpbb_bbcodes]([display_on_posting]) ON [PRIMARY] +GO + + +/* + Table: phpbb_bookmarks +*/ CREATE TABLE [phpbb_bookmarks] ( [topic_id] [int] NOT NULL , [user_id] [int] NOT NULL , @@ -103,23 +272,73 @@ CREATE TABLE [phpbb_bookmarks] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_bookmarks] WITH NOCHECK ADD + CONSTRAINT [DF_bookma_topic_id] DEFAULT (0) FOR [topic_id], + CONSTRAINT [DF_bookma_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_bookma_order_id] DEFAULT (0) FOR [order_id] +GO + +CREATE INDEX [order_id] ON [phpbb_bookmarks]([order_id]) ON [PRIMARY] +GO + +CREATE INDEX [topic_user_id] ON [phpbb_bookmarks]([topic_id], [user_id]) ON [PRIMARY] +GO + + +/* + Table: phpbb_bots +*/ CREATE TABLE [phpbb_bots] ( [bot_id] [int] IDENTITY (1, 1) NOT NULL , [bot_active] [int] NOT NULL , - [bot_name] [varchar] (255) NOT NULL , + [bot_name] [text] , [user_id] [int] NOT NULL , [bot_agent] [varchar] (255) NOT NULL , [bot_ip] [varchar] (255) NOT NULL -) ON [PRIMARY] +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +ALTER TABLE [phpbb_bots] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_bots] PRIMARY KEY CLUSTERED + ( + [bot_id] + ) ON [PRIMARY] GO +ALTER TABLE [phpbb_bots] WITH NOCHECK ADD + CONSTRAINT [DF_bots___bot_active] DEFAULT (1) FOR [bot_active], + CONSTRAINT [DF_bots___user_id] DEFAULT (0) FOR [user_id] +GO + +CREATE INDEX [bot_active] ON [phpbb_bots]([bot_active]) ON [PRIMARY] +GO + + +/* + Table: phpbb_cache +*/ CREATE TABLE [phpbb_cache] ( [var_name] [varchar] (255) NOT NULL , [var_expires] [int] NOT NULL , - [var_data] [text] NOT NULL + [var_data] [text] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_cache] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_cache] PRIMARY KEY CLUSTERED + ( + [var_name] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_cache] WITH NOCHECK ADD + CONSTRAINT [DF_cache__var_expires] DEFAULT (0) FOR [var_expires] +GO + + +/* + Table: phpbb_config +*/ CREATE TABLE [phpbb_config] ( [config_name] [varchar] (255) NOT NULL , [config_value] [varchar] (255) NOT NULL , @@ -127,6 +346,24 @@ CREATE TABLE [phpbb_config] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_config] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_config] PRIMARY KEY CLUSTERED + ( + [config_name] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_config] WITH NOCHECK ADD + CONSTRAINT [DF_config_is_dynamic] DEFAULT (0) FOR [is_dynamic] +GO + +CREATE INDEX [is_dynamic] ON [phpbb_config]([is_dynamic]) ON [PRIMARY] +GO + + +/* + Table: phpbb_confirm +*/ CREATE TABLE [phpbb_confirm] ( [confirm_id] [varchar] (32) NOT NULL , [session_id] [varchar] (32) NOT NULL , @@ -135,36 +372,103 @@ CREATE TABLE [phpbb_confirm] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_confirm] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_confirm] PRIMARY KEY CLUSTERED + ( + [session_id], + [confirm_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_confirm] WITH NOCHECK ADD + CONSTRAINT [DF_confirm_confirm_type] DEFAULT (0) FOR [confirm_type] +GO + + +/* + Table: phpbb_disallow +*/ CREATE TABLE [phpbb_disallow] ( [disallow_id] [int] IDENTITY (1, 1) NOT NULL , - [disallow_username] [varchar] (30) NOT NULL + [disallow_username] [varchar] (255) NOT NULL ) ON [PRIMARY] GO +ALTER TABLE [phpbb_disallow] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_disallow] PRIMARY KEY CLUSTERED + ( + [disallow_id] + ) ON [PRIMARY] +GO + + +/* + Table: phpbb_drafts +*/ CREATE TABLE [phpbb_drafts] ( [draft_id] [int] IDENTITY (1, 1) NOT NULL , [user_id] [int] NOT NULL , [topic_id] [int] NOT NULL , [forum_id] [int] NOT NULL , [save_time] [int] NOT NULL , - [draft_subject] [varchar] (60) NULL , - [draft_message] [text] NOT NULL + [draft_subject] [text] , + [draft_message] [text] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_drafts] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_drafts] PRIMARY KEY CLUSTERED + ( + [draft_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_drafts] WITH NOCHECK ADD + CONSTRAINT [DF_drafts_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_drafts_topic_id] DEFAULT (0) FOR [topic_id], + CONSTRAINT [DF_drafts_forum_id] DEFAULT (0) FOR [forum_id], + CONSTRAINT [DF_drafts_save_time] DEFAULT (0) FOR [save_time] +GO + +CREATE INDEX [save_time] ON [phpbb_drafts]([save_time]) ON [PRIMARY] +GO + + +/* + Table: phpbb_extension_groups +*/ CREATE TABLE [phpbb_extension_groups] ( [group_id] [int] IDENTITY (1, 1) NOT NULL , - [group_name] [varchar] (20) NOT NULL , + [group_name] [varchar] (255) NOT NULL , [cat_id] [int] NOT NULL , [allow_group] [int] NOT NULL , [download_mode] [int] NOT NULL , - [upload_icon] [varchar] (100) NOT NULL , + [upload_icon] [varchar] (255) NOT NULL , [max_filesize] [int] NOT NULL , - [allowed_forums] [text] NOT NULL , + [allowed_forums] [text] , [allow_in_pm] [int] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_extension_groups] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_extension_groups] PRIMARY KEY CLUSTERED + ( + [group_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_extension_groups] WITH NOCHECK ADD + CONSTRAINT [DF_extens_cat_id] DEFAULT (0) FOR [cat_id], + CONSTRAINT [DF_extens_allow_group] DEFAULT (0) FOR [allow_group], + CONSTRAINT [DF_extens_download_mode] DEFAULT (1) FOR [download_mode], + CONSTRAINT [DF_extens_max_filesize] DEFAULT (0) FOR [max_filesize], + CONSTRAINT [DF_extens_allow_in_pm] DEFAULT (0) FOR [allow_in_pm] +GO + + +/* + Table: phpbb_extensions +*/ CREATE TABLE [phpbb_extensions] ( [extension_id] [int] IDENTITY (1, 1) NOT NULL , [group_id] [int] NOT NULL , @@ -172,29 +476,37 @@ CREATE TABLE [phpbb_extensions] ( ) ON [PRIMARY] GO -CREATE TABLE [phpbb_forum_access] ( - [forum_id] [int] NOT NULL , - [user_id] [int] NOT NULL , - [session_id] [varchar] (32) NOT NULL -) ON [PRIMARY] +ALTER TABLE [phpbb_extensions] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_extensions] PRIMARY KEY CLUSTERED + ( + [extension_id] + ) ON [PRIMARY] GO +ALTER TABLE [phpbb_extensions] WITH NOCHECK ADD + CONSTRAINT [DF_extens_group_id] DEFAULT (0) FOR [group_id] +GO + + +/* + Table: phpbb_forums +*/ CREATE TABLE [phpbb_forums] ( [forum_id] [int] IDENTITY (1, 1) NOT NULL , [parent_id] [int] NOT NULL , [left_id] [int] NOT NULL , [right_id] [int] NOT NULL , [forum_parents] [text] NULL , - [forum_name] [varchar] (150) NOT NULL , - [forum_desc] [text] NULL , + [forum_name] [text] , + [forum_desc] [text] , [forum_desc_bitfield] [int] NOT NULL , [forum_desc_uid] [varchar] (5) NOT NULL , - [forum_link] [varchar] (200) NOT NULL , - [forum_password] [varchar] (32) NOT NULL , + [forum_link] [varchar] (255) NOT NULL , + [forum_password] [varchar] (40) NOT NULL , [forum_style] [int] NULL , - [forum_image] [varchar] (50) NOT NULL , - [forum_rules] [text] NOT NULL , - [forum_rules_link] [varchar] (200) NOT NULL , + [forum_image] [varchar] (255) NOT NULL , + [forum_rules] [text] , + [forum_rules_link] [varchar] (255) NOT NULL , [forum_rules_bitfield] [int] NOT NULL , [forum_rules_uid] [varchar] (5) NOT NULL , [forum_topics_per_page] [int] NOT NULL , @@ -206,7 +518,7 @@ CREATE TABLE [phpbb_forums] ( [forum_last_post_id] [int] NOT NULL , [forum_last_poster_id] [int] NOT NULL , [forum_last_post_time] [int] NOT NULL , - [forum_last_poster_name] [varchar] (30) NULL , + [forum_last_poster_name] [varchar] (255) NULL , [forum_flags] [int] NOT NULL , [display_on_index] [int] NOT NULL , [enable_indexing] [int] NOT NULL , @@ -219,6 +531,73 @@ CREATE TABLE [phpbb_forums] ( ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_forums] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_forums] PRIMARY KEY CLUSTERED + ( + [forum_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_forums] WITH NOCHECK ADD + CONSTRAINT [DF_forums_parent_id] DEFAULT (0) FOR [parent_id], + CONSTRAINT [DF_forums_left_id] DEFAULT (0) FOR [left_id], + CONSTRAINT [DF_forums_right_id] DEFAULT (0) FOR [right_id], + CONSTRAINT [DF_forums_desc_bitfield] DEFAULT (0) FOR [forum_desc_bitfield], + CONSTRAINT [DF_forums_rules_bitfield] DEFAULT (0) FOR [forum_rules_bitfield], + CONSTRAINT [DF_forums_topics_per_page] DEFAULT (0) FOR [forum_topics_per_page], + CONSTRAINT [DF_forums_forum_type] DEFAULT (0) FOR [forum_type], + CONSTRAINT [DF_forums_forum_status] DEFAULT (0) FOR [forum_status], + CONSTRAINT [DF_forums_forum_posts] DEFAULT (0) FOR [forum_posts], + CONSTRAINT [DF_forums_forum_topics] DEFAULT (0) FOR [forum_topics], + CONSTRAINT [DF_forums_forum_topics_real] DEFAULT (0) FOR [forum_topics_real], + CONSTRAINT [DF_forums_forum_last_post_id] DEFAULT (0) FOR [forum_last_post_id], + CONSTRAINT [DF_forums_forum_last_poster_id] DEFAULT (0) FOR [forum_last_poster_id], + CONSTRAINT [DF_forums_forum_last_post_time] DEFAULT (0) FOR [forum_last_post_time], + CONSTRAINT [DF_forums_forum_flags] DEFAULT (0) FOR [forum_flags], + CONSTRAINT [DF_forums_display_on_index] DEFAULT (1) FOR [display_on_index], + CONSTRAINT [DF_forums_enable_indexing] DEFAULT (1) FOR [enable_indexing], + CONSTRAINT [DF_forums_enable_icons] DEFAULT (1) FOR [enable_icons], + CONSTRAINT [DF_forums_enable_prune] DEFAULT (0) FOR [enable_prune], + CONSTRAINT [DF_forums_prune_days] DEFAULT (0) FOR [prune_days], + CONSTRAINT [DF_forums_prune_viewed] DEFAULT (0) FOR [prune_viewed], + CONSTRAINT [DF_forums_prune_freq] DEFAULT (0) FOR [prune_freq] +GO + +CREATE INDEX [left_right_id] ON [phpbb_forums]([left_id], [right_id]) ON [PRIMARY] +GO + +CREATE INDEX [forum_last_post_id] ON [phpbb_forums]([forum_last_post_id]) ON [PRIMARY] +GO + + +/* + Table: phpbb_forum_access +*/ +CREATE TABLE [phpbb_forum_access] ( + [forum_id] [int] NOT NULL , + [user_id] [int] NOT NULL , + [session_id] [varchar] (32) NOT NULL +) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_forum_access] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_forum_access] PRIMARY KEY CLUSTERED + ( + [forum_id], + [user_id], + [session_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_forum_access] WITH NOCHECK ADD + CONSTRAINT [DF_forum__forum_id] DEFAULT (0) FOR [forum_id], + CONSTRAINT [DF_forum__user_id] DEFAULT (0) FOR [user_id] +GO + + +/* + Table: phpbb_forums_marking +*/ CREATE TABLE [phpbb_forums_marking] ( [user_id] [int] NOT NULL , [forum_id] [int] NOT NULL , @@ -226,6 +605,24 @@ CREATE TABLE [phpbb_forums_marking] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_forums_marking] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_forums_marking] PRIMARY KEY CLUSTERED + ( + [user_id], + [forum_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_forums_marking] WITH NOCHECK ADD + CONSTRAINT [DF_forumm_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_forumm_forum_id] DEFAULT (0) FOR [forum_id], + CONSTRAINT [DF_forumm_mark_time] DEFAULT (0) FOR [mark_time] +GO + + +/* + Table: phpbb_forums_watch +*/ CREATE TABLE [phpbb_forums_watch] ( [forum_id] [int] NOT NULL , [user_id] [int] NOT NULL , @@ -233,15 +630,34 @@ CREATE TABLE [phpbb_forums_watch] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_forums_watch] WITH NOCHECK ADD + CONSTRAINT [DF_forumw_forum_id] DEFAULT (0) FOR [forum_id], + CONSTRAINT [DF_forumw_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_forumw_notify_status] DEFAULT (0) FOR [notify_status] +GO + +CREATE INDEX [forum_id] ON [phpbb_forums_watch]([forum_id]) ON [PRIMARY] +GO + +CREATE INDEX [user_id] ON [phpbb_forums_watch]([user_id]) ON [PRIMARY] +GO + +CREATE INDEX [notify_status] ON [phpbb_forums_watch]([notify_status]) ON [PRIMARY] +GO + + +/* + Table: phpbb_groups +*/ CREATE TABLE [phpbb_groups] ( [group_id] [int] IDENTITY (1, 1) NOT NULL , [group_type] [int] NOT NULL , - [group_name] [varchar] (40) NOT NULL , - [group_desc] [text] NULL , + [group_name] [varchar] (255) NOT NULL , + [group_desc] [text] , [group_desc_bitfield] [int] NOT NULL , [group_desc_uid] [varchar] (5) NOT NULL , [group_display] [int] NOT NULL , - [group_avatar] [varchar] (100) NOT NULL , + [group_avatar] [varchar] (255) NOT NULL , [group_avatar_type] [int] NOT NULL , [group_avatar_width] [int] NOT NULL , [group_avatar_height] [int] NOT NULL , @@ -252,12 +668,41 @@ CREATE TABLE [phpbb_groups] ( [group_message_limit] [int] NOT NULL , [group_chgpass] [int] NOT NULL , [group_legend] [int] NOT NULL -) ON [PRIMARY] +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +ALTER TABLE [phpbb_groups] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_groups] PRIMARY KEY CLUSTERED + ( + [group_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_groups] WITH NOCHECK ADD + CONSTRAINT [DF_groups_group_type] DEFAULT (1) FOR [group_type], + CONSTRAINT [DF_groups_group_display] DEFAULT (0) FOR [group_display], + CONSTRAINT [DF_groups_group_desc_bitfield] DEFAULT (0) FOR [group_desc_bitfield], + CONSTRAINT [DF_groups_group_avatar_type] DEFAULT (0) FOR [group_avatar_type], + CONSTRAINT [DF_groups_group_avatar_width] DEFAULT (0) FOR [group_avatar_width], + CONSTRAINT [DF_groups_group_avatar_height] DEFAULT (0) FOR [group_avatar_height], + CONSTRAINT [DF_groups_group_rank] DEFAULT ((-1)) FOR [group_rank], + CONSTRAINT [DF_groups_group_sig_chars] DEFAULT (0) FOR [group_sig_chars], + CONSTRAINT [DF_groups_group_receive_pm] DEFAULT (0) FOR [group_receive_pm], + CONSTRAINT [DF_groups_group_message_limit] DEFAULT (0) FOR [group_message_limit], + CONSTRAINT [DF_groups_group_chgpass] DEFAULT (0) FOR [group_chgpass], + CONSTRAINT [DF_groups_group_legend] DEFAULT (1) FOR [group_legend] GO +CREATE INDEX [group_legend] ON [phpbb_groups]([group_legend]) ON [PRIMARY] +GO + + +/* + Table: phpbb_icons +*/ CREATE TABLE [phpbb_icons] ( [icons_id] [int] IDENTITY (1, 1) NOT NULL , - [icons_url] [varchar] (50) NULL , + [icons_url] [varchar] (255) NULL , [icons_width] [int] NOT NULL , [icons_height] [int] NOT NULL , [icons_order] [int] NOT NULL , @@ -265,16 +710,45 @@ CREATE TABLE [phpbb_icons] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_icons] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_icons] PRIMARY KEY CLUSTERED + ( + [icons_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_icons] WITH NOCHECK ADD + CONSTRAINT [DF_icons__icons_width] DEFAULT (0) FOR [icons_width], + CONSTRAINT [DF_icons__icons_height] DEFAULT (0) FOR [icons_height], + CONSTRAINT [DF_icons__icons_order] DEFAULT (0) FOR [icons_order], + CONSTRAINT [DF_icons__display_on_posting] DEFAULT (1) FOR [display_on_posting] +GO + + +/* + Table: phpbb_lang +*/ CREATE TABLE [phpbb_lang] ( [lang_id] [int] IDENTITY (1, 1) NOT NULL , [lang_iso] [varchar] (5) NOT NULL , [lang_dir] [varchar] (30) NOT NULL , - [lang_english_name] [varchar] (30) NULL , - [lang_local_name] [varchar] (100) NULL , - [lang_author] [varchar] (100) NULL + [lang_english_name] [varchar] (100) NULL , + [lang_local_name] [varchar] (255) NULL , + [lang_author] [varchar] (255) NULL ) ON [PRIMARY] GO +ALTER TABLE [phpbb_lang] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_lang] PRIMARY KEY CLUSTERED + ( + [lang_id] + ) ON [PRIMARY] +GO + + +/* + Table: phpbb_log +*/ CREATE TABLE [phpbb_log] ( [log_id] [int] IDENTITY (1, 1) NOT NULL , [log_type] [int] NOT NULL , @@ -284,44 +758,134 @@ CREATE TABLE [phpbb_log] ( [reportee_id] [int] NOT NULL , [log_ip] [varchar] (40) NOT NULL , [log_time] [int] NOT NULL , - [log_operation] [text] NULL , - [log_data] [text] NULL + [log_operation] [text] , + [log_data] [text] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_log] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_log] PRIMARY KEY CLUSTERED + ( + [log_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_log] WITH NOCHECK ADD + CONSTRAINT [DF_log____log_type] DEFAULT (0) FOR [log_type], + CONSTRAINT [DF_log____user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_log____forum_id] DEFAULT (0) FOR [forum_id], + CONSTRAINT [DF_log____topic_id] DEFAULT (0) FOR [topic_id], + CONSTRAINT [DF_log____reportee_id] DEFAULT (0) FOR [reportee_id], + CONSTRAINT [DF_log____log_time] DEFAULT (0) FOR [log_time] +GO + +CREATE INDEX [log_type] ON [phpbb_log]([log_type]) ON [PRIMARY] +GO + +CREATE INDEX [forum_id] ON [phpbb_log]([forum_id]) ON [PRIMARY] +GO + +CREATE INDEX [topic_id] ON [phpbb_log]([topic_id]) ON [PRIMARY] +GO + +CREATE INDEX [reportee_id] ON [phpbb_log]([reportee_id]) ON [PRIMARY] +GO + +CREATE INDEX [user_id] ON [phpbb_log]([user_id]) ON [PRIMARY] +GO + + +/* + Table: phpbb_moderator_cache +*/ CREATE TABLE [phpbb_moderator_cache] ( [forum_id] [int] NOT NULL , [user_id] [int] NOT NULL , - [username] [varchar] (30) NOT NULL , + [username] [varchar] (255) NOT NULL , [group_id] [int] NOT NULL , - [groupname] [varchar] (30) NOT NULL , + [group_name] [varchar] (255) NOT NULL , [display_on_index] [int] NOT NULL ) ON [PRIMARY] GO +ALTER TABLE [phpbb_moderator_cache] WITH NOCHECK ADD + CONSTRAINT [DF_modera_forum_id] DEFAULT (0) FOR [forum_id], + CONSTRAINT [DF_modera_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_modera_group_id] DEFAULT (0) FOR [group_id], + CONSTRAINT [DF_modera_display_on_index] DEFAULT (1) FOR [display_on_index] +GO + +CREATE INDEX [display_on_index] ON [phpbb_moderator_cache]([display_on_index]) ON [PRIMARY] +GO + +CREATE INDEX [forum_id] ON [phpbb_moderator_cache]([forum_id]) ON [PRIMARY] +GO + + +/* + Table: phpbb_modules +*/ CREATE TABLE [phpbb_modules] ( [module_id] [int] IDENTITY (1, 1) NOT NULL , [module_enabled] [int] NOT NULL , [module_display] [int] NOT NULL , - [module_name] [varchar] (20) NOT NULL , - [module_class] [varchar] (4) NOT NULL , + [module_name] [varchar] (255) NOT NULL , + [module_class] [varchar] (10) NOT NULL , [parent_id] [int] NOT NULL , [left_id] [int] NOT NULL , [right_id] [int] NOT NULL , - [module_langname] [varchar] (50) NOT NULL , + [module_langname] [varchar] (255) NOT NULL , [module_mode] [varchar] (255) NOT NULL , [module_auth] [varchar] (255) NOT NULL ) ON [PRIMARY] GO +ALTER TABLE [phpbb_modules] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_modules] PRIMARY KEY CLUSTERED + ( + [module_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_modules] WITH NOCHECK ADD + CONSTRAINT [DF_module_module_enabled] DEFAULT (1) FOR [module_enabled], + CONSTRAINT [DF_module_module_display] DEFAULT (1) FOR [module_display] +GO + +CREATE INDEX [module_enabled] ON [phpbb_modules]([module_enabled]) ON [PRIMARY] +GO + +CREATE INDEX [module_left_right_id] ON [phpbb_modules]([left_id], [right_id]) ON [PRIMARY] +GO + + +/* + Table: phpbb_poll_results +*/ CREATE TABLE [phpbb_poll_results] ( [poll_option_id] [int] NOT NULL , [topic_id] [int] NOT NULL , - [poll_option_text] [varchar] (255) NOT NULL , + [poll_option_text] [text] , [poll_option_total] [int] NOT NULL -) ON [PRIMARY] +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_poll_results] WITH NOCHECK ADD + CONSTRAINT [DF_poll_r_poll_option_id] DEFAULT (0) FOR [poll_option_id], + CONSTRAINT [DF_poll_r_topic_id] DEFAULT (0) FOR [topic_id], + CONSTRAINT [DF_poll_r_poll_option_total] DEFAULT (0) FOR [poll_option_total] +GO + +CREATE INDEX [poll_option_id] ON [phpbb_poll_results]([poll_option_id]) ON [PRIMARY] +GO + +CREATE INDEX [topic_id] ON [phpbb_poll_results]([topic_id]) ON [PRIMARY] +GO + + +/* + Table: phpbb_poll_voters +*/ CREATE TABLE [phpbb_poll_voters] ( [topic_id] [int] NOT NULL , [poll_option_id] [int] NOT NULL , @@ -330,6 +894,25 @@ CREATE TABLE [phpbb_poll_voters] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_poll_voters] WITH NOCHECK ADD + CONSTRAINT [DF_poll_v_topic_id] DEFAULT (0) FOR [topic_id], + CONSTRAINT [DF_poll_v_poll_option_id] DEFAULT (0) FOR [poll_option_id], + CONSTRAINT [DF_poll_v_vote_user_id] DEFAULT (0) FOR [vote_user_id] +GO + +CREATE INDEX [topic_id] ON [phpbb_poll_voters]([topic_id]) ON [PRIMARY] +GO + +CREATE INDEX [vote_user_id] ON [phpbb_poll_voters]([vote_user_id]) ON [PRIMARY] +GO + +CREATE INDEX [vote_user_ip] ON [phpbb_poll_voters]([vote_user_ip]) ON [PRIMARY] +GO + + +/* + Table: phpbb_posts +*/ CREATE TABLE [phpbb_posts] ( [post_id] [int] IDENTITY (1, 1) NOT NULL , [topic_id] [int] NOT NULL , @@ -344,22 +927,72 @@ CREATE TABLE [phpbb_posts] ( [enable_smilies] [int] NOT NULL , [enable_magic_url] [int] NOT NULL , [enable_sig] [int] NOT NULL , - [post_username] [varchar] (30) NULL , - [post_subject] [varchar] (60) NULL , - [post_text] [text] NULL , + [post_username] [varchar] (255) NULL , + [post_subject] [text] , + [post_text] [text] , [post_checksum] [varchar] (32) NOT NULL , [post_encoding] [varchar] (20) NOT NULL , [post_attachment] [int] NOT NULL , [bbcode_bitfield] [int] NOT NULL , [bbcode_uid] [varchar] (5) NOT NULL , [post_edit_time] [int] NOT NULL , - [post_edit_reason] [varchar] (100) NULL , + [post_edit_reason] [text] , [post_edit_user] [int] NOT NULL , [post_edit_count] [int] NOT NULL , [post_edit_locked] [int] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_posts] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_posts] PRIMARY KEY CLUSTERED + ( + [post_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_posts] WITH NOCHECK ADD + CONSTRAINT [DF_posts__topic_id] DEFAULT (0) FOR [topic_id], + CONSTRAINT [DF_posts__forum_id] DEFAULT (0) FOR [forum_id], + CONSTRAINT [DF_posts__poster_id] DEFAULT (0) FOR [poster_id], + CONSTRAINT [DF_posts__icon_id] DEFAULT (1) FOR [icon_id], + CONSTRAINT [DF_posts__post_time] DEFAULT (0) FOR [post_time], + CONSTRAINT [DF_posts__post_approved] DEFAULT (1) FOR [post_approved], + CONSTRAINT [DF_posts__post_reported] DEFAULT (0) FOR [post_reported], + CONSTRAINT [DF_posts__enable_bbcode] DEFAULT (1) FOR [enable_bbcode], + CONSTRAINT [DF_posts__enable_smilies] DEFAULT (1) FOR [enable_smilies], + CONSTRAINT [DF_posts__enable_magic_url] DEFAULT (1) FOR [enable_magic_url], + CONSTRAINT [DF_posts__enable_sig] DEFAULT (1) FOR [enable_sig], + CONSTRAINT [DF_posts__post_encoding] DEFAULT ('iso-8859-1') FOR [post_encoding], + CONSTRAINT [DF_posts__post_attachment] DEFAULT (0) FOR [post_attachment], + CONSTRAINT [DF_posts__bbcode_bitfield] DEFAULT (0) FOR [bbcode_bitfield], + CONSTRAINT [DF_posts__post_edit_time] DEFAULT (0) FOR [post_edit_time], + CONSTRAINT [DF_posts__post_edit_user] DEFAULT (0) FOR [post_edit_user], + CONSTRAINT [DF_posts__post_edit_count] DEFAULT (0) FOR [post_edit_count], + CONSTRAINT [DF_posts__post_edit_locked] DEFAULT (0) FOR [post_edit_locked] +GO + +CREATE INDEX [forum_id] ON [phpbb_posts]([forum_id]) ON [PRIMARY] +GO + +CREATE INDEX [topic_id] ON [phpbb_posts]([topic_id]) ON [PRIMARY] +GO + +CREATE INDEX [poster_ip] ON [phpbb_posts]([poster_ip]) ON [PRIMARY] +GO + +CREATE INDEX [poster_id] ON [phpbb_posts]([poster_id]) ON [PRIMARY] +GO + +CREATE INDEX [post_approved] ON [phpbb_posts]([post_approved]) ON [PRIMARY] +GO + +CREATE INDEX [post_time] ON [phpbb_posts]([post_time]) ON [PRIMARY] +GO + + +/* + Table: phpbb_privmsgs +*/ CREATE TABLE [phpbb_privmsgs] ( [msg_id] [int] IDENTITY (1, 1) NOT NULL , [root_level] [int] NOT NULL , @@ -371,9 +1004,9 @@ CREATE TABLE [phpbb_privmsgs] ( [enable_smilies] [int] NOT NULL , [enable_magic_url] [int] NOT NULL , [enable_sig] [int] NOT NULL , - [message_subject] [varchar] (60) NULL , - [message_text] [text] NULL , - [message_edit_reason] [varchar] (100) NULL , + [message_subject] [text] , + [message_text] [text] , + [message_edit_reason] [text] , [message_edit_user] [int] NOT NULL , [message_encoding] [varchar] (20) NOT NULL , [message_attachment] [int] NOT NULL , @@ -386,14 +1019,73 @@ CREATE TABLE [phpbb_privmsgs] ( ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_privmsgs] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_privmsgs] PRIMARY KEY CLUSTERED + ( + [msg_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_privmsgs] WITH NOCHECK ADD + CONSTRAINT [DF_privms_root_level] DEFAULT (0) FOR [root_level], + CONSTRAINT [DF_privms_author_id] DEFAULT (0) FOR [author_id], + CONSTRAINT [DF_privms_icon_id] DEFAULT (1) FOR [icon_id], + CONSTRAINT [DF_privms_message_time] DEFAULT (0) FOR [message_time], + CONSTRAINT [DF_privms_enable_bbcode] DEFAULT (1) FOR [enable_bbcode], + CONSTRAINT [DF_privms_enable_smilies] DEFAULT (1) FOR [enable_smilies], + CONSTRAINT [DF_privms_enable_magic_url] DEFAULT (1) FOR [enable_magic_url], + CONSTRAINT [DF_privms_enable_sig] DEFAULT (1) FOR [enable_sig], + CONSTRAINT [DF_privms_message_edit_user] DEFAULT (0) FOR [message_edit_user], + CONSTRAINT [DF_privms_message_encoding] DEFAULT ('iso-8859-1') FOR [message_encoding], + CONSTRAINT [DF_privms_message_attachment] DEFAULT (0) FOR [message_attachment], + CONSTRAINT [DF_privms_bbcode_bitfield] DEFAULT (0) FOR [bbcode_bitfield], + CONSTRAINT [DF_privms_message_edit_time] DEFAULT (0) FOR [message_edit_time], + CONSTRAINT [DF_privms_message_edit_count] DEFAULT (0) FOR [message_edit_count] +GO + +CREATE INDEX [author_ip] ON [phpbb_privmsgs]([author_ip]) ON [PRIMARY] +GO + +CREATE INDEX [message_time] ON [phpbb_privmsgs]([message_time]) ON [PRIMARY] +GO + +CREATE INDEX [author_id] ON [phpbb_privmsgs]([author_id]) ON [PRIMARY] +GO + +CREATE INDEX [root_level] ON [phpbb_privmsgs]([root_level]) ON [PRIMARY] +GO + + +/* + Table: phpbb_privmsgs_folder +*/ CREATE TABLE [phpbb_privmsgs_folder] ( [folder_id] [int] IDENTITY (1, 1) NOT NULL , [user_id] [int] NOT NULL , - [folder_name] [varchar] (40) NOT NULL , + [folder_name] [varchar] (255) NOT NULL , [pm_count] [int] NOT NULL ) ON [PRIMARY] GO +ALTER TABLE [phpbb_privmsgs_folder] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_privmsgs_folder] PRIMARY KEY CLUSTERED + ( + [folder_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_privmsgs_folder] WITH NOCHECK ADD + CONSTRAINT [DF_pmfold_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_pmfold_pm_count] DEFAULT (0) FOR [pm_count] +GO + +CREATE INDEX [user_id] ON [phpbb_privmsgs_folder]([user_id]) ON [PRIMARY] +GO + + +/* + Table: phpbb_privmsgs_rules +*/ CREATE TABLE [phpbb_privmsgs_rules] ( [rule_id] [int] IDENTITY (1, 1) NOT NULL , [user_id] [int] NOT NULL , @@ -407,6 +1099,27 @@ CREATE TABLE [phpbb_privmsgs_rules] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_privmsgs_rules] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_privmsgs_rules] PRIMARY KEY CLUSTERED + ( + [rule_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_privmsgs_rules] WITH NOCHECK ADD + CONSTRAINT [DF_pmrule_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_pmrule_rule_check] DEFAULT (0) FOR [rule_check], + CONSTRAINT [DF_pmrule_rule_connection] DEFAULT (0) FOR [rule_connection], + CONSTRAINT [DF_pmrule_rule_user_id] DEFAULT (0) FOR [rule_user_id], + CONSTRAINT [DF_pmrule_rule_group_id] DEFAULT (0) FOR [rule_group_id], + CONSTRAINT [DF_pmrule_rule_action] DEFAULT (0) FOR [rule_action], + CONSTRAINT [DF_pmrule_rule_folder_id] DEFAULT (0) FOR [rule_folder_id] +GO + + +/* + Table: phpbb_privmsgs_to +*/ CREATE TABLE [phpbb_privmsgs_to] ( [msg_id] [int] NOT NULL , [user_id] [int] NOT NULL , @@ -421,10 +1134,33 @@ CREATE TABLE [phpbb_privmsgs_to] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_privmsgs_to] WITH NOCHECK ADD + CONSTRAINT [DF_pmto___msg_id] DEFAULT (0) FOR [msg_id], + CONSTRAINT [DF_pmto___user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_pmto___author_id] DEFAULT (0) FOR [author_id], + CONSTRAINT [DF_pmto___deleted] DEFAULT (0) FOR [deleted], + CONSTRAINT [DF_pmto___new] DEFAULT (1) FOR [new], + CONSTRAINT [DF_pmto___unread] DEFAULT (1) FOR [unread], + CONSTRAINT [DF_pmto___replied] DEFAULT (0) FOR [replied], + CONSTRAINT [DF_pmto___marked] DEFAULT (0) FOR [marked], + CONSTRAINT [DF_pmto___forwarded] DEFAULT (0) FOR [forwarded], + CONSTRAINT [DF_pmto___folder_id] DEFAULT (0) FOR [folder_id] +GO + +CREATE INDEX [msg_id] ON [phpbb_privmsgs_to]([msg_id]) ON [PRIMARY] +GO + +CREATE INDEX [user_id] ON [phpbb_privmsgs_to]([user_id], [folder_id]) ON [PRIMARY] +GO + + +/* + Table: phpbb_profile_fields +*/ CREATE TABLE [phpbb_profile_fields] ( [field_id] [int] IDENTITY (1, 1) NOT NULL , - [field_name] [varchar] (50) NOT NULL , - [field_desc] [varchar] (255) NOT NULL , + [field_name] [varchar] (255) NOT NULL , + [field_desc] [text] , [field_type] [int] NOT NULL , [field_ident] [varchar] (20) NOT NULL , [field_length] [varchar] (20) NOT NULL , @@ -439,14 +1175,57 @@ CREATE TABLE [phpbb_profile_fields] ( [field_no_view] [int] NOT NULL , [field_active] [int] NOT NULL , [field_order] [int] NOT NULL -) ON [PRIMARY] +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +ALTER TABLE [phpbb_profile_fields] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_profile_fields] PRIMARY KEY CLUSTERED + ( + [field_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_profile_fields] WITH NOCHECK ADD + CONSTRAINT [DF_pffiel_field_type] DEFAULT (0) FOR [field_type], + CONSTRAINT [DF_pffiel_field_default_value] DEFAULT ('0') FOR [field_default_value], + CONSTRAINT [DF_pffiel_field_required] DEFAULT (0) FOR [field_required], + CONSTRAINT [DF_pffiel_field_show_on_reg] DEFAULT (0) FOR [field_show_on_reg], + CONSTRAINT [DF_pffiel_field_hide] DEFAULT (0) FOR [field_hide], + CONSTRAINT [DF_pffiel_field_no_view] DEFAULT (0) FOR [field_no_view], + CONSTRAINT [DF_pffiel_field_active] DEFAULT (0) FOR [field_active], + CONSTRAINT [DF_pffiel_field_order] DEFAULT (0) FOR [field_order] GO +CREATE INDEX [field_type] ON [phpbb_profile_fields]([field_type]) ON [PRIMARY] +GO + +CREATE INDEX [field_order] ON [phpbb_profile_fields]([field_order]) ON [PRIMARY] +GO + + +/* + Table: phpbb_profile_fields_data +*/ CREATE TABLE [phpbb_profile_fields_data] ( [user_id] [int] NOT NULL ) ON [PRIMARY] GO +ALTER TABLE [phpbb_profile_fields_data] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_profile_fields_data] PRIMARY KEY CLUSTERED + ( + [user_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_profile_fields_data] WITH NOCHECK ADD + CONSTRAINT [DF_pfdata_user_id] DEFAULT (0) FOR [user_id] +GO + + +/* + Table: phpbb_profile_fields_lang +*/ CREATE TABLE [phpbb_profile_fields_lang] ( [field_id] [int] NOT NULL , [lang_id] [int] NOT NULL , @@ -456,24 +1235,77 @@ CREATE TABLE [phpbb_profile_fields_lang] ( ) ON [PRIMARY] 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] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_profile_fields_lang] WITH NOCHECK ADD + CONSTRAINT [DF_pfflan_field_id] DEFAULT (0) FOR [field_id], + CONSTRAINT [DF_pfflan_lang_id] DEFAULT (0) FOR [lang_id], + CONSTRAINT [DF_pfflan_option_id] DEFAULT (0) FOR [option_id], + CONSTRAINT [DF_pfflan_field_type] DEFAULT (0) FOR [field_type] +GO + + +/* + Table: phpbb_profile_lang +*/ CREATE TABLE [phpbb_profile_lang] ( [field_id] [int] NOT NULL , [lang_id] [int] NOT NULL , [lang_name] [varchar] (255) NOT NULL , - [lang_explain] [text] NOT NULL , + [lang_explain] [text] , [lang_default_value] [varchar] (255) NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_profile_lang] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_profile_lang] PRIMARY KEY CLUSTERED + ( + [field_id], + [lang_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_profile_lang] WITH NOCHECK ADD + CONSTRAINT [DF_pflang_field_id] DEFAULT (0) FOR [field_id], + CONSTRAINT [DF_pflang_lang_id] DEFAULT (0) FOR [lang_id] +GO + + +/* + Table: phpbb_ranks +*/ CREATE TABLE [phpbb_ranks] ( [rank_id] [int] IDENTITY (1, 1) NOT NULL , - [rank_title] [varchar] (50) NOT NULL , + [rank_title] [varchar] (255) NOT NULL , [rank_min] [int] NOT NULL , [rank_special] [int] NULL , - [rank_image] [varchar] (100) NULL + [rank_image] [varchar] (255) NULL ) ON [PRIMARY] GO +ALTER TABLE [phpbb_ranks] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_ranks] PRIMARY KEY CLUSTERED + ( + [rank_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_ranks] WITH NOCHECK ADD + CONSTRAINT [DF_ranks__rank_min] DEFAULT (0) FOR [rank_min], + CONSTRAINT [DF_ranks__rank_special] DEFAULT (0) FOR [rank_special] +GO + + +/* + Table: phpbb_reports +*/ CREATE TABLE [phpbb_reports] ( [report_id] [int] IDENTITY (1, 1) NOT NULL , [reason_id] [int] NOT NULL , @@ -482,26 +1314,76 @@ CREATE TABLE [phpbb_reports] ( [user_notify] [int] NOT NULL , [report_closed] [int] NOT NULL , [report_time] [int] NOT NULL , - [report_text] [text] NOT NULL + [report_text] [text] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_reports] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_reports] PRIMARY KEY CLUSTERED + ( + [report_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_reports] WITH NOCHECK ADD + CONSTRAINT [DF_report_reason_id] DEFAULT (0) FOR [reason_id], + CONSTRAINT [DF_report_post_id] DEFAULT (0) FOR [post_id], + CONSTRAINT [DF_report_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_report_user_notify] DEFAULT (0) FOR [user_notify], + CONSTRAINT [DF_report_report_closed] DEFAULT (0) FOR [report_closed], + CONSTRAINT [DF_report_report_time] DEFAULT (0) FOR [report_time] +GO + + +/* + Table: phpbb_reports_reasons +*/ CREATE TABLE [phpbb_reports_reasons] ( [reason_id] [int] IDENTITY (1, 1) NOT NULL , [reason_title] [varchar] (255) NOT NULL , - [reason_description] [text] NOT NULL , + [reason_description] [text] , [reason_order] [int] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_reports_reasons] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_reports_reasons] PRIMARY KEY CLUSTERED + ( + [reason_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_reports_reasons] WITH NOCHECK ADD + CONSTRAINT [DF_reporr_reason_order] DEFAULT (0) FOR [reason_order] +GO + + +/* + Table: phpbb_search_results +*/ CREATE TABLE [phpbb_search_results] ( [search_key] [varchar] (32) NOT NULL , [search_time] [int] NOT NULL , - [search_keywords] [text] NOT NULL , - [search_authors] [text] NOT NULL + [search_keywords] [text] , + [search_authors] [text] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_search_results] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_search_results] PRIMARY KEY CLUSTERED + ( + [search_key] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_search_results] WITH NOCHECK ADD + CONSTRAINT [DF_search_search_time] DEFAULT (0) FOR [search_time] +GO + + +/* + Table: phpbb_search_wordlist +*/ CREATE TABLE [phpbb_search_wordlist] ( [word_text] [nvarchar] (50) NOT NULL , [word_id] [int] IDENTITY (1, 1) NOT NULL , @@ -509,6 +1391,24 @@ CREATE TABLE [phpbb_search_wordlist] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_search_wordlist] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_search_wordlist] PRIMARY KEY CLUSTERED + ( + [word_text] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_search_wordlist] WITH NOCHECK ADD + CONSTRAINT [DF_swlist_word_common] DEFAULT (0) FOR [word_common] +GO + +CREATE INDEX [word_id] ON [phpbb_search_wordlist]([word_id]) ON [PRIMARY] +GO + + +/* + Table: phpbb_search_wordmatch +*/ CREATE TABLE [phpbb_search_wordmatch] ( [post_id] [int] NOT NULL , [word_id] [int] NOT NULL , @@ -516,6 +1416,19 @@ CREATE TABLE [phpbb_search_wordmatch] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_search_wordmatch] WITH NOCHECK ADD + CONSTRAINT [DF_swmatc_post_id] DEFAULT (0) FOR [post_id], + CONSTRAINT [DF_swmatc_word_id] DEFAULT (0) FOR [word_id], + CONSTRAINT [DF_swmatc_title_match] DEFAULT (0) FOR [title_match] +GO + +CREATE INDEX [word_id] ON [phpbb_search_wordmatch]([word_id]) ON [PRIMARY] +GO + + +/* + Table: phpbb_sessions +*/ CREATE TABLE [phpbb_sessions] ( [session_id] [varchar] (32) NOT NULL , [session_user_id] [int] NOT NULL , @@ -531,6 +1444,34 @@ CREATE TABLE [phpbb_sessions] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_sessions] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_sessions] PRIMARY KEY CLUSTERED + ( + [session_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_sessions] WITH NOCHECK ADD + CONSTRAINT [DF_sessio_session_user_id] DEFAULT (0) FOR [session_user_id], + CONSTRAINT [DF_sessio_session_last_visit] DEFAULT (0) FOR [session_last_visit], + CONSTRAINT [DF_sessio_session_start] DEFAULT (0) FOR [session_start], + CONSTRAINT [DF_sessio_session_time] DEFAULT (0) FOR [session_time], + CONSTRAINT [DF_sessio_session_ip] DEFAULT ('0') FOR [session_ip], + CONSTRAINT [DF_sessio_session_viewonline] DEFAULT (1) FOR [session_viewonline], + CONSTRAINT [DF_sessio_session_autologin] DEFAULT (0) FOR [session_autologin], + CONSTRAINT [DF_sessio_session_admin] DEFAULT (0) FOR [session_admin] +GO + +CREATE INDEX [session_time] ON [phpbb_sessions]([session_time]) ON [PRIMARY] +GO + +CREATE INDEX [session_user_id] ON [phpbb_sessions]([session_user_id]) ON [PRIMARY] +GO + + +/* + Table: phpbb_sessions_keys +*/ CREATE TABLE [phpbb_sessions_keys] ( [key_id] [varchar] (32) NOT NULL , [user_id] [int] NOT NULL , @@ -539,6 +1480,28 @@ CREATE TABLE [phpbb_sessions_keys] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_sessions_keys] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_sessions_keys] PRIMARY KEY CLUSTERED + ( + [key_id], + [user_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_sessions_keys] WITH NOCHECK ADD + CONSTRAINT [DF_sessik_key_id] DEFAULT ('0') FOR [key_id], + CONSTRAINT [DF_sessik_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_sessik_last_ip] DEFAULT ('0') FOR [last_ip], + CONSTRAINT [DF_sessik_last_login] DEFAULT (0) FOR [last_login] +GO + +CREATE INDEX [last_login] ON [phpbb_sessions_keys]([last_login]) ON [PRIMARY] +GO + + +/* + Table: phpbb_sitelist +*/ CREATE TABLE [phpbb_sitelist] ( [site_id] [int] IDENTITY (1, 1) NOT NULL , [site_ip] [varchar] (40) NOT NULL , @@ -547,6 +1510,21 @@ CREATE TABLE [phpbb_sitelist] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_sitelist] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_sitelist] PRIMARY KEY CLUSTERED + ( + [site_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_sitelist] WITH NOCHECK ADD + CONSTRAINT [DF_siteli_ip_exclude] DEFAULT (0) FOR [ip_exclude] +GO + + +/* + Table: phpbb_smilies +*/ CREATE TABLE [phpbb_smilies] ( [smiley_id] [int] IDENTITY (1, 1) NOT NULL , [code] [varchar] (10) NULL , @@ -559,10 +1537,28 @@ CREATE TABLE [phpbb_smilies] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_smilies] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_smilies] PRIMARY KEY CLUSTERED + ( + [smiley_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_smilies] WITH NOCHECK ADD + CONSTRAINT [DF_smilie_smiley_width] DEFAULT (0) FOR [smiley_width], + CONSTRAINT [DF_smilie_smiley_height] DEFAULT (0) FOR [smiley_height], + CONSTRAINT [DF_smilie_smiley_order] DEFAULT (0) FOR [smiley_order], + CONSTRAINT [DF_smilie_display_on_posting] DEFAULT (1) FOR [display_on_posting] +GO + + +/* + Table: phpbb_styles +*/ CREATE TABLE [phpbb_styles] ( [style_id] [int] IDENTITY (1, 1) NOT NULL , - [style_name] [varchar] (30) NOT NULL , - [style_copyright] [varchar] (50) NOT NULL , + [style_name] [varchar] (255) NOT NULL , + [style_copyright] [varchar] (255) NOT NULL , [style_active] [int] NOT NULL , [template_id] [int] NOT NULL , [theme_id] [int] NOT NULL , @@ -570,11 +1566,41 @@ CREATE TABLE [phpbb_styles] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_styles] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_styles] PRIMARY KEY CLUSTERED + ( + [style_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_styles] WITH NOCHECK ADD + CONSTRAINT [DF_styles_style_active] DEFAULT (1) FOR [style_active], + CONSTRAINT [DF_styles_template_id] DEFAULT (0) FOR [template_id], + CONSTRAINT [DF_styles_theme_id] DEFAULT (0) FOR [theme_id], + CONSTRAINT [DF_styles_imageset_id] DEFAULT (0) FOR [imageset_id] +GO + +CREATE UNIQUE INDEX [style_name] ON [phpbb_styles]([style_name]) ON [PRIMARY] +GO + +CREATE INDEX [template_id] ON [phpbb_styles]([template_id]) ON [PRIMARY] +GO + +CREATE INDEX [theme_id] ON [phpbb_styles]([theme_id]) ON [PRIMARY] +GO + +CREATE INDEX [imageset_id] ON [phpbb_styles]([imageset_id]) ON [PRIMARY] +GO + + +/* + Table: phpbb_styles_imageset +*/ CREATE TABLE [phpbb_styles_imageset] ( [imageset_id] [int] IDENTITY (1, 1) NOT NULL , - [imageset_name] [varchar] (30) NOT NULL , - [imageset_copyright] [varchar] (50) NOT NULL , - [imageset_path] [varchar] (30) NOT NULL , + [imageset_name] [varchar] (255) NOT NULL , + [imageset_copyright] [varchar] (255) NOT NULL , + [imageset_path] [varchar] (100) NOT NULL , [site_logo] [varchar] (200) NOT NULL , [btn_post] [varchar] (200) NOT NULL , [btn_post_pm] [varchar] (200) NOT NULL , @@ -655,36 +1681,103 @@ CREATE TABLE [phpbb_styles_imageset] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_styles_imageset] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_styles_imageset] PRIMARY KEY CLUSTERED + ( + [imageset_id] + ) ON [PRIMARY] +GO + +CREATE UNIQUE INDEX [imageset_name] ON [phpbb_styles_imageset]([imageset_name]) ON [PRIMARY] +GO + + +/* + Table: phpbb_styles_template +*/ CREATE TABLE [phpbb_styles_template] ( [template_id] [int] IDENTITY (1, 1) NOT NULL , - [template_name] [varchar] (30) NOT NULL , - [template_copyright] [varchar] (50) NOT NULL , - [template_path] [varchar] (30) NOT NULL , + [template_name] [varchar] (255) NOT NULL , + [template_copyright] [varchar] (255) NOT NULL , + [template_path] [varchar] (100) NOT NULL , [bbcode_bitfield] [int] NOT NULL , [template_storedb] [int] NOT NULL ) ON [PRIMARY] GO +ALTER TABLE [phpbb_styles_template] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_styles_template] PRIMARY KEY CLUSTERED + ( + [template_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_styles_template] WITH NOCHECK ADD + CONSTRAINT [DF_templa_bbcode_bitfield] DEFAULT (0) FOR [bbcode_bitfield], + CONSTRAINT [DF_templa_template_storedb] DEFAULT (0) FOR [template_storedb] +GO + +CREATE UNIQUE INDEX [template_name] ON [phpbb_styles_template]([template_name]) ON [PRIMARY] +GO + + +/* + Table: phpbb_styles_template_data +*/ CREATE TABLE [phpbb_styles_template_data] ( [template_id] [int] NOT NULL , - [template_filename] [varchar] (50) NOT NULL , - [template_included] [text] NOT NULL , + [template_filename] [varchar] (100) NOT NULL , + [template_included] [text] , [template_mtime] [int] NOT NULL , - [template_data] [text] NULL + [template_data] [text] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_styles_template_data] WITH NOCHECK ADD + CONSTRAINT [DF_tpldat_template_id] DEFAULT (0) FOR [template_id], + CONSTRAINT [DF_tpldat_template_mtime] DEFAULT (0) FOR [template_mtime] +GO + +CREATE INDEX [template_id] ON [phpbb_styles_template_data]([template_id]) ON [PRIMARY] +GO + +CREATE INDEX [template_filename] ON [phpbb_styles_template_data]([template_filename]) ON [PRIMARY] +GO + + +/* + Table: phpbb_styles_theme +*/ CREATE TABLE [phpbb_styles_theme] ( [theme_id] [int] IDENTITY (1, 1) NOT NULL , - [theme_name] [varchar] (30) NOT NULL , - [theme_copyright] [varchar] (50) NOT NULL , - [theme_path] [varchar] (30) NOT NULL , + [theme_name] [varchar] (255) NOT NULL , + [theme_copyright] [varchar] (255) NOT NULL , + [theme_path] [varchar] (100) NOT NULL , [theme_storedb] [int] NOT NULL , [theme_mtime] [int] NOT NULL , - [theme_data] [text] NOT NULL + [theme_data] [text] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +ALTER TABLE [phpbb_styles_theme] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_styles_theme] PRIMARY KEY CLUSTERED + ( + [theme_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_styles_theme] WITH NOCHECK ADD + CONSTRAINT [DF_theme__theme_storedb] DEFAULT (0) FOR [theme_storedb], + CONSTRAINT [DF_theme__theme_mtime] DEFAULT (0) FOR [theme_mtime] +GO + +CREATE UNIQUE INDEX [theme_name] ON [phpbb_styles_theme]([theme_name]) ON [PRIMARY] +GO + + +/* + Table: phpbb_topics +*/ CREATE TABLE [phpbb_topics] ( [topic_id] [int] IDENTITY (1, 1) NOT NULL , [forum_id] [int] NOT NULL , @@ -692,7 +1785,7 @@ CREATE TABLE [phpbb_topics] ( [topic_attachment] [int] NOT NULL , [topic_approved] [int] NOT NULL , [topic_reported] [int] NOT NULL , - [topic_title] [varchar] (60) NOT NULL , + [topic_title] [text] , [topic_poster] [int] NOT NULL , [topic_time] [int] NOT NULL , [topic_time_limit] [int] NOT NULL , @@ -702,24 +1795,74 @@ CREATE TABLE [phpbb_topics] ( [topic_status] [int] NOT NULL , [topic_type] [int] NOT NULL , [topic_first_post_id] [int] NOT NULL , - [topic_first_poster_name] [varchar] (30) NULL , + [topic_first_poster_name] [varchar] (255) NULL , [topic_last_post_id] [int] NOT NULL , [topic_last_poster_id] [int] NOT NULL , - [topic_last_poster_name] [varchar] (30) NULL , + [topic_last_poster_name] [varchar] (255) NULL , [topic_last_post_time] [int] NOT NULL , [topic_last_view_time] [int] NOT NULL , [topic_moved_id] [int] NOT NULL , [topic_bumped] [int] NOT NULL , [topic_bumper] [int] NOT NULL , - [poll_title] [varchar] (255) NOT NULL , + [poll_title] [text] , [poll_start] [int] NOT NULL , [poll_length] [int] NOT NULL , [poll_max_options] [int] NOT NULL , [poll_last_vote] [int] NULL , [poll_vote_change] [int] NOT NULL -) ON [PRIMARY] +) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] +GO + +ALTER TABLE [phpbb_topics] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_topics] PRIMARY KEY CLUSTERED + ( + [topic_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_topics] WITH NOCHECK ADD + CONSTRAINT [DF_topics_forum_id] DEFAULT (0) FOR [forum_id], + CONSTRAINT [DF_topics_icon_id] DEFAULT (1) FOR [icon_id], + CONSTRAINT [DF_topics_topic_attachment] DEFAULT (0) FOR [topic_attachment], + CONSTRAINT [DF_topics_topic_approved] DEFAULT (1) FOR [topic_approved], + CONSTRAINT [DF_topics_topic_reported] DEFAULT (0) FOR [topic_reported], + CONSTRAINT [DF_topics_topic_poster] DEFAULT (0) FOR [topic_poster], + CONSTRAINT [DF_topics_topic_time] DEFAULT (0) FOR [topic_time], + CONSTRAINT [DF_topics_topic_time_limit] DEFAULT (0) FOR [topic_time_limit], + CONSTRAINT [DF_topics_topic_views] DEFAULT (0) FOR [topic_views], + CONSTRAINT [DF_topics_topic_replies] DEFAULT (0) FOR [topic_replies], + CONSTRAINT [DF_topics_topic_replies_real] DEFAULT (0) FOR [topic_replies_real], + CONSTRAINT [DF_topics_topic_status] DEFAULT (0) FOR [topic_status], + CONSTRAINT [DF_topics_topic_type] DEFAULT (0) FOR [topic_type], + CONSTRAINT [DF_topics_topic_first_post_id] DEFAULT (0) FOR [topic_first_post_id], + CONSTRAINT [DF_topics_topic_last_post_id] DEFAULT (0) FOR [topic_last_post_id], + CONSTRAINT [DF_topics_topic_last_poster_id] DEFAULT (0) FOR [topic_last_poster_id], + CONSTRAINT [DF_topics_topic_last_post_time] DEFAULT (0) FOR [topic_last_post_time], + CONSTRAINT [DF_topics_topic_last_view_time] DEFAULT (0) FOR [topic_last_view_time], + CONSTRAINT [DF_topics_topic_moved_id] DEFAULT (0) FOR [topic_moved_id], + CONSTRAINT [DF_topics_topic_bumped] DEFAULT (0) FOR [topic_bumped], + CONSTRAINT [DF_topics_topic_bumper] DEFAULT (0) FOR [topic_bumper], + CONSTRAINT [DF_topics_poll_title] DEFAULT ('') FOR [poll_title], + CONSTRAINT [DF_topics_poll_start] DEFAULT (0) FOR [poll_start], + CONSTRAINT [DF_topics_poll_length] DEFAULT (0) FOR [poll_length], + CONSTRAINT [DF_topics_poll_max_options] DEFAULT (1) FOR [poll_max_options], + CONSTRAINT [DF_topics_poll_last_vote] DEFAULT (0) FOR [poll_last_vote], + CONSTRAINT [DF_topics_poll_vote_change] DEFAULT (0) FOR [poll_vote_change] +GO + +CREATE INDEX [forum_id] ON [phpbb_topics]([forum_id]) ON [PRIMARY] GO +CREATE INDEX [forum_id_type] ON [phpbb_topics]([forum_id], [topic_type]) ON [PRIMARY] +GO + +CREATE INDEX [topic_last_post_time] ON [phpbb_topics]([topic_last_post_time]) ON [PRIMARY] +GO + + +/* + Table: phpbb_topics_marking +*/ CREATE TABLE [phpbb_topics_marking] ( [user_id] [int] NOT NULL , [topic_id] [int] NOT NULL , @@ -728,6 +1871,28 @@ CREATE TABLE [phpbb_topics_marking] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_topics_marking] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_topics_marking] PRIMARY KEY CLUSTERED + ( + [user_id], + [topic_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_topics_marking] WITH NOCHECK ADD + CONSTRAINT [DF_tmarki_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_tmarki_topic_id] DEFAULT (0) FOR [topic_id], + CONSTRAINT [DF_tmarki_forum_id] DEFAULT (0) FOR [forum_id], + CONSTRAINT [DF_tmarki_mark_time] DEFAULT (0) FOR [mark_time] +GO + +CREATE INDEX [forum_id] ON [phpbb_topics_marking]([forum_id]) ON [PRIMARY] +GO + + +/* + Table: phpbb_topics_posted +*/ CREATE TABLE [phpbb_topics_posted] ( [user_id] [int] NOT NULL , [topic_id] [int] NOT NULL , @@ -735,6 +1900,24 @@ CREATE TABLE [phpbb_topics_posted] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_topics_posted] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_topics_posted] PRIMARY KEY CLUSTERED + ( + [user_id], + [topic_id] + ) ON [PRIMARY] +GO + +ALTER TABLE [phpbb_topics_posted] WITH NOCHECK ADD + CONSTRAINT [DF_tposte_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_tposte_topic_id] DEFAULT (0) FOR [topic_id], + CONSTRAINT [DF_tposte_topic_posted] DEFAULT (0) FOR [topic_posted] +GO + + +/* + Table: phpbb_topics_watch +*/ CREATE TABLE [phpbb_topics_watch] ( [topic_id] [int] NOT NULL , [user_id] [int] NOT NULL , @@ -742,6 +1925,25 @@ CREATE TABLE [phpbb_topics_watch] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_topics_watch] WITH NOCHECK ADD + CONSTRAINT [DF_twatch_topic_id] DEFAULT (0) FOR [topic_id], + CONSTRAINT [DF_twatch_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_twatch_notify_status] DEFAULT (0) FOR [notify_status] +GO + +CREATE INDEX [topic_id] ON [phpbb_topics_watch]([topic_id]) ON [PRIMARY] +GO + +CREATE INDEX [user_id] ON [phpbb_topics_watch]([user_id]) ON [PRIMARY] +GO + +CREATE INDEX [notify_status] ON [phpbb_topics_watch]([notify_status]) ON [PRIMARY] +GO + + +/* + Table: phpbb_user_group +*/ CREATE TABLE [phpbb_user_group] ( [group_id] [int] NOT NULL , [user_id] [int] NOT NULL , @@ -750,17 +1952,36 @@ CREATE TABLE [phpbb_user_group] ( ) ON [PRIMARY] GO +ALTER TABLE [phpbb_user_group] WITH NOCHECK ADD + CONSTRAINT [DF_usersg_group_id] DEFAULT (0) FOR [group_id], + CONSTRAINT [DF_usersg_user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_usersg_group_leader] DEFAULT (0) FOR [group_leader] +GO + +CREATE INDEX [group_id] ON [phpbb_user_group]([group_id]) ON [PRIMARY] +GO + +CREATE INDEX [user_id] ON [phpbb_user_group]([user_id]) ON [PRIMARY] +GO + +CREATE INDEX [group_leader] ON [phpbb_user_group]([group_leader]) ON [PRIMARY] +GO + + +/* + Table: phpbb_users +*/ CREATE TABLE [phpbb_users] ( [user_id] [int] IDENTITY (1, 1) NOT NULL , [user_type] [int] NOT NULL , [group_id] [int] NOT NULL , - [user_permissions] [text] NOT NULL , + [user_permissions] [text] , [user_ip] [varchar] (40) NOT NULL , [user_regdate] [int] NOT NULL , - [username] [varchar] (30) NOT NULL , + [username] [varchar] (255) NOT NULL , [user_password] [varchar] (32) NOT NULL , [user_passchg] [int] NOT NULL , - [user_email] [varchar] (60) NOT NULL , + [user_email] [varchar] (100) NOT NULL , [user_email_hash] [float] NOT NULL , [user_birthday] [varchar] (10) NOT NULL , [user_lastvisit] [int] NOT NULL , @@ -800,11 +2021,11 @@ CREATE TABLE [phpbb_users] ( [user_allow_viewemail] [int] NOT NULL , [user_allow_massemail] [int] NOT NULL , [user_options] [int] NOT NULL , - [user_avatar] [varchar] (100) NOT NULL , + [user_avatar] [varchar] (255) NOT NULL , [user_avatar_type] [int] NOT NULL , [user_avatar_width] [int] NOT NULL , [user_avatar_height] [int] NOT NULL , - [user_sig] [text] NOT NULL , + [user_sig] [text] , [user_sig_bbcode_uid] [varchar] (5) NOT NULL , [user_sig_bbcode_bitfield] [int] NOT NULL , [user_from] [varchar] (100) NOT NULL , @@ -813,7 +2034,7 @@ CREATE TABLE [phpbb_users] ( [user_yim] [varchar] (255) NOT NULL , [user_msnm] [varchar] (255) NOT NULL , [user_jabber] [varchar] (255) NOT NULL , - [user_website] [varchar] (100) NOT NULL , + [user_website] [varchar] (200) NOT NULL , [user_occ] [varchar] (255) NOT NULL , [user_interests] [varchar] (255) NOT NULL , [user_actkey] [varchar] (32) NOT NULL , @@ -821,363 +2042,6 @@ CREATE TABLE [phpbb_users] ( ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO -CREATE TABLE [phpbb_warnings] ( - [warning_id] [int] IDENTITY (1, 1) NOT NULL , - [user_id] [int] NOT NULL , - [post_id] [int] NOT NULL , - [log_id] [int] NOT NULL , - [warning_time] [int] NOT NULL -) ON [PRIMARY] -GO - -CREATE TABLE [phpbb_words] ( - [word_id] [int] IDENTITY (1, 1) NOT NULL , - [word] [varchar] (100) NOT NULL , - [replacement] [varchar] (100) NOT NULL -) ON [PRIMARY] -GO - -CREATE TABLE [phpbb_zebra] ( - [user_id] [int] NOT NULL , - [zebra_id] [int] NOT NULL , - [friend] [int] NOT NULL , - [foe] [int] NOT NULL -) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_attachments] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_attachments] PRIMARY KEY CLUSTERED - ( - [attach_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_auth_options] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_auth_options] PRIMARY KEY CLUSTERED - ( - [auth_option_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_auth_roles] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_auth_roles] PRIMARY KEY CLUSTERED - ( - [role_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_auth_roles_data] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_auth_roles_data] PRIMARY KEY CLUSTERED - ( - [role_id], - [auth_option_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_banlist] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_banlist] PRIMARY KEY CLUSTERED - ( - [ban_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_bbcodes] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_bbcodes] PRIMARY KEY CLUSTERED - ( - [bbcode_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_bots] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_bots] PRIMARY KEY CLUSTERED - ( - [bot_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_cache] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_cache] PRIMARY KEY CLUSTERED - ( - [var_name] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_config] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_config] PRIMARY KEY CLUSTERED - ( - [config_name] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_confirm] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_confirm] PRIMARY KEY CLUSTERED - ( - [session_id], - [confirm_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_disallow] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_disallow] PRIMARY KEY CLUSTERED - ( - [disallow_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_drafts] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_drafts] PRIMARY KEY CLUSTERED - ( - [draft_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_extension_groups] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_extension_groups] PRIMARY KEY CLUSTERED - ( - [group_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_extensions] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_extensions] PRIMARY KEY CLUSTERED - ( - [extension_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_forum_access] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_forum_access] PRIMARY KEY CLUSTERED - ( - [forum_id], - [user_id], - [session_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_forums] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_forums] PRIMARY KEY CLUSTERED - ( - [forum_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_forums_marking] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_forums_marking] PRIMARY KEY CLUSTERED - ( - [user_id], - [forum_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_groups] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_groups] PRIMARY KEY CLUSTERED - ( - [group_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_icons] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_icons] PRIMARY KEY CLUSTERED - ( - [icons_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_lang] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_lang] PRIMARY KEY CLUSTERED - ( - [lang_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_log] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_log] PRIMARY KEY CLUSTERED - ( - [log_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_modules] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_modules] PRIMARY KEY CLUSTERED - ( - [module_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_posts] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_posts] PRIMARY KEY CLUSTERED - ( - [post_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_privmsgs] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_privmsgs] PRIMARY KEY CLUSTERED - ( - [msg_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_privmsgs_folder] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_privmsgs_folder] PRIMARY KEY CLUSTERED - ( - [folder_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_privmsgs_rules] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_privmsgs_rules] PRIMARY KEY CLUSTERED - ( - [rule_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_profile_fields] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_profile_fields] PRIMARY KEY CLUSTERED - ( - [field_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_profile_fields_data] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_profile_fields_data] PRIMARY KEY CLUSTERED - ( - [user_id] - ) ON [PRIMARY] -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] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_profile_lang] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_profile_lang] PRIMARY KEY CLUSTERED - ( - [field_id], - [lang_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_ranks] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_ranks] PRIMARY KEY CLUSTERED - ( - [rank_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_reports] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_reports] PRIMARY KEY CLUSTERED - ( - [report_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_reports_reasons] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_reports_reasons] PRIMARY KEY CLUSTERED - ( - [reason_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_search_results] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_search_results] PRIMARY KEY CLUSTERED - ( - [search_key] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_search_wordlist] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_search_wordlist] PRIMARY KEY CLUSTERED - ( - [word_text] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_sessions] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_sessions] PRIMARY KEY CLUSTERED - ( - [session_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_sessions_keys] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_sessions_keys] PRIMARY KEY CLUSTERED - ( - [key_id], - [user_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_sitelist] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_sitelist] PRIMARY KEY CLUSTERED - ( - [site_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_smilies] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_smilies] PRIMARY KEY CLUSTERED - ( - [smiley_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_styles] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_styles] PRIMARY KEY CLUSTERED - ( - [style_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_styles_imageset] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_styles_imageset] PRIMARY KEY CLUSTERED - ( - [imageset_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_styles_template] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_styles_template] PRIMARY KEY CLUSTERED - ( - [template_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_styles_theme] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_styles_theme] PRIMARY KEY CLUSTERED - ( - [theme_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_topics] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_topics] PRIMARY KEY CLUSTERED - ( - [topic_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_topics_marking] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_topics_marking] PRIMARY KEY CLUSTERED - ( - [user_id], - [topic_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_topics_posted] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_topics_posted] PRIMARY KEY CLUSTERED - ( - [user_id], - [topic_id] - ) ON [PRIMARY] -GO - ALTER TABLE [phpbb_users] WITH NOCHECK ADD CONSTRAINT [PK_phpbb_users] PRIMARY KEY CLUSTERED ( @@ -1185,446 +2049,6 @@ ALTER TABLE [phpbb_users] WITH NOCHECK ADD ) ON [PRIMARY] GO -ALTER TABLE [phpbb_warnings] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_warnings] PRIMARY KEY CLUSTERED - ( - [warning_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_words] WITH NOCHECK ADD - CONSTRAINT [PK_phpbb_words] PRIMARY KEY CLUSTERED - ( - [word_id] - ) ON [PRIMARY] -GO - -ALTER TABLE [phpbb_attachments] WITH NOCHECK ADD - CONSTRAINT [DF_attach_post_msg_id] DEFAULT (0) FOR [post_msg_id], - CONSTRAINT [DF_attach_topic_id] DEFAULT (0) FOR [topic_id], - CONSTRAINT [DF_attach_in_message] DEFAULT (0) FOR [in_message], - CONSTRAINT [DF_attach_poster_id] DEFAULT (0) FOR [poster_id], - CONSTRAINT [DF_attach_download_count] DEFAULT (0) FOR [download_count], - CONSTRAINT [DF_attach_filesize] DEFAULT (0) FOR [filesize], - CONSTRAINT [DF_attach_filetime] DEFAULT (0) FOR [filetime], - CONSTRAINT [DF_attach_thumbnail] DEFAULT (0) FOR [thumbnail] -GO - -ALTER TABLE [phpbb_auth_groups] WITH NOCHECK ADD - CONSTRAINT [DF_auth_g_group_id] DEFAULT (0) FOR [group_id], - CONSTRAINT [DF_auth_g_forum_id] DEFAULT (0) FOR [forum_id], - CONSTRAINT [DF_auth_g_auth_option_id] DEFAULT (0) FOR [auth_option_id], - CONSTRAINT [DF_auth_g_auth_setting] DEFAULT (0) FOR [auth_setting] -GO - -ALTER TABLE [phpbb_auth_options] WITH NOCHECK ADD - CONSTRAINT [DF_auth_o_is_global] DEFAULT (0) FOR [is_global], - CONSTRAINT [DF_auth_o_is_local] DEFAULT (0) FOR [is_local], - CONSTRAINT [DF_auth_o_founder_only] DEFAULT (0) FOR [founder_only] -GO - -ALTER TABLE [phpbb_auth_roles] WITH NOCHECK ADD - CONSTRAINT [DF_auth_p_role_group_ids] DEFAULT ('') FOR [role_group_ids] -GO - -ALTER TABLE [phpbb_auth_roles_data] WITH NOCHECK ADD - CONSTRAINT [DF_auth_d_role_id] DEFAULT (0) FOR [role_id], - CONSTRAINT [DF_auth_d_auth_option_id] DEFAULT (0) FOR [auth_option_id], - CONSTRAINT [DF_auth_d_auth_setting] DEFAULT (0) FOR [auth_setting] -GO - -ALTER TABLE [phpbb_auth_users] WITH NOCHECK ADD - CONSTRAINT [DF_auth_u_user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_auth_u_forum_id] DEFAULT (0) FOR [forum_id], - CONSTRAINT [DF_auth_u_auth_option_id] DEFAULT (0) FOR [auth_option_id], - CONSTRAINT [DF_auth_u_auth_setting] DEFAULT (0) FOR [auth_setting] -GO - -ALTER TABLE [phpbb_banlist] WITH NOCHECK ADD - CONSTRAINT [DF_banlis_ban_userid] DEFAULT (0) FOR [ban_userid], - CONSTRAINT [DF_banlis_ban_start] DEFAULT (0) FOR [ban_start], - CONSTRAINT [DF_banlis_ban_end] DEFAULT (0) FOR [ban_end], - CONSTRAINT [DF_banlis_ban_exclude] DEFAULT (0) FOR [ban_exclude] -GO - -ALTER TABLE [phpbb_bbcodes] WITH NOCHECK ADD - CONSTRAINT [DF_bbcode_bbcode_id] DEFAULT (0) FOR [bbcode_id], - CONSTRAINT [DF_bbcode_display_on_posting] DEFAULT (0) FOR [display_on_posting] -GO - -ALTER TABLE [phpbb_bookmarks] WITH NOCHECK ADD - CONSTRAINT [DF_bookma_topic_id] DEFAULT (0) FOR [topic_id], - CONSTRAINT [DF_bookma_user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_bookma_order_id] DEFAULT (0) FOR [order_id] -GO - -ALTER TABLE [phpbb_bots] WITH NOCHECK ADD - CONSTRAINT [DF_bots___bot_active] DEFAULT (1) FOR [bot_active], - CONSTRAINT [DF_bots___user_id] DEFAULT (0) FOR [user_id] -GO - -ALTER TABLE [phpbb_cache] WITH NOCHECK ADD - CONSTRAINT [DF_cache__var_expires] DEFAULT (0) FOR [var_expires] -GO - -ALTER TABLE [phpbb_config] WITH NOCHECK ADD - CONSTRAINT [DF_config_is_dynamic] DEFAULT (0) FOR [is_dynamic] -GO - -ALTER TABLE [phpbb_confirm] WITH NOCHECK ADD - CONSTRAINT [DF_confirm_confirm_type] DEFAULT (0) FOR [confirm_type] -GO - -ALTER TABLE [phpbb_drafts] WITH NOCHECK ADD - CONSTRAINT [DF_drafts_user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_drafts_topic_id] DEFAULT (0) FOR [topic_id], - CONSTRAINT [DF_drafts_forum_id] DEFAULT (0) FOR [forum_id], - CONSTRAINT [DF_drafts_save_time] DEFAULT (0) FOR [save_time] -GO - -ALTER TABLE [phpbb_extension_groups] WITH NOCHECK ADD - CONSTRAINT [DF_extens_cat_id] DEFAULT (0) FOR [cat_id], - CONSTRAINT [DF_extens_allow_group] DEFAULT (0) FOR [allow_group], - CONSTRAINT [DF_extens_download_mode] DEFAULT (1) FOR [download_mode], - CONSTRAINT [DF_extens_max_filesize] DEFAULT (0) FOR [max_filesize], - CONSTRAINT [DF_extens_allow_in_pm] DEFAULT (0) FOR [allow_in_pm] -GO - -ALTER TABLE [phpbb_extensions] WITH NOCHECK ADD - CONSTRAINT [DF_extens_group_id] DEFAULT (0) FOR [group_id] -GO - -ALTER TABLE [phpbb_forum_access] WITH NOCHECK ADD - CONSTRAINT [DF_forum__forum_id] DEFAULT (0) FOR [forum_id], - CONSTRAINT [DF_forum__user_id] DEFAULT (0) FOR [user_id] -GO - -ALTER TABLE [phpbb_forums] WITH NOCHECK ADD - CONSTRAINT [DF_forums_parent_id] DEFAULT (0) FOR [parent_id], - CONSTRAINT [DF_forums_left_id] DEFAULT (0) FOR [left_id], - CONSTRAINT [DF_forums_right_id] DEFAULT (0) FOR [right_id], - CONSTRAINT [DF_forums_desc_bitfield] DEFAULT (0) FOR [forum_desc_bitfield], - CONSTRAINT [DF_forums_rules_bitfield] DEFAULT (0) FOR [forum_rules_bitfield], - CONSTRAINT [DF_forums_topics_per_page] DEFAULT (0) FOR [forum_topics_per_page], - CONSTRAINT [DF_forums_forum_type] DEFAULT (0) FOR [forum_type], - CONSTRAINT [DF_forums_forum_status] DEFAULT (0) FOR [forum_status], - CONSTRAINT [DF_forums_forum_posts] DEFAULT (0) FOR [forum_posts], - CONSTRAINT [DF_forums_forum_topics] DEFAULT (0) FOR [forum_topics], - CONSTRAINT [DF_forums_forum_topics_real] DEFAULT (0) FOR [forum_topics_real], - CONSTRAINT [DF_forums_forum_last_post_id] DEFAULT (0) FOR [forum_last_post_id], - CONSTRAINT [DF_forums_forum_last_poster_id] DEFAULT (0) FOR [forum_last_poster_id], - CONSTRAINT [DF_forums_forum_last_post_time] DEFAULT (0) FOR [forum_last_post_time], - CONSTRAINT [DF_forums_forum_flags] DEFAULT (0) FOR [forum_flags], - CONSTRAINT [DF_forums_display_on_index] DEFAULT (1) FOR [display_on_index], - CONSTRAINT [DF_forums_enable_indexing] DEFAULT (1) FOR [enable_indexing], - CONSTRAINT [DF_forums_enable_icons] DEFAULT (1) FOR [enable_icons], - CONSTRAINT [DF_forums_enable_prune] DEFAULT (0) FOR [enable_prune], - CONSTRAINT [DF_forums_prune_days] DEFAULT (0) FOR [prune_days], - CONSTRAINT [DF_forums_prune_viewed] DEFAULT (0) FOR [prune_viewed], - CONSTRAINT [DF_forums_prune_freq] DEFAULT (0) FOR [prune_freq] -GO - -ALTER TABLE [phpbb_forums_marking] WITH NOCHECK ADD - CONSTRAINT [DF_forumm_user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_forumm_forum_id] DEFAULT (0) FOR [forum_id], - CONSTRAINT [DF_forumm_mark_time] DEFAULT (0) FOR [mark_time] -GO - -ALTER TABLE [phpbb_forums_watch] WITH NOCHECK ADD - CONSTRAINT [DF_forumw_forum_id] DEFAULT (0) FOR [forum_id], - CONSTRAINT [DF_forumw_user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_forumw_notify_status] DEFAULT (0) FOR [notify_status] -GO - -ALTER TABLE [phpbb_groups] WITH NOCHECK ADD - CONSTRAINT [DF_groups_group_type] DEFAULT (1) FOR [group_type], - CONSTRAINT [DF_groups_group_display] DEFAULT (0) FOR [group_display], - CONSTRAINT [DF_groups_group_desc_bitfield] DEFAULT (0) FOR [group_desc_bitfield], - CONSTRAINT [DF_groups_group_avatar_type] DEFAULT (0) FOR [group_avatar_type], - CONSTRAINT [DF_groups_group_avatar_width] DEFAULT (0) FOR [group_avatar_width], - CONSTRAINT [DF_groups_group_avatar_height] DEFAULT (0) FOR [group_avatar_height], - CONSTRAINT [DF_groups_group_rank] DEFAULT ((-1)) FOR [group_rank], - CONSTRAINT [DF_groups_group_sig_chars] DEFAULT (0) FOR [group_sig_chars], - CONSTRAINT [DF_groups_group_receive_pm] DEFAULT (0) FOR [group_receive_pm], - CONSTRAINT [DF_groups_group_message_limit] DEFAULT (0) FOR [group_message_limit], - CONSTRAINT [DF_groups_group_chgpass] DEFAULT (0) FOR [group_chgpass], - CONSTRAINT [DF_groups_group_legend] DEFAULT (1) FOR [group_legend] -GO - -ALTER TABLE [phpbb_icons] WITH NOCHECK ADD - CONSTRAINT [DF_icons__icons_width] DEFAULT (0) FOR [icons_width], - CONSTRAINT [DF_icons__icons_height] DEFAULT (0) FOR [icons_height], - CONSTRAINT [DF_icons__icons_order] DEFAULT (0) FOR [icons_order], - CONSTRAINT [DF_icons__display_on_posting] DEFAULT (1) FOR [display_on_posting] -GO - -ALTER TABLE [phpbb_log] WITH NOCHECK ADD - CONSTRAINT [DF_log____log_type] DEFAULT (0) FOR [log_type], - CONSTRAINT [DF_log____user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_log____forum_id] DEFAULT (0) FOR [forum_id], - CONSTRAINT [DF_log____topic_id] DEFAULT (0) FOR [topic_id], - CONSTRAINT [DF_log____reportee_id] DEFAULT (0) FOR [reportee_id], - CONSTRAINT [DF_log____log_time] DEFAULT (0) FOR [log_time] -GO - -ALTER TABLE [phpbb_moderator_cache] WITH NOCHECK ADD - CONSTRAINT [DF_modera_forum_id] DEFAULT (0) FOR [forum_id], - CONSTRAINT [DF_modera_user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_modera_group_id] DEFAULT (0) FOR [group_id], - CONSTRAINT [DF_modera_display_on_index] DEFAULT (1) FOR [display_on_index] -GO - -ALTER TABLE [phpbb_modules] WITH NOCHECK ADD - CONSTRAINT [DF_module_module_enabled] DEFAULT (1) FOR [module_enabled] -GO - -ALTER TABLE [phpbb_modules] WITH NOCHECK ADD - CONSTRAINT [DF_module_module_display] DEFAULT (1) FOR [module_display] -GO - -ALTER TABLE [phpbb_poll_results] WITH NOCHECK ADD - CONSTRAINT [DF_poll_r_poll_option_id] DEFAULT (0) FOR [poll_option_id], - CONSTRAINT [DF_poll_r_topic_id] DEFAULT (0) FOR [topic_id], - CONSTRAINT [DF_poll_r_poll_option_total] DEFAULT (0) FOR [poll_option_total] -GO - -ALTER TABLE [phpbb_poll_voters] WITH NOCHECK ADD - CONSTRAINT [DF_poll_v_topic_id] DEFAULT (0) FOR [topic_id], - CONSTRAINT [DF_poll_v_poll_option_id] DEFAULT (0) FOR [poll_option_id], - CONSTRAINT [DF_poll_v_vote_user_id] DEFAULT (0) FOR [vote_user_id] -GO - -ALTER TABLE [phpbb_posts] WITH NOCHECK ADD - CONSTRAINT [DF_posts__topic_id] DEFAULT (0) FOR [topic_id], - CONSTRAINT [DF_posts__forum_id] DEFAULT (0) FOR [forum_id], - CONSTRAINT [DF_posts__poster_id] DEFAULT (0) FOR [poster_id], - CONSTRAINT [DF_posts__icon_id] DEFAULT (1) FOR [icon_id], - CONSTRAINT [DF_posts__post_time] DEFAULT (0) FOR [post_time], - CONSTRAINT [DF_posts__post_approved] DEFAULT (1) FOR [post_approved], - CONSTRAINT [DF_posts__post_reported] DEFAULT (0) FOR [post_reported], - CONSTRAINT [DF_posts__enable_bbcode] DEFAULT (1) FOR [enable_bbcode], - CONSTRAINT [DF_posts__enable_smilies] DEFAULT (1) FOR [enable_smilies], - CONSTRAINT [DF_posts__enable_magic_url] DEFAULT (1) FOR [enable_magic_url], - CONSTRAINT [DF_posts__enable_sig] DEFAULT (1) FOR [enable_sig], - CONSTRAINT [DF_posts__post_encoding] DEFAULT ('iso-8859-1') FOR [post_encoding], - CONSTRAINT [DF_posts__post_attachment] DEFAULT (0) FOR [post_attachment], - CONSTRAINT [DF_posts__bbcode_bitfield] DEFAULT (0) FOR [bbcode_bitfield], - CONSTRAINT [DF_posts__post_edit_time] DEFAULT (0) FOR [post_edit_time], - CONSTRAINT [DF_posts__post_edit_user] DEFAULT (0) FOR [post_edit_user], - CONSTRAINT [DF_posts__post_edit_count] DEFAULT (0) FOR [post_edit_count], - CONSTRAINT [DF_posts__post_edit_locked] DEFAULT (0) FOR [post_edit_locked] -GO - -ALTER TABLE [phpbb_privmsgs] WITH NOCHECK ADD - CONSTRAINT [DF_privms_root_level] DEFAULT (0) FOR [root_level], - CONSTRAINT [DF_privms_author_id] DEFAULT (0) FOR [author_id], - CONSTRAINT [DF_privms_icon_id] DEFAULT (1) FOR [icon_id], - CONSTRAINT [DF_privms_message_time] DEFAULT (0) FOR [message_time], - CONSTRAINT [DF_privms_enable_bbcode] DEFAULT (1) FOR [enable_bbcode], - CONSTRAINT [DF_privms_enable_smilies] DEFAULT (1) FOR [enable_smilies], - CONSTRAINT [DF_privms_enable_magic_url] DEFAULT (1) FOR [enable_magic_url], - CONSTRAINT [DF_privms_enable_sig] DEFAULT (1) FOR [enable_sig], - CONSTRAINT [DF_privms_message_edit_user] DEFAULT (0) FOR [message_edit_user], - CONSTRAINT [DF_privms_message_encoding] DEFAULT ('iso-8859-1') FOR [message_encoding], - CONSTRAINT [DF_privms_message_attachment] DEFAULT (0) FOR [message_attachment], - CONSTRAINT [DF_privms_bbcode_bitfield] DEFAULT (0) FOR [bbcode_bitfield], - CONSTRAINT [DF_privms_message_edit_time] DEFAULT (0) FOR [message_edit_time], - CONSTRAINT [DF_privms_message_edit_count] DEFAULT (0) FOR [message_edit_count] -GO - -ALTER TABLE [phpbb_privmsgs_folder] WITH NOCHECK ADD - CONSTRAINT [DF_pmfold_user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_pmfold_pm_count] DEFAULT (0) FOR [pm_count] -GO - -ALTER TABLE [phpbb_privmsgs_rules] WITH NOCHECK ADD - CONSTRAINT [DF_pmrule_user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_pmrule_rule_check] DEFAULT (0) FOR [rule_check], - CONSTRAINT [DF_pmrule_rule_connection] DEFAULT (0) FOR [rule_connection], - CONSTRAINT [DF_pmrule_rule_user_id] DEFAULT (0) FOR [rule_user_id], - CONSTRAINT [DF_pmrule_rule_group_id] DEFAULT (0) FOR [rule_group_id], - CONSTRAINT [DF_pmrule_rule_action] DEFAULT (0) FOR [rule_action], - CONSTRAINT [DF_pmrule_rule_folder_id] DEFAULT (0) FOR [rule_folder_id] -GO - -ALTER TABLE [phpbb_privmsgs_to] WITH NOCHECK ADD - CONSTRAINT [DF_pmto___msg_id] DEFAULT (0) FOR [msg_id], - CONSTRAINT [DF_pmto___user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_pmto___author_id] DEFAULT (0) FOR [author_id], - CONSTRAINT [DF_pmto___deleted] DEFAULT (0) FOR [deleted], - CONSTRAINT [DF_pmto___new] DEFAULT (1) FOR [new], - CONSTRAINT [DF_pmto___unread] DEFAULT (1) FOR [unread], - CONSTRAINT [DF_pmto___replied] DEFAULT (0) FOR [replied], - CONSTRAINT [DF_pmto___marked] DEFAULT (0) FOR [marked], - CONSTRAINT [DF_pmto___forwarded] DEFAULT (0) FOR [forwarded], - CONSTRAINT [DF_pmto___folder_id] DEFAULT (0) FOR [folder_id] -GO - -ALTER TABLE [phpbb_profile_fields] WITH NOCHECK ADD - CONSTRAINT [DF_pffiel_field_type] DEFAULT (0) FOR [field_type], - CONSTRAINT [DF_pffiel_field_default_value] DEFAULT ('0') FOR [field_default_value], - CONSTRAINT [DF_pffiel_field_required] DEFAULT (0) FOR [field_required], - CONSTRAINT [DF_pffiel_field_show_on_reg] DEFAULT (0) FOR [field_show_on_reg], - CONSTRAINT [DF_pffiel_field_hide] DEFAULT (0) FOR [field_hide], - CONSTRAINT [DF_pffiel_field_no_view] DEFAULT (0) FOR [field_no_view], - CONSTRAINT [DF_pffiel_field_active] DEFAULT (0) FOR [field_active], - CONSTRAINT [DF_pffiel_field_order] DEFAULT (0) FOR [field_order] -GO - -ALTER TABLE [phpbb_profile_fields_data] WITH NOCHECK ADD - CONSTRAINT [DF_pfdata_user_id] DEFAULT (0) FOR [user_id] -GO - -ALTER TABLE [phpbb_profile_fields_lang] WITH NOCHECK ADD - CONSTRAINT [DF_pfflan_field_id] DEFAULT (0) FOR [field_id], - CONSTRAINT [DF_pfflan_lang_id] DEFAULT (0) FOR [lang_id], - CONSTRAINT [DF_pfflan_option_id] DEFAULT (0) FOR [option_id], - CONSTRAINT [DF_pfflan_field_type] DEFAULT (0) FOR [field_type] -GO - -ALTER TABLE [phpbb_profile_lang] WITH NOCHECK ADD - CONSTRAINT [DF_pflang_field_id] DEFAULT (0) FOR [field_id], - CONSTRAINT [DF_pflang_lang_id] DEFAULT (0) FOR [lang_id] -GO - -ALTER TABLE [phpbb_ranks] WITH NOCHECK ADD - CONSTRAINT [DF_ranks__rank_min] DEFAULT (0) FOR [rank_min], - CONSTRAINT [DF_ranks__rank_special] DEFAULT (0) FOR [rank_special] -GO - -ALTER TABLE [phpbb_reports] WITH NOCHECK ADD - CONSTRAINT [DF_report_reason_id] DEFAULT (0) FOR [reason_id], - CONSTRAINT [DF_report_post_id] DEFAULT (0) FOR [post_id], - CONSTRAINT [DF_report_user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_report_user_notify] DEFAULT (0) FOR [user_notify], - CONSTRAINT [DF_report_report_closed] DEFAULT (0) FOR [report_closed], - CONSTRAINT [DF_report_report_time] DEFAULT (0) FOR [report_time] -GO - -ALTER TABLE [phpbb_reports_reasons] WITH NOCHECK ADD - CONSTRAINT [DF_reporr_reason_order] DEFAULT (0) FOR [reason_order] -GO - -ALTER TABLE [phpbb_search_results] WITH NOCHECK ADD - CONSTRAINT [DF_search_search_time] DEFAULT (0) FOR [search_time] -GO - -ALTER TABLE [phpbb_search_wordlist] WITH NOCHECK ADD - CONSTRAINT [DF_swlist_word_common] DEFAULT (0) FOR [word_common] -GO - -ALTER TABLE [phpbb_search_wordmatch] WITH NOCHECK ADD - CONSTRAINT [DF_swmatc_post_id] DEFAULT (0) FOR [post_id], - CONSTRAINT [DF_swmatc_word_id] DEFAULT (0) FOR [word_id], - CONSTRAINT [DF_swmatc_title_match] DEFAULT (0) FOR [title_match] -GO - -ALTER TABLE [phpbb_sessions] WITH NOCHECK ADD - CONSTRAINT [DF_sessio_session_user_id] DEFAULT (0) FOR [session_user_id], - CONSTRAINT [DF_sessio_session_last_visit] DEFAULT (0) FOR [session_last_visit], - CONSTRAINT [DF_sessio_session_start] DEFAULT (0) FOR [session_start], - CONSTRAINT [DF_sessio_session_time] DEFAULT (0) FOR [session_time], - CONSTRAINT [DF_sessio_session_ip] DEFAULT ('0') FOR [session_ip], - CONSTRAINT [DF_sessio_session_viewonline] DEFAULT (1) FOR [session_viewonline], - CONSTRAINT [DF_sessio_session_autologin] DEFAULT (0) FOR [session_autologin], - CONSTRAINT [DF_sessio_session_admin] DEFAULT (0) FOR [session_admin] -GO - -ALTER TABLE [phpbb_sessions_keys] WITH NOCHECK ADD - CONSTRAINT [DF_sessik_key_id] DEFAULT ('0') FOR [key_id], - CONSTRAINT [DF_sessik_user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_sessik_last_ip] DEFAULT ('0') FOR [last_ip], - CONSTRAINT [DF_sessik_last_login] DEFAULT (0) FOR [last_login] -GO - -ALTER TABLE [phpbb_sitelist] WITH NOCHECK ADD - CONSTRAINT [DF_siteli_ip_exclude] DEFAULT (0) FOR [ip_exclude] -GO - -ALTER TABLE [phpbb_smilies] WITH NOCHECK ADD - CONSTRAINT [DF_smilie_smiley_width] DEFAULT (0) FOR [smiley_width], - CONSTRAINT [DF_smilie_smiley_height] DEFAULT (0) FOR [smiley_height], - CONSTRAINT [DF_smilie_smiley_order] DEFAULT (0) FOR [smiley_order], - CONSTRAINT [DF_smilie_display_on_posting] DEFAULT (1) FOR [display_on_posting] -GO - -ALTER TABLE [phpbb_styles] WITH NOCHECK ADD - CONSTRAINT [DF_styles_style_active] DEFAULT (1) FOR [style_active], - CONSTRAINT [DF_styles_template_id] DEFAULT (0) FOR [template_id], - CONSTRAINT [DF_styles_theme_id] DEFAULT (0) FOR [theme_id], - CONSTRAINT [DF_styles_imageset_id] DEFAULT (0) FOR [imageset_id] -GO - -ALTER TABLE [phpbb_styles_template] WITH NOCHECK ADD - CONSTRAINT [DF_templa_bbcode_bitfield] DEFAULT (0) FOR [bbcode_bitfield], - CONSTRAINT [DF_templa_template_storedb] DEFAULT (0) FOR [template_storedb] -GO - -ALTER TABLE [phpbb_styles_template_data] WITH NOCHECK ADD - CONSTRAINT [DF_tpldat_template_id] DEFAULT (0) FOR [template_id], - CONSTRAINT [DF_tpldat_template_mtime] DEFAULT (0) FOR [template_mtime] -GO - -ALTER TABLE [phpbb_styles_theme] WITH NOCHECK ADD - CONSTRAINT [DF_theme__theme_storedb] DEFAULT (0) FOR [theme_storedb], - CONSTRAINT [DF_theme__theme_mtime] DEFAULT (0) FOR [theme_mtime] -GO - -ALTER TABLE [phpbb_topics] WITH NOCHECK ADD - CONSTRAINT [DF_topics_forum_id] DEFAULT (0) FOR [forum_id], - CONSTRAINT [DF_topics_icon_id] DEFAULT (1) FOR [icon_id], - CONSTRAINT [DF_topics_topic_attachment] DEFAULT (0) FOR [topic_attachment], - CONSTRAINT [DF_topics_topic_approved] DEFAULT (1) FOR [topic_approved], - CONSTRAINT [DF_topics_topic_reported] DEFAULT (0) FOR [topic_reported], - CONSTRAINT [DF_topics_topic_poster] DEFAULT (0) FOR [topic_poster], - CONSTRAINT [DF_topics_topic_time] DEFAULT (0) FOR [topic_time], - CONSTRAINT [DF_topics_topic_time_limit] DEFAULT (0) FOR [topic_time_limit], - CONSTRAINT [DF_topics_topic_views] DEFAULT (0) FOR [topic_views], - CONSTRAINT [DF_topics_topic_replies] DEFAULT (0) FOR [topic_replies], - CONSTRAINT [DF_topics_topic_replies_real] DEFAULT (0) FOR [topic_replies_real], - CONSTRAINT [DF_topics_topic_status] DEFAULT (0) FOR [topic_status], - CONSTRAINT [DF_topics_topic_type] DEFAULT (0) FOR [topic_type], - CONSTRAINT [DF_topics_topic_first_post_id] DEFAULT (0) FOR [topic_first_post_id], - CONSTRAINT [DF_topics_topic_last_post_id] DEFAULT (0) FOR [topic_last_post_id], - CONSTRAINT [DF_topics_topic_last_poster_id] DEFAULT (0) FOR [topic_last_poster_id], - CONSTRAINT [DF_topics_topic_last_post_time] DEFAULT (0) FOR [topic_last_post_time], - CONSTRAINT [DF_topics_topic_last_view_time] DEFAULT (0) FOR [topic_last_view_time], - CONSTRAINT [DF_topics_topic_moved_id] DEFAULT (0) FOR [topic_moved_id], - CONSTRAINT [DF_topics_topic_bumped] DEFAULT (0) FOR [topic_bumped], - CONSTRAINT [DF_topics_topic_bumper] DEFAULT (0) FOR [topic_bumper], - CONSTRAINT [DF_topics_poll_title] DEFAULT ('') FOR [poll_title], - CONSTRAINT [DF_topics_poll_start] DEFAULT (0) FOR [poll_start], - CONSTRAINT [DF_topics_poll_length] DEFAULT (0) FOR [poll_length], - CONSTRAINT [DF_topics_poll_max_options] DEFAULT (1) FOR [poll_max_options], - CONSTRAINT [DF_topics_poll_last_vote] DEFAULT (0) FOR [poll_last_vote], - CONSTRAINT [DF_topics_poll_vote_change] DEFAULT (0) FOR [poll_vote_change] -GO - -ALTER TABLE [phpbb_topics_marking] WITH NOCHECK ADD - CONSTRAINT [DF_tmarki_user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_tmarki_topic_id] DEFAULT (0) FOR [topic_id], - CONSTRAINT [DF_tmarki_forum_id] DEFAULT (0) FOR [forum_id], - CONSTRAINT [DF_tmarki_mark_time] DEFAULT (0) FOR [mark_time] -GO - -ALTER TABLE [phpbb_topics_posted] WITH NOCHECK ADD - CONSTRAINT [DF_tposte_user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_tposte_topic_id] DEFAULT (0) FOR [topic_id], - CONSTRAINT [DF_tposte_topic_posted] DEFAULT (0) FOR [topic_posted] -GO - -ALTER TABLE [phpbb_topics_watch] WITH NOCHECK ADD - CONSTRAINT [DF_twatch_topic_id] DEFAULT (0) FOR [topic_id], - CONSTRAINT [DF_twatch_user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_twatch_notify_status] DEFAULT (0) FOR [notify_status] -GO - -ALTER TABLE [phpbb_user_group] WITH NOCHECK ADD - CONSTRAINT [DF_usersg_group_id] DEFAULT (0) FOR [group_id], - CONSTRAINT [DF_usersg_user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_usersg_group_leader] DEFAULT (0) FOR [group_leader] -GO - ALTER TABLE [phpbb_users] WITH NOCHECK ADD CONSTRAINT [DF_users__user_type] DEFAULT (0) FOR [user_type], CONSTRAINT [DF_users__group_id] DEFAULT (3) FOR [group_id], @@ -1670,258 +2094,77 @@ ALTER TABLE [phpbb_users] WITH NOCHECK ADD CONSTRAINT [DF_users__user_sig_bbcode_bitf] DEFAULT (0) FOR [user_sig_bbcode_bitfield] GO -ALTER TABLE [phpbb_warnings] WITH NOCHECK ADD - CONSTRAINT [DF_warnings__user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_warnings__post_id] DEFAULT (0) FOR [post_id], - CONSTRAINT [DF_warnings__log_id] DEFAULT (0) FOR [log_id], - CONSTRAINT [DF_warnings__warning_time] DEFAULT (0) FOR [warning_time] -GO - -ALTER TABLE [phpbb_zebra] WITH NOCHECK ADD - CONSTRAINT [DF_zebra__user_id] DEFAULT (0) FOR [user_id], - CONSTRAINT [DF_zebra__zebra_id] DEFAULT (0) FOR [zebra_id], - CONSTRAINT [DF_zebra__friend] DEFAULT (0) FOR [friend], - CONSTRAINT [DF_zebra__foe] DEFAULT (0) FOR [foe] -GO - -CREATE INDEX [filetime] ON [phpbb_attachments]([filetime]) ON [PRIMARY] -GO - -CREATE INDEX [post_msg_id] ON [phpbb_attachments]([post_msg_id]) ON [PRIMARY] -GO - -CREATE INDEX [topic_id] ON [phpbb_attachments]([topic_id]) ON [PRIMARY] -GO - -CREATE INDEX [poster_id] ON [phpbb_attachments]([poster_id]) ON [PRIMARY] -GO - -CREATE INDEX [physical_filename] ON [phpbb_attachments]([physical_filename]) ON [PRIMARY] -GO - -CREATE INDEX [filesize] ON [phpbb_attachments]([filesize]) ON [PRIMARY] -GO - -CREATE INDEX [group_id] ON [phpbb_auth_groups]([group_id]) ON [PRIMARY] -GO - -CREATE INDEX [auth_option_id] ON [phpbb_auth_groups]([auth_option_id]) ON [PRIMARY] -GO - -CREATE INDEX [auth_option] ON [phpbb_auth_options]([auth_option]) ON [PRIMARY] -GO - -CREATE INDEX [role_type] ON [phpbb_auth_roles]([role_type]) ON [PRIMARY] -GO - -CREATE INDEX [user_id] ON [phpbb_auth_users]([user_id]) ON [PRIMARY] -GO - -CREATE INDEX [auth_option_id] ON [phpbb_auth_users]([auth_option_id]) ON [PRIMARY] -GO - -CREATE INDEX [order_id] ON [phpbb_bookmarks]([order_id]) ON [PRIMARY] -GO - -CREATE INDEX [topic_user_id] ON [phpbb_bookmarks]([topic_id], [user_id]) ON [PRIMARY] -GO - -CREATE INDEX [bot_active] ON [phpbb_bots]([bot_active]) ON [PRIMARY] -GO - -CREATE INDEX [is_dynamic] ON [phpbb_config]([is_dynamic]) ON [PRIMARY] -GO - -CREATE INDEX [display_on_posting] ON [phpbb_bbcodes]([display_on_posting]) ON [PRIMARY] -GO - -CREATE INDEX [save_time] ON [phpbb_drafts]([save_time]) ON [PRIMARY] -GO - -CREATE INDEX [left_right_id] ON [phpbb_forums]([left_id], [right_id]) ON [PRIMARY] -GO - -CREATE INDEX [forum_last_post_id] ON [phpbb_forums]([forum_last_post_id]) ON [PRIMARY] -GO - -CREATE INDEX [forum_id] ON [phpbb_forums_watch]([forum_id]) ON [PRIMARY] -GO - -CREATE INDEX [user_id] ON [phpbb_forums_watch]([user_id]) ON [PRIMARY] -GO - -CREATE INDEX [notify_status] ON [phpbb_forums_watch]([notify_status]) ON [PRIMARY] -GO - -CREATE INDEX [group_legend] ON [phpbb_groups]([group_legend]) ON [PRIMARY] -GO - -CREATE INDEX [log_type] ON [phpbb_log]([log_type]) ON [PRIMARY] -GO - -CREATE INDEX [forum_id] ON [phpbb_log]([forum_id]) ON [PRIMARY] -GO - -CREATE INDEX [topic_id] ON [phpbb_log]([topic_id]) ON [PRIMARY] -GO - -CREATE INDEX [reportee_id] ON [phpbb_log]([reportee_id]) ON [PRIMARY] -GO - -CREATE INDEX [user_id] ON [phpbb_log]([user_id]) ON [PRIMARY] -GO - -CREATE INDEX [display_on_index] ON [phpbb_moderator_cache]([display_on_index]) ON [PRIMARY] -GO - -CREATE INDEX [forum_id] ON [phpbb_moderator_cache]([forum_id]) ON [PRIMARY] -GO - -CREATE INDEX [module_enabled] ON [phpbb_modules]([module_enabled]) ON [PRIMARY] -GO - -CREATE INDEX [module_left_id] ON [phpbb_modules]([left_id]) ON [PRIMARY] -GO - -CREATE INDEX [poll_option_id] ON [phpbb_poll_results]([poll_option_id]) ON [PRIMARY] -GO - -CREATE INDEX [topic_id] ON [phpbb_poll_results]([topic_id]) ON [PRIMARY] -GO - -CREATE INDEX [topic_id] ON [phpbb_poll_voters]([topic_id]) ON [PRIMARY] -GO - -CREATE INDEX [vote_user_id] ON [phpbb_poll_voters]([vote_user_id]) ON [PRIMARY] -GO - -CREATE INDEX [vote_user_ip] ON [phpbb_poll_voters]([vote_user_ip]) ON [PRIMARY] -GO - -CREATE INDEX [forum_id] ON [phpbb_posts]([forum_id]) ON [PRIMARY] -GO - -CREATE INDEX [topic_id] ON [phpbb_posts]([topic_id]) ON [PRIMARY] -GO - -CREATE INDEX [poster_ip] ON [phpbb_posts]([poster_ip]) ON [PRIMARY] -GO - -CREATE INDEX [poster_id] ON [phpbb_posts]([poster_id]) ON [PRIMARY] -GO - -CREATE INDEX [post_approved] ON [phpbb_posts]([post_approved]) ON [PRIMARY] -GO - -CREATE INDEX [post_time] ON [phpbb_posts]([post_time]) ON [PRIMARY] -GO - -CREATE INDEX [author_ip] ON [phpbb_privmsgs]([author_ip]) ON [PRIMARY] -GO - -CREATE INDEX [message_time] ON [phpbb_privmsgs]([message_time]) ON [PRIMARY] -GO - -CREATE INDEX [author_id] ON [phpbb_privmsgs]([author_id]) ON [PRIMARY] -GO - -CREATE INDEX [root_level] ON [phpbb_privmsgs]([root_level]) ON [PRIMARY] -GO - -CREATE INDEX [user_id] ON [phpbb_privmsgs_folder]([user_id]) ON [PRIMARY] -GO - -CREATE INDEX [msg_id] ON [phpbb_privmsgs_to]([msg_id]) ON [PRIMARY] -GO - -CREATE INDEX [user_id] ON [phpbb_privmsgs_to]([user_id], [folder_id]) ON [PRIMARY] -GO - -CREATE INDEX [field_type] ON [phpbb_profile_fields]([field_type]) ON [PRIMARY] -GO - -CREATE INDEX [field_order] ON [phpbb_profile_fields]([field_order]) ON [PRIMARY] -GO - -CREATE INDEX [word_id] ON [phpbb_search_wordlist]([word_id]) ON [PRIMARY] -GO - -CREATE INDEX [word_id] ON [phpbb_search_wordmatch]([word_id]) ON [PRIMARY] -GO - -CREATE INDEX [session_time] ON [phpbb_sessions]([session_time]) ON [PRIMARY] -GO - -CREATE INDEX [session_user_id] ON [phpbb_sessions]([session_user_id]) ON [PRIMARY] -GO - -CREATE INDEX [last_login] ON [phpbb_sessions_keys]([last_login]) ON [PRIMARY] -GO - -CREATE UNIQUE INDEX [style_name] ON [phpbb_styles]([style_name]) ON [PRIMARY] -GO - -CREATE INDEX [template_id] ON [phpbb_styles]([template_id]) ON [PRIMARY] -GO - -CREATE INDEX [theme_id] ON [phpbb_styles]([theme_id]) ON [PRIMARY] -GO - -CREATE INDEX [imageset_id] ON [phpbb_styles]([imageset_id]) ON [PRIMARY] -GO - -CREATE UNIQUE INDEX [imageset_name] ON [phpbb_styles_imageset]([imageset_name]) ON [PRIMARY] -GO - -CREATE UNIQUE INDEX [template_name] ON [phpbb_styles_template]([template_name]) ON [PRIMARY] -GO - -CREATE INDEX [template_id] ON [phpbb_styles_template_data]([template_id]) ON [PRIMARY] -GO - -CREATE INDEX [template_filename] ON [phpbb_styles_template_data]([template_filename]) ON [PRIMARY] -GO - -CREATE UNIQUE INDEX [theme_name] ON [phpbb_styles_theme]([theme_name]) ON [PRIMARY] -GO - -CREATE INDEX [forum_id] ON [phpbb_topics]([forum_id]) ON [PRIMARY] +CREATE INDEX [user_birthday] ON [phpbb_users]([user_birthday]) ON [PRIMARY] GO -CREATE INDEX [forum_id_type] ON [phpbb_topics]([forum_id], [topic_type]) ON [PRIMARY] +CREATE INDEX [user_email_hash] ON [phpbb_users]([user_email_hash]) ON [PRIMARY] GO -CREATE INDEX [topic_last_post_time] ON [phpbb_topics]([topic_last_post_time]) ON [PRIMARY] +CREATE INDEX [username] ON [phpbb_users]([username]) ON [PRIMARY] GO -CREATE INDEX [forum_id] ON [phpbb_topics_marking]([forum_id]) ON [PRIMARY] -GO -CREATE INDEX [topic_id] ON [phpbb_topics_watch]([topic_id]) ON [PRIMARY] +/* + Table: phpbb_warnings +*/ +CREATE TABLE [phpbb_warnings] ( + [warning_id] [int] IDENTITY (1, 1) NOT NULL , + [user_id] [int] NOT NULL , + [post_id] [int] NOT NULL , + [log_id] [int] NOT NULL , + [warning_time] [int] NOT NULL +) ON [PRIMARY] GO -CREATE INDEX [user_id] ON [phpbb_topics_watch]([user_id]) ON [PRIMARY] +ALTER TABLE [phpbb_warnings] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_warnings] PRIMARY KEY CLUSTERED + ( + [warning_id] + ) ON [PRIMARY] GO -CREATE INDEX [notify_status] ON [phpbb_topics_watch]([notify_status]) ON [PRIMARY] +ALTER TABLE [phpbb_warnings] WITH NOCHECK ADD + CONSTRAINT [DF_warnings__user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_warnings__post_id] DEFAULT (0) FOR [post_id], + CONSTRAINT [DF_warnings__log_id] DEFAULT (0) FOR [log_id], + CONSTRAINT [DF_warnings__warning_time] DEFAULT (0) FOR [warning_time] GO -CREATE INDEX [group_id] ON [phpbb_user_group]([group_id]) ON [PRIMARY] -GO -CREATE INDEX [user_id] ON [phpbb_user_group]([user_id]) ON [PRIMARY] +/* + Table: phpbb_words +*/ +CREATE TABLE [phpbb_words] ( + [word_id] [int] IDENTITY (1, 1) NOT NULL , + [word] [varchar] (100) NOT NULL , + [replacement] [varchar] (100) NOT NULL +) ON [PRIMARY] GO -CREATE INDEX [group_leader] ON [phpbb_user_group]([group_leader]) ON [PRIMARY] +ALTER TABLE [phpbb_words] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_words] PRIMARY KEY CLUSTERED + ( + [word_id] + ) ON [PRIMARY] GO -CREATE INDEX [user_birthday] ON [phpbb_users]([user_birthday]) ON [PRIMARY] -GO -CREATE INDEX [user_email_hash] ON [phpbb_users]([user_email_hash]) ON [PRIMARY] +/* + Table: phpbb_zebra +*/ +CREATE TABLE [phpbb_zebra] ( + [user_id] [int] NOT NULL , + [zebra_id] [int] NOT NULL , + [friend] [int] NOT NULL , + [foe] [int] NOT NULL +) ON [PRIMARY] GO -CREATE INDEX [username] ON [phpbb_users]([username]) ON [PRIMARY] +ALTER TABLE [phpbb_zebra] WITH NOCHECK ADD + CONSTRAINT [DF_zebra__user_id] DEFAULT (0) FOR [user_id], + CONSTRAINT [DF_zebra__zebra_id] DEFAULT (0) FOR [zebra_id], + CONSTRAINT [DF_zebra__friend] DEFAULT (0) FOR [friend], + CONSTRAINT [DF_zebra__foe] DEFAULT (0) FOR [foe] GO CREATE INDEX [user_id] ON [phpbb_zebra]([user_id]) ON [PRIMARY] @@ -1930,5 +2173,6 @@ GO CREATE INDEX [zebra_id] ON [phpbb_zebra]([zebra_id]) ON [PRIMARY] GO + COMMIT GO diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index b1a94e4e89..db15d91645 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -14,7 +14,7 @@ CREATE TABLE phpbb_attachments ( physical_filename varchar(255) NOT NULL, real_filename varchar(255) NOT NULL, download_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - comment varchar(255), + comment text, extension varchar(100), mimetype varchar(100), filesize int(20) UNSIGNED NOT NULL, @@ -43,7 +43,7 @@ CREATE TABLE phpbb_auth_groups ( # Table: 'phpbb_auth_options' CREATE TABLE phpbb_auth_options ( auth_option_id mediumint(8) UNSIGNED NOT NULL auto_increment, - auth_option char(20) NOT NULL, + auth_option varchar(20) NOT NULL, is_global tinyint(1) DEFAULT '0' NOT NULL, is_local tinyint(1) DEFAULT '0' NOT NULL, founder_only tinyint(1) DEFAULT '0' NOT NULL, @@ -54,7 +54,7 @@ CREATE TABLE phpbb_auth_options ( # Table: 'phpbb_auth_roles' CREATE TABLE phpbb_auth_roles ( role_id mediumint(8) UNSIGNED NOT NULL auto_increment, - role_name varchar(50) DEFAULT '' NOT NULL, + role_name varchar(255) DEFAULT '' NOT NULL, role_type varchar(10) DEFAULT '' NOT NULL, role_group_ids varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (role_id), @@ -85,12 +85,12 @@ 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(50) DEFAULT '' NOT NULL, + ban_email varchar(100) DEFAULT '' NOT NULL, ban_start int(11) DEFAULT '0' NOT NULL, ban_end int(11) DEFAULT '0' NOT NULL, ban_exclude tinyint(1) DEFAULT '0' NOT NULL, - ban_reason varchar(255) DEFAULT '' NOT NULL, - ban_give_reason varchar(255) DEFAULT '' NOT NULL, + ban_reason text, + ban_give_reason text, PRIMARY KEY (ban_id) ); @@ -100,11 +100,11 @@ CREATE TABLE phpbb_bbcodes ( bbcode_tag varchar(16) DEFAULT '' NOT NULL, display_on_posting tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, bbcode_match varchar(255) DEFAULT '' NOT NULL, - bbcode_tpl text DEFAULT '' NOT NULL, + bbcode_tpl text, first_pass_match varchar(255) DEFAULT '' NOT NULL, first_pass_replace varchar(255) DEFAULT '' NOT NULL, second_pass_match varchar(255) DEFAULT '' NOT NULL, - second_pass_replace text DEFAULT '' NOT NULL, + second_pass_replace text, PRIMARY KEY (bbcode_id), KEY display_in_posting (display_on_posting) ); @@ -122,11 +122,11 @@ CREATE TABLE phpbb_bookmarks ( CREATE TABLE phpbb_bots ( bot_id tinyint(3) UNSIGNED NOT NULL auto_increment, bot_active tinyint(1) DEFAULT '1' NOT NULL, - bot_name varchar(255) DEFAULT '' NOT NULL, + bot_name text, user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - bot_agent varchar(255) DEFAULT '' NOT NULL, + bot_agent varchar(255) DEFAULT '' NOT NULL, bot_ip varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (bot_id), + PRIMARY KEY (bot_id), KEY bot_active (bot_active) ); @@ -134,7 +134,7 @@ CREATE TABLE phpbb_bots ( CREATE TABLE phpbb_cache ( var_name varchar(255) DEFAULT '' NOT NULL, var_expires int(10) UNSIGNED DEFAULT '0' NOT NULL, - var_data mediumtext NOT NULL, + var_data mediumtext, PRIMARY KEY (var_name) ); @@ -152,14 +152,14 @@ 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 char(8) DEFAULT '' NOT NULL, + code varchar(8) DEFAULT '' NOT NULL, PRIMARY KEY (session_id,confirm_id) ); # Table: 'phpbb_disallow' CREATE TABLE phpbb_disallow ( disallow_id mediumint(8) UNSIGNED NOT NULL auto_increment, - disallow_username varchar(30) DEFAULT '' NOT NULL, + disallow_username varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (disallow_id) ); @@ -170,8 +170,8 @@ CREATE TABLE phpbb_drafts ( 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(60), - draft_message mediumtext DEFAULT '' NOT NULL, + draft_subject text, + draft_message mediumtext, PRIMARY KEY (draft_id), KEY save_time (save_time) ); @@ -187,13 +187,13 @@ CREATE TABLE phpbb_extensions ( # Table: 'phpbb_extension_groups' CREATE TABLE phpbb_extension_groups ( group_id mediumint(8) NOT NULL auto_increment, - group_name char(20) NOT NULL, + group_name varchar(255) NOT NULL, cat_id tinyint(2) DEFAULT '0' NOT NULL, allow_group tinyint(1) DEFAULT '0' NOT NULL, download_mode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - upload_icon varchar(100) DEFAULT '' NOT NULL, + upload_icon varchar(255) DEFAULT '' NOT NULL, max_filesize int(20) DEFAULT '0' NOT NULL, - allowed_forums text NOT NULL, + allowed_forums text, allow_in_pm tinyint(1) DEFAULT '0' NOT NULL, PRIMARY KEY (group_id) ); @@ -205,16 +205,16 @@ CREATE TABLE phpbb_forums ( left_id smallint(5) UNSIGNED NOT NULL, right_id smallint(5) UNSIGNED NOT NULL, forum_parents text, - forum_name varchar(150) NOT NULL, + forum_name text, forum_desc text, forum_desc_bitfield int(11) UNSIGNED DEFAULT '0' NOT NULL, forum_desc_uid varchar(5) DEFAULT '' NOT NULL, - forum_link varchar(200) DEFAULT '' NOT NULL, - forum_password varchar(32) DEFAULT '' NOT NULL, + forum_link varchar(255) DEFAULT '' NOT NULL, + forum_password varchar(40) DEFAULT '' NOT NULL, forum_style tinyint(4) UNSIGNED, - forum_image varchar(50) DEFAULT '' NOT NULL, - forum_rules text DEFAULT '' NOT NULL, - forum_rules_link varchar(200) DEFAULT '' NOT NULL, + forum_image varchar(255) DEFAULT '' NOT NULL, + forum_rules text, + forum_rules_link varchar(255) DEFAULT '' NOT NULL, forum_rules_bitfield int(11) UNSIGNED DEFAULT '0' NOT NULL, forum_rules_uid varchar(5) DEFAULT '' NOT NULL, forum_topics_per_page tinyint(4) UNSIGNED DEFAULT '0' NOT NULL, @@ -226,7 +226,7 @@ CREATE TABLE phpbb_forums ( forum_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, forum_last_poster_id mediumint(8) DEFAULT '0' NOT NULL, forum_last_post_time int(11) DEFAULT '0' NOT NULL, - forum_last_poster_name varchar(30), + forum_last_poster_name varchar(255), forum_flags tinyint(4) DEFAULT '0' NOT NULL, display_on_index tinyint(1) DEFAULT '1' NOT NULL, enable_indexing tinyint(1) DEFAULT '1' NOT NULL, @@ -245,7 +245,7 @@ CREATE TABLE phpbb_forums ( CREATE TABLE phpbb_forum_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, + session_id varchar(32) DEFAULT '' NOT NULL, PRIMARY KEY (forum_id,user_id,session_id) ); @@ -271,12 +271,12 @@ CREATE TABLE phpbb_forums_watch ( CREATE TABLE phpbb_groups ( group_id mediumint(8) NOT NULL auto_increment, group_type tinyint(4) DEFAULT '1' NOT NULL, - group_name varchar(40) DEFAULT '' NOT NULL, + group_name varchar(255) DEFAULT '' NOT NULL, group_desc text, group_desc_bitfield int(11) UNSIGNED DEFAULT '0' NOT NULL, group_desc_uid varchar(5) DEFAULT '' NOT NULL, group_display tinyint(1) DEFAULT '0' NOT NULL, - group_avatar varchar(100) DEFAULT '' NOT NULL, + group_avatar varchar(255) DEFAULT '' NOT NULL, group_avatar_type tinyint(4) DEFAULT '0' NOT NULL, group_avatar_width tinyint(4) UNSIGNED DEFAULT '0' NOT NULL, group_avatar_height tinyint(4) UNSIGNED DEFAULT '0' NOT NULL, @@ -294,7 +294,7 @@ CREATE TABLE phpbb_groups ( # Table: 'phpbb_icons' CREATE TABLE phpbb_icons ( icons_id tinyint(4) UNSIGNED NOT NULL auto_increment, - icons_url varchar(50), + icons_url varchar(255), icons_width tinyint(4) UNSIGNED NOT NULL, icons_height tinyint(4) UNSIGNED NOT NULL, icons_order tinyint(4) UNSIGNED NOT NULL, @@ -307,9 +307,9 @@ CREATE TABLE phpbb_lang ( lang_id tinyint(4) UNSIGNED NOT NULL auto_increment, lang_iso varchar(5) NOT NULL, lang_dir varchar(30) NOT NULL, - lang_english_name varchar(30), - lang_local_name varchar(100), - lang_author varchar(100), + lang_english_name varchar(100), + lang_local_name varchar(255), + lang_author varchar(255), PRIMARY KEY (lang_id) ); @@ -337,9 +337,9 @@ CREATE TABLE phpbb_log ( CREATE TABLE phpbb_moderator_cache ( forum_id mediumint(8) UNSIGNED NOT NULL, user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - username char(30) DEFAULT '' NOT NULL, + username varchar(255) DEFAULT '' NOT NULL, group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - groupname char(30) DEFAULT '' NOT NULL, + group_name varchar(255) DEFAULT '' NOT NULL, display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, KEY display_on_index (display_on_index), KEY forum_id (forum_id) @@ -347,19 +347,19 @@ CREATE TABLE phpbb_moderator_cache ( # Table: 'phpbb_modules' CREATE TABLE phpbb_modules ( - module_id smallint(5) unsigned NOT NULL auto_increment, + module_id mediumint(8) UNSIGNED NOT NULL auto_increment, module_enabled tinyint(1) NOT NULL default '1', module_display tinyint(1) NOT NULL default '1', - module_name varchar(20) NOT NULL default '', - module_class varchar(4) NOT NULL default '', - parent_id smallint(5) unsigned NOT NULL default '0', - left_id smallint(5) unsigned NOT NULL default '0', - right_id smallint(5) unsigned NOT NULL default '0', - module_langname varchar(50) NOT NULL default '', + module_name varchar(255) NOT NULL default '', + module_class varchar(10) NOT NULL default '', + parent_id mediumint(8) unsigned NOT NULL default '0', + left_id mediumint(8) unsigned NOT NULL default '0', + right_id mediumint(8) 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 '', PRIMARY KEY (module_id), - KEY left_id (left_id), + KEY left_right_id (left_id, right_id), KEY module_enabled (module_enabled) ); @@ -367,7 +367,7 @@ CREATE TABLE phpbb_modules ( CREATE TABLE phpbb_poll_results ( poll_option_id tinyint(4) UNSIGNED DEFAULT '0' NOT NULL, topic_id mediumint(8) UNSIGNED NOT NULL, - poll_option_text varchar(255) NOT NULL, + poll_option_text text, poll_option_total mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, KEY poll_option_id (poll_option_id), KEY topic_id (topic_id) @@ -399,8 +399,8 @@ CREATE TABLE phpbb_posts ( enable_smilies tinyint(1) DEFAULT '1' NOT NULL, enable_magic_url tinyint(1) DEFAULT '1' NOT NULL, enable_sig tinyint(1) DEFAULT '1' NOT NULL, - post_username varchar(30), - post_subject varchar(60), + post_username varchar(255), + post_subject text, post_text mediumtext, post_checksum varchar(32) NOT NULL, post_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, @@ -408,7 +408,7 @@ CREATE TABLE phpbb_posts ( bbcode_bitfield int(11) UNSIGNED DEFAULT '0' NOT NULL, bbcode_uid varchar(5) DEFAULT '' NOT NULL, post_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - post_edit_reason varchar(100), + post_edit_reason text, post_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, post_edit_count smallint(5) UNSIGNED DEFAULT '0' NOT NULL, post_edit_locked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, @@ -433,9 +433,9 @@ CREATE TABLE phpbb_privmsgs ( enable_smilies tinyint(1) DEFAULT '1' NOT NULL, enable_magic_url tinyint(1) DEFAULT '1' NOT NULL, enable_sig tinyint(1) DEFAULT '1' NOT NULL, - message_subject varchar(60), + message_subject text, message_text mediumtext, - message_edit_reason varchar(100), + message_edit_reason text, message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, message_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, message_attachment tinyint(1) DEFAULT '0' NOT NULL, @@ -456,7 +456,7 @@ CREATE TABLE phpbb_privmsgs ( 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(40) DEFAULT '' 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) @@ -495,8 +495,8 @@ CREATE TABLE phpbb_privmsgs_to ( # Table: 'phpbb_profile_fields' CREATE TABLE phpbb_profile_fields ( field_id mediumint(8) UNSIGNED NOT NULL auto_increment, - field_name varchar(50) DEFAULT '' NOT NULL, - field_desc varchar(255) DEFAULT '' NOT NULL, + field_name varchar(255) DEFAULT '' NOT NULL, + field_desc text, field_type mediumint(8) UNSIGNED NOT NULL, field_ident varchar(20) DEFAULT '' NOT NULL, field_length varchar(20) DEFAULT '' NOT NULL, @@ -537,7 +537,7 @@ CREATE TABLE phpbb_profile_lang ( field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, lang_id tinyint(4) UNSIGNED DEFAULT '0' NOT NULL, lang_name varchar(255) DEFAULT '' NOT NULL, - lang_explain text NOT NULL, + lang_explain text, lang_default_value varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (field_id, lang_id) ); @@ -545,10 +545,10 @@ CREATE TABLE phpbb_profile_lang ( # Table: 'phpbb_ranks' CREATE TABLE phpbb_ranks ( rank_id smallint(5) UNSIGNED NOT NULL auto_increment, - rank_title varchar(50) NOT NULL, + rank_title varchar(255) NOT NULL, rank_min mediumint(8) DEFAULT '0' NOT NULL, rank_special tinyint(1) DEFAULT '0', - rank_image varchar(100), + rank_image varchar(255), PRIMARY KEY (rank_id) ); @@ -561,7 +561,7 @@ CREATE TABLE phpbb_reports ( user_notify tinyint(1) DEFAULT '0' NOT NULL, report_closed tinyint(1) DEFAULT '0' NOT NULL, report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - report_text text NOT NULL, + report_text mediumtext, PRIMARY KEY (report_id) ); @@ -569,7 +569,7 @@ CREATE TABLE phpbb_reports ( CREATE TABLE phpbb_reports_reasons ( reason_id smallint(6) NOT NULL auto_increment, reason_title varchar(255) DEFAULT '' NOT NULL, - reason_description text NOT NULL, + reason_description text, reason_order tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (reason_id) ); @@ -578,8 +578,8 @@ CREATE TABLE phpbb_reports_reasons ( CREATE TABLE phpbb_search_results ( search_key varchar(32) DEFAULT '' NOT NULL, search_time int(11) DEFAULT '0' NOT NULL, - search_keywords mediumtext NOT NULL, - search_authors mediumtext NOT NULL, + search_keywords mediumtext, + search_authors mediumtext, PRIMARY KEY (search_key) ); @@ -640,9 +640,9 @@ CREATE TABLE phpbb_sitelist ( # Table: 'phpbb_smilies' CREATE TABLE phpbb_smilies ( smiley_id tinyint(4) UNSIGNED NOT NULL auto_increment, - code char(10), - emotion char(50), - smiley_url char(50), + code varchar(10), + emotion varchar(50), + smiley_url varchar(50), smiley_width tinyint(4) UNSIGNED NOT NULL, smiley_height tinyint(4) UNSIGNED NOT NULL, smiley_order tinyint(4) UNSIGNED NOT NULL, @@ -653,8 +653,8 @@ CREATE TABLE phpbb_smilies ( # Table: 'phpbb_styles' CREATE TABLE phpbb_styles ( style_id tinyint(4) UNSIGNED NOT NULL auto_increment, - style_name varchar(30) DEFAULT '' NOT NULL, - style_copyright varchar(50) DEFAULT '' NOT NULL, + style_name varchar(255) DEFAULT '' NOT NULL, + style_copyright varchar(255) DEFAULT '' NOT NULL, style_active tinyint(1) DEFAULT '1' NOT NULL, template_id tinyint(4) UNSIGNED NOT NULL, theme_id tinyint(4) UNSIGNED NOT NULL, @@ -669,9 +669,9 @@ CREATE TABLE phpbb_styles ( # Table: 'phpbb_styles_template' CREATE TABLE phpbb_styles_template ( template_id tinyint(4) UNSIGNED NOT NULL auto_increment, - template_name varchar(30) NOT NULL, - template_copyright varchar(50) NOT NULL, - template_path varchar(30) NOT NULL, + template_name varchar(255) NOT NULL, + template_copyright varchar(255) NOT NULL, + template_path varchar(100) NOT NULL, bbcode_bitfield int(11) UNSIGNED DEFAULT '0' NOT NULL, template_storedb tinyint(1) DEFAULT '0' NOT NULL, PRIMARY KEY (template_id), @@ -681,8 +681,8 @@ CREATE TABLE phpbb_styles_template ( # Table: 'phpbb_styles_template_data' CREATE TABLE phpbb_styles_template_data ( template_id tinyint(4) UNSIGNED NOT NULL, - template_filename varchar(50) DEFAULT '' NOT NULL, - template_included text NOT NULL, + template_filename varchar(100) DEFAULT '' NOT NULL, + template_included text, template_mtime int(11) DEFAULT '0' NOT NULL, template_data mediumtext, KEY (template_id), @@ -692,12 +692,12 @@ CREATE TABLE phpbb_styles_template_data ( # Table: 'phpbb_styles_theme' CREATE TABLE phpbb_styles_theme ( theme_id tinyint(4) UNSIGNED NOT NULL auto_increment, - theme_name varchar(30) DEFAULT '' NOT NULL, - theme_copyright varchar(50) DEFAULT '' NOT NULL, - theme_path varchar(30) DEFAULT '' NOT NULL, + theme_name varchar(255) DEFAULT '' NOT NULL, + theme_copyright varchar(255) DEFAULT '' NOT NULL, + theme_path varchar(100) DEFAULT '' NOT NULL, theme_storedb tinyint(1) DEFAULT '0' NOT NULL, theme_mtime int(11) DEFAULT '0' NOT NULL, - theme_data mediumtext DEFAULT '' NOT NULL, + theme_data mediumtext, PRIMARY KEY (theme_id), UNIQUE theme_name (theme_name) ); @@ -705,9 +705,9 @@ CREATE TABLE phpbb_styles_theme ( # Table: 'phpbb_styles_imageset' CREATE TABLE phpbb_styles_imageset ( imageset_id tinyint(4) UNSIGNED NOT NULL auto_increment, - imageset_name varchar(30) DEFAULT '' NOT NULL, - imageset_copyright varchar(50) DEFAULT '' NOT NULL, - imageset_path varchar(30) DEFAULT '' NOT NULL, + imageset_name varchar(255) DEFAULT '' NOT NULL, + imageset_copyright varchar(255) DEFAULT '' NOT NULL, + imageset_path varchar(100) DEFAULT '' NOT NULL, site_logo varchar(200) DEFAULT '' NOT NULL, btn_post varchar(200) DEFAULT '' NOT NULL, btn_post_pm varchar(200) DEFAULT '' NOT NULL, @@ -792,12 +792,12 @@ CREATE TABLE phpbb_styles_imageset ( # Table: 'phpbb_topics' CREATE TABLE phpbb_topics ( topic_id mediumint(8) UNSIGNED NOT NULL auto_increment, - forum_id smallint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_id smallint(5) UNSIGNED DEFAULT '0' NOT NULL, icon_id tinyint(4) UNSIGNED DEFAULT '1' NOT NULL, topic_attachment tinyint(1) DEFAULT '0' NOT NULL, topic_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, topic_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - topic_title varchar(60) NOT NULL, + topic_title text, topic_poster mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, topic_time int(11) DEFAULT '0' NOT NULL, topic_time_limit int(11) DEFAULT '0' NOT NULL, @@ -807,16 +807,16 @@ CREATE TABLE phpbb_topics ( 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(30), + topic_first_poster_name varchar(255), 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(30), + topic_last_poster_name varchar(255), 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_title text, poll_start int(11) DEFAULT '0' NOT NULL, poll_length int(11) DEFAULT '0' NOT NULL, poll_max_options tinyint(4) UNSIGNED DEFAULT '1' NOT NULL, @@ -872,13 +872,13 @@ CREATE TABLE phpbb_users ( user_id mediumint(8) UNSIGNED NOT NULL auto_increment, user_type tinyint(1) DEFAULT '0' NOT NULL, group_id mediumint(8) DEFAULT '3' NOT NULL, - user_permissions text DEFAULT '' NOT NULL, + user_permissions text, user_ip varchar(40) DEFAULT '' NOT NULL, user_regdate int(11) DEFAULT '0' NOT NULL, - username varchar(30) DEFAULT '' NOT NULL, - user_password varchar(32) DEFAULT '' NOT NULL, + username varchar(255) DEFAULT '' NOT NULL, + user_password varchar(40) DEFAULT '' NOT NULL, user_passchg int(11) DEFAULT '0' NOT NULL, - user_email varchar(60) 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) DEFAULT '0' NOT NULL, @@ -918,11 +918,11 @@ CREATE TABLE phpbb_users ( user_allow_viewemail tinyint(1) DEFAULT '1' NOT NULL, user_allow_massemail tinyint(1) DEFAULT '1' NOT NULL, user_options int(11) DEFAULT '893' NOT NULL, - user_avatar varchar(100) DEFAULT '' NOT NULL, + user_avatar varchar(255) DEFAULT '' NOT NULL, user_avatar_type tinyint(2) DEFAULT '0' NOT NULL, user_avatar_width tinyint(4) UNSIGNED DEFAULT '0' NOT NULL, user_avatar_height tinyint(4) UNSIGNED DEFAULT '0' NOT NULL, - user_sig text DEFAULT '' NOT NULL, + user_sig text, user_sig_bbcode_uid varchar(5) DEFAULT '' NOT NULL, user_sig_bbcode_bitfield int(11) DEFAULT '0' NOT NULL, user_from varchar(100) DEFAULT '' NOT NULL, @@ -931,7 +931,7 @@ CREATE TABLE phpbb_users ( user_yim varchar(255) DEFAULT '' NOT NULL, user_msnm varchar(255) DEFAULT '' NOT NULL, user_jabber varchar(255) DEFAULT '' NOT NULL, - user_website varchar(100) DEFAULT '' NOT NULL, + user_website varchar(200) DEFAULT '' NOT NULL, user_occ varchar(255) DEFAULT '' NOT NULL, user_interests varchar(255) DEFAULT '' NOT NULL, user_actkey varchar(32) DEFAULT '' NOT NULL, @@ -956,8 +956,8 @@ CREATE TABLE phpbb_warnings ( # Table: 'phpbb_words' CREATE TABLE phpbb_words ( word_id mediumint(8) UNSIGNED NOT NULL auto_increment, - word char(100) NOT NULL, - replacement char(100) NOT NULL, + word varchar(255) NOT NULL, + replacement varchar(255) NOT NULL, PRIMARY KEY (word_id) ); @@ -969,4 +969,4 @@ CREATE TABLE phpbb_zebra ( foe tinyint(1) DEFAULT '0' NOT NULL, KEY user_id (user_id), KEY zebra_id (zebra_id) -);
\ No newline at end of file +); diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 8491c2f58a..bf4fedf512 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -10,7 +10,7 @@ for phpBB you can leave this section commented out! The first set of statements create a phpBB tablespace and a phpBB user, - make sure you change the password of the phpBB user befor you run this script!! + make sure you change the password of the phpBB user before you run this script!! */ /* @@ -51,7 +51,7 @@ CREATE TABLE phpbb_attachments ( physical_filename varchar2(255), real_filename varchar2(255), download_count number(8) DEFAULT '0' NOT NULL, - comment_ varchar2(255), + comment clob, extension varchar2(100), mimetype varchar2(100), filesize number(20) NOT NULL, @@ -61,34 +61,35 @@ CREATE TABLE phpbb_attachments ( ) / -CREATE SEQUENCE sq_phpbb_attachments_attach_id +CREATE SEQUENCE phpbb_attachments_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_attachments_attach_id +CREATE OR REPLACE TRIGGER ai_phpbb_attachments_seq BEFORE INSERT ON phpbb_attachments FOR EACH ROW WHEN ( new.attach_id IS NULL OR new.attach_id = 0 ) BEGIN - SELECT sq_phpbb_attachments_attach_id.nextval + SELECT phpbb_attachments_seq.nextval INTO :new.attach_id FROM dual; END; / -CREATE INDEX filetime on phpbb_attachments (filetime) +CREATE INDEX phpbb_attachments_filetime on phpbb_attachments (filetime) / -CREATE INDEX post_msg_id on phpbb_attachments (post_msg_id) +CREATE INDEX phpbb_attachments_post_msg_id on phpbb_attachments (post_msg_id) / -CREATE INDEX topic_id on phpbb_attachments (topic_id) +CREATE INDEX phpbb_attachments_topic_id on phpbb_attachments (topic_id) / -CREATE INDEX poster_id on phpbb_attachments (poster_id) +CREATE INDEX phpbb_attachments_poster_id on phpbb_attachments (poster_id) / -CREATE INDEX physical_filename on phpbb_attachments (physical_filename) +CREATE INDEX phpbb_attachments_physical_filename on phpbb_attachments (physical_filename) / -CREATE INDEX filesize on phpbb_attachments (filesize) +CREATE INDEX phpbb_attachments_filesize on phpbb_attachments (filesize) / + /* Table: phpbb_auth_groups */ @@ -101,11 +102,12 @@ CREATE TABLE phpbb_auth_groups ( ) / -CREATE INDEX group_id on phpbb_auth_groups (group_id) +CREATE INDEX phpbb_auth_groups_group_id on phpbb_auth_groups (group_id) / -CREATE INDEX auth_option_id on phpbb_auth_groups (auth_option_id) +CREATE INDEX phpbb_auth_groups_auth_option_id on phpbb_auth_groups (auth_option_id) / + /* Table: phpbb_auth_options */ @@ -119,54 +121,56 @@ CREATE TABLE phpbb_auth_options ( ) / -CREATE SEQUENCE sq_phpbb_auth_options_auth_opt +CREATE SEQUENCE phpbb_auth_options_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_auth_options_auth_opt +CREATE OR REPLACE TRIGGER ai_phpbb_auth_options_seq BEFORE INSERT ON phpbb_auth_options FOR EACH ROW WHEN ( new.auth_option_id IS NULL OR new.auth_option_id = 0 ) BEGIN - SELECT sq_phpbb_auth_options_auth_opt.nextval + SELECT phpbb_auth_options_seq.nextval INTO :new.auth_option_id FROM dual; END; / -CREATE INDEX auth_option on phpbb_auth_options (auth_option) +CREATE INDEX phpbb_auth_options_auth_option on phpbb_auth_options (auth_option) / + /* Table: phpbb_auth_roles */ CREATE TABLE phpbb_auth_roles ( role_id number(8) NOT NULL, - role_name varchar2(50) DEFAULT '', + role_name varchar2(255) DEFAULT '', role_type varchar2(10) DEFAULT '', role_group_ids varchar2(255) DEFAULT '' NOT NULL, CONSTRAINT pk_phpbb_auth_roles PRIMARY KEY (role_id) ) / -CREATE SEQUENCE sq_phpbb_auth_roles_role_i +CREATE SEQUENCE phpbb_auth_roles_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_auth_roles_role_i +CREATE OR REPLACE TRIGGER ai_phpbb_auth_roles_seq BEFORE INSERT ON phpbb_auth_roles FOR EACH ROW WHEN ( new.role_id IS NULL OR new.role_id = 0 ) BEGIN - SELECT sq_phpbb_auth_roles_role_i.nextval + SELECT phpbb_auth_roles_seq.nextval INTO :new.role_id FROM dual; END; / -CREATE INDEX role_type on phpbb_auth_roles (role_type) +CREATE INDEX phpbb_auth_roles_role_type on phpbb_auth_roles (role_type) / + /* Table: phpbb_auth_roles_data */ @@ -178,6 +182,7 @@ CREATE TABLE phpbb_auth_roles_data ( ) / + /* Table: phpbb_auth_users */ @@ -190,11 +195,12 @@ CREATE TABLE phpbb_auth_users ( ) / -CREATE INDEX user_id on phpbb_auth_users (user_id) +CREATE INDEX phpbb_auth_users_user_id on phpbb_auth_users (user_id) / -CREATE INDEX auth_option_id02 on phpbb_auth_users (auth_option_id) +CREATE INDEX phpbb_auth_users_auth_option_id on phpbb_auth_users (auth_option_id) / + /* Table: phpbb_banlist */ @@ -202,31 +208,32 @@ 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(50) DEFAULT '', + ban_email varchar2(100) 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(255) DEFAULT '', - ban_give_reason varchar2(255) DEFAULT '', + ban_reason clob, + ban_give_reason clob, CONSTRAINT pk_phpbb_banlist PRIMARY KEY (ban_id) ) / -CREATE SEQUENCE sq_phpbb_banlist_ban_id +CREATE SEQUENCE phpbb_banlist_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_banlist_ban_id +CREATE OR REPLACE TRIGGER ai_phpbb_banlist_seq BEFORE INSERT ON phpbb_banlist FOR EACH ROW WHEN ( new.ban_id IS NULL OR new.ban_id = 0 ) BEGIN - SELECT sq_phpbb_banlist_ban_id.nextval + SELECT phpbb_banlist_seq.nextval INTO :new.ban_id FROM dual; END; / + /* Table: phpbb_bbcodes */ @@ -235,18 +242,19 @@ CREATE TABLE phpbb_bbcodes ( bbcode_tag varchar2(16) DEFAULT '', display_on_posting number(1) DEFAULT '0' NOT NULL, bbcode_match varchar2(255) DEFAULT '', - bbcode_tpl clob DEFAULT '', + bbcode_tpl clob, first_pass_match varchar2(255) DEFAULT '', first_pass_replace varchar2(255) DEFAULT '', second_pass_match varchar2(255) DEFAULT '', - second_pass_replace clob DEFAULT '', + second_pass_replace clob, CONSTRAINT pk_phpbb_bbcodes PRIMARY KEY (bbcode_id) ) / -CREATE INDEX display_on_posting on phpbb_bbcodes (display_on_posting) +CREATE INDEX phpbb_bbcodes_display_on_posting on phpbb_bbcodes (display_on_posting) / + /* Table: phpbb_bookmarks */ @@ -257,18 +265,19 @@ CREATE TABLE phpbb_bookmarks ( ) / -CREATE INDEX order_id on phpbb_bookmarks (order_id) +CREATE INDEX phpbb_bookmarks_order_id on phpbb_bookmarks (order_id) / -CREATE INDEX topic_user_id on phpbb_bookmarks (topic_id, user_id) +CREATE INDEX phpbb_bookmarks_topic_user_id on phpbb_bookmarks (topic_id, user_id) / + /* Table: phpbb_bots */ CREATE TABLE phpbb_bots ( bot_id number(3) NOT NULL, bot_active number(1) DEFAULT '1' NOT NULL, - bot_name varchar2(255) DEFAULT '', + bot_name clob, user_id number(8) DEFAULT '0' NOT NULL, bot_agent varchar2(255) DEFAULT '', bot_ip varchar2(255) DEFAULT '', @@ -276,24 +285,25 @@ CREATE TABLE phpbb_bots ( ) / -CREATE SEQUENCE sq_phpbb_bots_bot_id +CREATE SEQUENCE phpbb_bots_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_bots_bot_id +CREATE OR REPLACE TRIGGER ai_phpbb_bots_seq BEFORE INSERT ON phpbb_bots FOR EACH ROW WHEN ( new.bot_id IS NULL OR new.bot_id = 0 ) BEGIN - SELECT sq_phpbb_bots_bot_id.nextval + SELECT phpbb_bots_seq.nextval INTO :new.bot_id FROM dual; END; / -CREATE INDEX bot_active on phpbb_bots (bot_active) +CREATE INDEX phpbb_bots_bot_active on phpbb_bots (bot_active) / + /* Table: phpbb_cache */ @@ -305,6 +315,7 @@ CREATE TABLE phpbb_cache ( ) / + /* Table: phpbb_config */ @@ -316,9 +327,10 @@ CREATE TABLE phpbb_config ( ) / -CREATE INDEX is_dynamic on phpbb_config (is_dynamic) +CREATE INDEX phpbb_config_is_dynamic on phpbb_config (is_dynamic) / + /* Table: phpbb_confirm */ @@ -331,31 +343,33 @@ CREATE TABLE phpbb_confirm ( ) / + /* Table: phpbb_disallow */ CREATE TABLE phpbb_disallow ( disallow_id number(8) NOT NULL, - disallow_username varchar2(30) DEFAULT '', + disallow_username varchar2(255) DEFAULT '', CONSTRAINT pk_phpbb_disallow PRIMARY KEY (disallow_id) ) / -CREATE SEQUENCE sq_phpbb_disallow_disallow_id +CREATE SEQUENCE phpbb_disallow_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_disallow_disallow_id +CREATE OR REPLACE TRIGGER ai_phpbb_disallow_seq BEFORE INSERT ON phpbb_disallow FOR EACH ROW WHEN ( new.disallow_id IS NULL OR new.disallow_id = 0 ) BEGIN - SELECT sq_phpbb_disallow_disallow_id.nextval + SELECT phpbb_disallow_seq.nextval INTO :new.disallow_id FROM dual; END; / + /* Table: phpbb_drafts */ @@ -365,30 +379,31 @@ CREATE TABLE phpbb_drafts ( 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(60), - draft_message clob DEFAULT '', + draft_subject clob, + draft_message clob, CONSTRAINT pk_phpbb_drafts PRIMARY KEY (draft_id) ) / -CREATE SEQUENCE sq_phpbb_drafts_draft_id +CREATE SEQUENCE phpbb_drafts_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_drafts_draft_id +CREATE OR REPLACE TRIGGER ai_phpbb_drafts_seq BEFORE INSERT ON phpbb_drafts FOR EACH ROW WHEN ( new.draft_id IS NULL OR new.draft_id = 0 ) BEGIN - SELECT sq_phpbb_drafts_draft_id.nextval + SELECT phpbb_drafts_seq.nextval INTO :new.draft_id FROM dual; END; / -CREATE INDEX save_time on phpbb_drafts (save_time) +CREATE INDEX phpbb_drafts_save_time on phpbb_drafts (save_time) / + /* Table: phpbb_extensions */ @@ -400,31 +415,32 @@ CREATE TABLE phpbb_extensions ( ) / -CREATE SEQUENCE sq_phpbb_extensions_extension_ +CREATE SEQUENCE phpbb_extensions_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_extensions_extension_ +CREATE OR REPLACE TRIGGER ai_phpbb_extensions_seq BEFORE INSERT ON phpbb_extensions FOR EACH ROW WHEN ( new.extension_id IS NULL OR new.extension_id = 0 ) BEGIN - SELECT sq_phpbb_extensions_extension_.nextval + 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(20), + group_name varchar2(255), 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(100) DEFAULT '', + upload_icon varchar2(255) DEFAULT '', max_filesize number(20) DEFAULT '0' NOT NULL, allowed_forums clob, allow_in_pm number(1) DEFAULT '0' NOT NULL, @@ -432,21 +448,22 @@ CREATE TABLE phpbb_extension_groups ( ) / -CREATE SEQUENCE sq_phpbb_extension_groups_grou +CREATE SEQUENCE phpbb_extension_groups_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_extension_groups_grou +CREATE OR REPLACE TRIGGER ai_phpbb_extension_groups_seq BEFORE INSERT ON phpbb_extension_groups FOR EACH ROW WHEN ( new.group_id IS NULL OR new.group_id = 0 ) BEGIN - SELECT sq_phpbb_extension_groups_grou.nextval + SELECT phpbb_extension_groups_seq.nextval INTO :new.group_id FROM dual; END; / + /* Table: phpbb_forums */ @@ -456,16 +473,16 @@ CREATE TABLE phpbb_forums ( left_id number(5) NOT NULL, right_id number(5) NOT NULL, forum_parents clob, - forum_name varchar2(150), + forum_name clob, forum_desc clob, forum_desc_bitfield number(11) DEFAULT '0' NOT NULL, forum_desc_uid varchar2(5) DEFAULT '', - forum_link varchar2(200) DEFAULT '', - forum_password varchar2(32) DEFAULT '', + forum_link varchar2(255) DEFAULT '', + forum_password varchar2(40) DEFAULT '', forum_style number(4), - forum_image varchar2(50) DEFAULT '', - forum_rules clob DEFAULT '', - forum_rules_link varchar2(200) DEFAULT '', + forum_image varchar2(255) DEFAULT '', + forum_rules clob, + forum_rules_link varchar2(255) DEFAULT '', forum_rules_bitfield number(11) DEFAULT '0' NOT NULL, forum_rules_uid varchar2(5) DEFAULT '', forum_topics_per_page number(4) DEFAULT '0' NOT NULL, @@ -477,7 +494,7 @@ CREATE TABLE phpbb_forums ( forum_last_post_id number(8) DEFAULT '0' NOT NULL, forum_last_poster_id number(8) DEFAULT '0' NOT NULL, forum_last_post_time number(11) DEFAULT '0' NOT NULL, - forum_last_poster_name varchar2(30), + forum_last_poster_name varchar2(255), forum_flags number(4) DEFAULT '0' NOT NULL, display_on_index number(1) DEFAULT '1' NOT NULL, enable_indexing number(1) DEFAULT '1' NOT NULL, @@ -491,26 +508,27 @@ CREATE TABLE phpbb_forums ( ) / -CREATE SEQUENCE sq_phpbb_forums_forum_id +CREATE SEQUENCE phpbb_forums_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_forums_forum_id +CREATE OR REPLACE TRIGGER ai_phpbb_forums_seq BEFORE INSERT ON phpbb_forums FOR EACH ROW WHEN ( new.forum_id IS NULL OR new.forum_id = 0 ) BEGIN - SELECT sq_phpbb_forums_forum_id.nextval + SELECT phpbb_forums_seq.nextval INTO :new.forum_id FROM dual; END; / -CREATE INDEX left_right_id on phpbb_forums (left_id, right_id) +CREATE INDEX phpbb_forums_left_right_id on phpbb_forums (left_id, right_id) / -CREATE INDEX forum_last_post_id on phpbb_forums (forum_last_post_id) +CREATE INDEX phpbb_forums_forum_last_post_id on phpbb_forums (forum_last_post_id) / + /* Table: phpbb_forum_access */ @@ -522,6 +540,7 @@ CREATE TABLE phpbb_forum_access ( ) / + /* Table: phpbb_forums_marking */ @@ -533,6 +552,7 @@ CREATE TABLE phpbb_forums_marking ( ) / + /* Table: phpbb_forums_watch */ @@ -543,25 +563,26 @@ CREATE TABLE phpbb_forums_watch ( ) / -CREATE INDEX forum_id on phpbb_forums_watch (forum_id) +CREATE INDEX phpbb_forums_watch_forum_id on phpbb_forums_watch (forum_id) / -CREATE INDEX user_id02 on phpbb_forums_watch (user_id) +CREATE INDEX phpbb_forums_watch_user_id on phpbb_forums_watch (user_id) / -CREATE INDEX notify_status on phpbb_forums_watch (notify_status) +CREATE INDEX phpbb_forums_watch_notify_status 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_name varchar2(40) DEFAULT '', + group_name varchar2(255) DEFAULT '' NOT NULL, group_desc clob, group_desc_bitfield number(11) DEFAULT '0' NOT NULL, group_desc_uid varchar2(5) DEFAULT '', group_display number(1) DEFAULT '0' NOT NULL, - group_avatar varchar2(100) DEFAULT '', + group_avatar varchar2(255) DEFAULT '', group_avatar_type number(4) DEFAULT '0' NOT NULL, group_avatar_width number(4) DEFAULT '0' NOT NULL, group_avatar_height number(4) DEFAULT '0' NOT NULL, @@ -576,30 +597,31 @@ CREATE TABLE phpbb_groups ( ) / -CREATE SEQUENCE sq_phpbb_groups_group_id +CREATE SEQUENCE phpbb_groups_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_groups_group_id +CREATE OR REPLACE TRIGGER ai_phpbb_groups_seq BEFORE INSERT ON phpbb_groups FOR EACH ROW WHEN ( new.group_id IS NULL OR new.group_id = 0 ) BEGIN - SELECT sq_phpbb_groups_group_id.nextval + SELECT phpbb_groups_seq.nextval INTO :new.group_id FROM dual; END; / -CREATE INDEX group_legend on phpbb_groups (group_legend) +CREATE INDEX phpbb_groups_group_legend on phpbb_groups (group_legend) / + /* Table: phpbb_icons */ CREATE TABLE phpbb_icons ( icons_id number(4) NOT NULL, - icons_url varchar2(50), + icons_url varchar2(255), icons_width number(4) NOT NULL, icons_height number(4) NOT NULL, icons_order number(4) NOT NULL, @@ -608,21 +630,22 @@ CREATE TABLE phpbb_icons ( ) / -CREATE SEQUENCE sq_phpbb_icons_icons_id +CREATE SEQUENCE phpbb_icons_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_icons_icons_id +CREATE OR REPLACE TRIGGER ai_phpbb_icons_seq BEFORE INSERT ON phpbb_icons FOR EACH ROW WHEN ( new.icons_id IS NULL OR new.icons_id = 0 ) BEGIN - SELECT sq_phpbb_icons_icons_id.nextval + SELECT phpbb_icons_seq.nextval INTO :new.icons_id FROM dual; END; / + /* Table: phpbb_lang */ @@ -630,28 +653,29 @@ CREATE TABLE phpbb_lang ( lang_id number(4) NOT NULL, lang_iso varchar2(5), lang_dir varchar2(30), - lang_english_name varchar2(30), - lang_local_name varchar2(100), - lang_author varchar2(100), + lang_english_name varchar2(100), + lang_local_name varchar2(255), + lang_author varchar2(255), CONSTRAINT pk_phpbb_lang PRIMARY KEY (lang_id) ) / -CREATE SEQUENCE sq_phpbb_lang_lang_id +CREATE SEQUENCE phpbb_lang_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_lang_lang_id +CREATE OR REPLACE TRIGGER ai_phpbb_lang_seq BEFORE INSERT ON phpbb_lang FOR EACH ROW WHEN ( new.lang_id IS NULL OR new.lang_id = 0 ) BEGIN - SELECT sq_phpbb_lang_lang_id.nextval + SELECT phpbb_lang_seq.nextval INTO :new.lang_id FROM dual; END; / + /* Table: phpbb_log */ @@ -670,50 +694,52 @@ CREATE TABLE phpbb_log ( ) / -CREATE SEQUENCE sq_phpbb_log_log_id +CREATE SEQUENCE phpbb_log_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_log_log_id +CREATE OR REPLACE TRIGGER ai_phpbb_log_seq BEFORE INSERT ON phpbb_log FOR EACH ROW WHEN ( new.log_id IS NULL OR new.log_id = 0 ) BEGIN - SELECT sq_phpbb_log_log_id.nextval + SELECT phpbb_log_seq.nextval INTO :new.log_id FROM dual; END; / -CREATE INDEX log_type on phpbb_log (log_type) +CREATE INDEX phpbb_log_log_type on phpbb_log (log_type) / -CREATE INDEX forum_id02 on phpbb_log (forum_id) +CREATE INDEX phpbb_log_forum_id on phpbb_log (forum_id) / -CREATE INDEX topic_id02 on phpbb_log (topic_id) +CREATE INDEX phpbb_log_topic_id on phpbb_log (topic_id) / -CREATE INDEX reportee_id on phpbb_log (reportee_id) +CREATE INDEX phpbb_log_reportee_id on phpbb_log (reportee_id) / -CREATE INDEX user_id03 on phpbb_log (user_id) +CREATE INDEX phpbb_log_user_id on phpbb_log (user_id) / + /* Table: phpbb_moderator_cache */ CREATE TABLE phpbb_moderator_cache ( forum_id number(8) NOT NULL, user_id number(8) DEFAULT '0' NOT NULL, - username varchar2(30) DEFAULT '', + username varchar2(255) DEFAULT '', group_id number(8) DEFAULT '0' NOT NULL, - groupname varchar2(30) DEFAULT '', + group_name varchar2(255) DEFAULT '', display_on_index number(1) DEFAULT '1' NOT NULL ) / -CREATE INDEX display_on_index on phpbb_moderator_cache (display_on_index) +CREATE INDEX phpbb_moderator_cache_display_on_index on phpbb_moderator_cache (display_on_index) / -CREATE INDEX forum_id03 on phpbb_moderator_cache (forum_id) +CREATE INDEX phpbb_moderator_cache_forum_id on phpbb_moderator_cache (forum_id) / + /* Table: phpbb_modules */ @@ -721,54 +747,56 @@ 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_name varchar2(20) DEFAULT '' NOT NULL, - module_class varchar2(4) DEFAULT '' NOT NULL, - parent_id number(5) DEFAULT '0' NOT NULL, - left_id number(5) DEFAULT '0' NOT NULL, - right_id number(5) DEFAULT '0' NOT NULL, - module_langname varchar2(50) DEFAULT '' NOT NULL, + module_name varchar2(255) DEFAULT '' NOT NULL, + module_class varchar2(10) DEFAULT '' 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, + module_langname varchar2(255) DEFAULT '' NOT NULL, module_mode varchar2(255) DEFAULT '' NOT NULL, module_auth varchar2(255) DEFAULT '' NOT NULL, CONSTRAINT pk_phpbb_modules PRIMARY KEY (module_id) ) / -CREATE SEQUENCE sq_phpbb_modules_module_id +CREATE SEQUENCE phpbb_modules_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_modules_module_id +CREATE OR REPLACE TRIGGER ai_phpbb_modules_seq BEFORE INSERT ON phpbb_modules FOR EACH ROW WHEN ( new.module_id IS NULL OR new.module_id = 0 ) BEGIN - SELECT sq_phpbb_modules_module_id.nextval + SELECT phpbb_modules_seq.nextval INTO :new.module_id FROM dual; END; / -CREATE INDEX module_enabled on phpbb_modules (module_enabled) +CREATE INDEX phpbb_modules_module_enabled on phpbb_modules (module_enabled) / -CREATE INDEX module_left_id on phpbb_modules (left_id) +CREATE INDEX phpbb_modules_left_right_id on phpbb_modules (left_id, right_id) / + /* Table: phpbb_poll_results */ CREATE TABLE phpbb_poll_results ( poll_option_id number(4) DEFAULT '0' NOT NULL, topic_id number(8) NOT NULL, - poll_option_text varchar2(255), + poll_option_text clob, poll_option_total number(8) DEFAULT '0' NOT NULL ) / -CREATE INDEX poll_option_id on phpbb_poll_results (poll_option_id) +CREATE INDEX phpbb_poll_results_poll_option_id on phpbb_poll_results (poll_option_id) / -CREATE INDEX topic_id03 on phpbb_poll_results (topic_id) +CREATE INDEX phpbb_poll_results_topic_id on phpbb_poll_results (topic_id) / + /* Table: phpbb_poll_voters */ @@ -780,13 +808,14 @@ CREATE TABLE phpbb_poll_voters ( ) / -CREATE INDEX topic_id04 on phpbb_poll_voters (topic_id) +CREATE INDEX phpbb_poll_voters_topic_id on phpbb_poll_voters (topic_id) / -CREATE INDEX vote_user_id on phpbb_poll_voters (vote_user_id) +CREATE INDEX phpbb_poll_voters_vote_user_id on phpbb_poll_voters (vote_user_id) / -CREATE INDEX vote_user_ip on phpbb_poll_voters (vote_user_ip) +CREATE INDEX phpbb_poll_voters_vote_user_ip on phpbb_poll_voters (vote_user_ip) / + /* Table: phpbb_posts */ @@ -804,8 +833,8 @@ CREATE TABLE phpbb_posts ( 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(30), - post_subject varchar2(60), + post_username varchar2(255), + post_subject clob, post_text clob, post_checksum varchar2(32), post_encoding varchar2(20) DEFAULT 'iso-8859-1', @@ -813,7 +842,7 @@ CREATE TABLE phpbb_posts ( bbcode_bitfield number(11) DEFAULT '0' NOT NULL, bbcode_uid varchar2(5) DEFAULT '', post_edit_time number(11) DEFAULT '0' NOT NULL, - post_edit_reason varchar2(100), + post_edit_reason clob, post_edit_user number(8) DEFAULT '0' NOT NULL, post_edit_count number(5) DEFAULT '0' NOT NULL, post_edit_locked number(1) DEFAULT '0' NOT NULL, @@ -821,34 +850,35 @@ CREATE TABLE phpbb_posts ( ) / -CREATE SEQUENCE sq_phpbb_posts_post_id +CREATE SEQUENCE phpbb_posts_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_posts_post_id +CREATE OR REPLACE TRIGGER ai_phpbb_posts_seq BEFORE INSERT ON phpbb_posts FOR EACH ROW WHEN ( new.post_id IS NULL OR new.post_id = 0 ) BEGIN - SELECT sq_phpbb_posts_post_id.nextval + SELECT phpbb_posts_seq.nextval INTO :new.post_id FROM dual; END; / -CREATE INDEX forum_id04 on phpbb_posts (forum_id) +CREATE INDEX phpbb_posts_forum_id on phpbb_posts (forum_id) / -CREATE INDEX topic_id05 on phpbb_posts (topic_id) +CREATE INDEX phpbb_posts_topic_id on phpbb_posts (topic_id) / -CREATE INDEX poster_ip on phpbb_posts (poster_ip) +CREATE INDEX phpbb_posts_poster_ip on phpbb_posts (poster_ip) / -CREATE INDEX poster_id02 on phpbb_posts (poster_id) +CREATE INDEX phpbb_posts_poster_id on phpbb_posts (poster_id) / -CREATE INDEX post_approved on phpbb_posts (post_approved) +CREATE INDEX phpbb_posts_post_approved on phpbb_posts (post_approved) / -CREATE INDEX post_time on phpbb_posts (post_time) +CREATE INDEX phpbb_posts_post_time on phpbb_posts (post_time) / + /* Table: phpbb_privmsgs */ @@ -863,9 +893,9 @@ CREATE TABLE phpbb_privmsgs ( 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(60), + message_subject clob, message_text clob, - message_edit_reason varchar2(100), + message_edit_reason clob, message_edit_user number(8) DEFAULT '0' NOT NULL, message_encoding varchar2(20) DEFAULT 'iso-8859-1', message_attachment number(1) DEFAULT '0' NOT NULL, @@ -879,60 +909,62 @@ CREATE TABLE phpbb_privmsgs ( ) / -CREATE SEQUENCE sq_phpbb_privmsgs_msg_id +CREATE SEQUENCE phpbb_privmsgs_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_privmsgs_msg_id +CREATE OR REPLACE TRIGGER ai_phpbb_privmsgs_seq BEFORE INSERT ON phpbb_privmsgs FOR EACH ROW WHEN ( new.msg_id IS NULL OR new.msg_id = 0 ) BEGIN - SELECT sq_phpbb_privmsgs_msg_id.nextval + SELECT phpbb_privmsgs_seq.nextval INTO :new.msg_id FROM dual; END; / -CREATE INDEX author_ip on phpbb_privmsgs (author_ip) +CREATE INDEX phpbb_privmsgs_author_ip on phpbb_privmsgs (author_ip) / -CREATE INDEX message_time on phpbb_privmsgs (message_time) +CREATE INDEX phpbb_privmsgs_message_time on phpbb_privmsgs (message_time) / -CREATE INDEX author_id on phpbb_privmsgs (author_id) +CREATE INDEX phpbb_privmsgs_author_id on phpbb_privmsgs (author_id) / -CREATE INDEX root_level on phpbb_privmsgs (root_level) +CREATE INDEX phpbb_privmsgs_root_level on phpbb_privmsgs (root_level) / + /* 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(40) DEFAULT '', + folder_name varchar2(255) DEFAULT '', pm_count number(8) DEFAULT '0' NOT NULL, CONSTRAINT pk_phpbb_privmsgs_folder PRIMARY KEY (folder_id) ) / -CREATE SEQUENCE sq_phpbb_privmsgs_folder_folde +CREATE SEQUENCE phpbb_privmsgs_folder_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_privmsgs_folder_folde +CREATE OR REPLACE TRIGGER ai_phpbb_privmsgs_seq BEFORE INSERT ON phpbb_privmsgs_folder FOR EACH ROW WHEN ( new.folder_id IS NULL OR new.folder_id = 0 ) BEGIN - SELECT sq_phpbb_privmsgs_folder_folde.nextval + SELECT phpbb_privmsgs_folder_seq.nextval INTO :new.folder_id FROM dual; END; / -CREATE INDEX user_id04 on phpbb_privmsgs_folder (user_id) +CREATE INDEX phpbb_privmsgs_folder_user_id on phpbb_privmsgs_folder (user_id) / + /* Table: phpbb_privmsgs_rules */ @@ -950,21 +982,22 @@ CREATE TABLE phpbb_privmsgs_rules ( ) / -CREATE SEQUENCE sq_phpbb_privmsgs_rules_rule_i +CREATE SEQUENCE phpbb_privmsgs_rules_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_privmsgs_rules_rule_i +CREATE OR REPLACE TRIGGER ai_phpbb_privmsgs_rules_seq BEFORE INSERT ON phpbb_privmsgs_rules FOR EACH ROW WHEN ( new.rule_id IS NULL OR new.rule_id = 0 ) BEGIN - SELECT sq_phpbb_privmsgs_rules_rule_i.nextval + SELECT phpbb_privmsgs_rules_seq.nextval INTO :new.rule_id FROM dual; END; / + /* Table: phpbb_privmsgs_to */ @@ -982,18 +1015,19 @@ CREATE TABLE phpbb_privmsgs_to ( ) / -CREATE INDEX msg_id on phpbb_privmsgs_to (msg_id) +CREATE INDEX phpbb_privmsgs_to_msg_id on phpbb_privmsgs_to (msg_id) / -CREATE INDEX user_id05 on phpbb_privmsgs_to (user_id, folder_id) +CREATE INDEX phpbb_privmsgs_to_user_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(50) DEFAULT '', - field_desc varchar2(255) DEFAULT '', + field_name varchar2(255) DEFAULT '', + field_desc clob, field_type number(8) NOT NULL, field_ident varchar2(20) DEFAULT '', field_length varchar2(20) DEFAULT '', @@ -1012,26 +1046,27 @@ CREATE TABLE phpbb_profile_fields ( ) / -CREATE SEQUENCE sq_phpbb_profile_fields_field_ +CREATE SEQUENCE phpbb_profile_fields_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_profile_fields_field_ +CREATE OR REPLACE TRIGGER ai_phpbb_profile_fields_seq BEFORE INSERT ON phpbb_profile_fields FOR EACH ROW WHEN ( new.field_id IS NULL OR new.field_id = 0 ) BEGIN - SELECT sq_phpbb_profile_fields_field_.nextval + SELECT phpbb_profile_fields_seq.nextval INTO :new.field_id FROM dual; END; / -CREATE INDEX field_type on phpbb_profile_fields (field_type) +CREATE INDEX phpbb_profile_fields_field_type on phpbb_profile_fields (field_type) / -CREATE INDEX field_order on phpbb_profile_fields (field_order) +CREATE INDEX phpbb_profile_fields_field_order on phpbb_profile_fields (field_order) / + /* Table: phpbb_profile_fields_data */ @@ -1041,6 +1076,7 @@ CREATE TABLE phpbb_profile_fields_data ( ) / + /* Table: phpbb_profile_fields_lang */ @@ -1054,6 +1090,7 @@ CREATE TABLE phpbb_profile_fields_lang ( ) / + /* Table: phpbb_profile_lang */ @@ -1067,34 +1104,36 @@ CREATE TABLE phpbb_profile_lang ( ) / + /* Table: phpbb_ranks */ CREATE TABLE phpbb_ranks ( rank_id number(5) NOT NULL, - rank_title varchar2(50), + rank_title varchar2(255), rank_min number(8) DEFAULT '0' NOT NULL, rank_special number(1) DEFAULT '0', - rank_image varchar2(100), + rank_image varchar2(255), CONSTRAINT pk_phpbb_ranks PRIMARY KEY (rank_id) ) / -CREATE SEQUENCE sq_phpbb_ranks_rank_id +CREATE SEQUENCE phpbb_ranks_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_ranks_rank_id +CREATE OR REPLACE TRIGGER ai_phpbb_ranks_seq BEFORE INSERT ON phpbb_ranks FOR EACH ROW WHEN ( new.rank_id IS NULL OR new.rank_id = 0 ) BEGIN - SELECT sq_phpbb_ranks_rank_id.nextval + SELECT phpbb_ranks_seq.nextval INTO :new.rank_id FROM dual; END; / + /* Table: phpbb_reports_reasons */ @@ -1107,21 +1146,22 @@ CREATE TABLE phpbb_reports_reasons ( ) / -CREATE SEQUENCE sq_phpbb_reports_reasons_reaso +CREATE SEQUENCE phpbb_reports_reasons_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_reports_reasons_reaso +CREATE OR REPLACE TRIGGER ai_phpbb_reports_reasons_seq BEFORE INSERT ON phpbb_reports_reasons FOR EACH ROW WHEN ( new.reason_id IS NULL OR new.reason_id = 0 ) BEGIN - SELECT sq_phpbb_reports_reasons_reaso.nextval + SELECT phpbb_reports_reasons_seq.nextval INTO :new.reason_id FROM dual; END; / + /* Table: phpbb_reports */ @@ -1138,21 +1178,22 @@ CREATE TABLE phpbb_reports ( ) / -CREATE SEQUENCE sq_phpbb_reports_report_id +CREATE SEQUENCE phpbb_reports_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_reports_report_id +CREATE OR REPLACE TRIGGER ai_phpbb_reports_seq BEFORE INSERT ON phpbb_reports FOR EACH ROW WHEN ( new.report_id IS NULL OR new.report_id = 0 ) BEGIN - SELECT sq_phpbb_reports_report_id.nextval + SELECT phpbb_reports_seq.nextval INTO :new.report_id FROM dual; END; / + /* Table: phpbb_search_results */ @@ -1165,6 +1206,7 @@ CREATE TABLE phpbb_search_results ( ) / + /* Table: phpbb_search_wordlist */ @@ -1176,24 +1218,25 @@ CREATE TABLE phpbb_search_wordlist ( ) / -CREATE SEQUENCE sq_phpbb_search_wordlist_word_ +CREATE SEQUENCE phpbb_search_wordlist_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_search_wordlist_word_ +CREATE OR REPLACE TRIGGER ai_phpbb_search_wordlist_seq BEFORE INSERT ON phpbb_search_wordlist FOR EACH ROW WHEN ( new.word_id IS NULL OR new.word_id = 0 ) BEGIN - SELECT sq_phpbb_search_wordlist_word_.nextval + SELECT phpbb_search_wordlist_seq.nextval INTO :new.word_id FROM dual; END; / -CREATE INDEX word_id on phpbb_search_wordlist (word_id) +CREATE INDEX phpbb_search_wordlist_word_id on phpbb_search_wordlist (word_id) / + /* Table: phpbb_search_wordmatch */ @@ -1204,9 +1247,10 @@ CREATE TABLE phpbb_search_wordmatch ( ) / -CREATE INDEX word_id02 on phpbb_search_wordmatch (word_id) +CREATE INDEX phpbb_search_wordmatch_word_id on phpbb_search_wordmatch (word_id) / + /* Table: phpbb_sessions */ @@ -1226,11 +1270,12 @@ CREATE TABLE phpbb_sessions ( ) / -CREATE INDEX session_time on phpbb_sessions (session_time) +CREATE INDEX phpbb_sessions_session_time on phpbb_sessions (session_time) / -CREATE INDEX session_user_id on phpbb_sessions (session_user_id) +CREATE INDEX phpbb_sessions_session_user_id on phpbb_sessions (session_user_id) / + /* Table: phpbb_sessions_keys */ @@ -1243,9 +1288,10 @@ CREATE TABLE phpbb_sessions_keys ( ) / -CREATE INDEX last_login on phpbb_sessions_keys (last_login) +CREATE INDEX phpbb_sessions_keys_last_login on phpbb_sessions_keys (last_login) / + /* Table: phpbb_sitelist */ @@ -1258,21 +1304,22 @@ CREATE TABLE phpbb_sitelist ( ) / -CREATE SEQUENCE sq_phpbb_sitelist_site_id +CREATE SEQUENCE phpbb_sitelist_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_sitelist_site_id +CREATE OR REPLACE TRIGGER ai_phpbb_sitelist_seq BEFORE INSERT ON phpbb_sitelist FOR EACH ROW WHEN ( new.site_id IS NULL OR new.site_id = 0 ) BEGIN - SELECT sq_phpbb_sitelist_site_id.nextval + SELECT phpbb_sitelist_seq.nextval INTO :new.site_id FROM dual; END; / + /* Table: phpbb_smilies */ @@ -1289,28 +1336,29 @@ CREATE TABLE phpbb_smilies ( ) / -CREATE SEQUENCE sq_phpbb_smilies_smiley_id +CREATE SEQUENCE phpbb_smilies_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_smilies_smiley_id +CREATE OR REPLACE TRIGGER ai_phpbb_smilies_seq BEFORE INSERT ON phpbb_smilies FOR EACH ROW WHEN ( new.smiley_id IS NULL OR new.smiley_id = 0 ) BEGIN - SELECT sq_phpbb_smilies_smiley_id.nextval + SELECT phpbb_smilies_seq.nextval INTO :new.smiley_id FROM dual; END; / + /* Table: phpbb_styles */ CREATE TABLE phpbb_styles ( style_id number(4) NOT NULL, - style_name varchar2(30) DEFAULT '', - style_copyright varchar2(50) DEFAULT '', + style_name varchar2(255) DEFAULT '', + style_copyright varchar2(255) DEFAULT '', style_active number(1) DEFAULT '1' NOT NULL, template_id number(4) NOT NULL, theme_id number(4) NOT NULL, @@ -1320,36 +1368,37 @@ CREATE TABLE phpbb_styles ( ) / -CREATE SEQUENCE sq_phpbb_styles_style_id +CREATE SEQUENCE phpbb_styles_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_styles_style_id +CREATE OR REPLACE TRIGGER ai_phpbb_styles_seq BEFORE INSERT ON phpbb_styles FOR EACH ROW WHEN ( new.style_id IS NULL OR new.style_id = 0 ) BEGIN - SELECT sq_phpbb_styles_style_id.nextval + SELECT phpbb_styles_seq.nextval INTO :new.style_id FROM dual; END; / -CREATE INDEX i_phpbb_styles on phpbb_styles (template_id) +CREATE INDEX phpbb_styles_template_id on phpbb_styles (template_id) / -CREATE INDEX i_phpbb_styles02 on phpbb_styles (theme_id) +CREATE INDEX phpbb_styles_theme_id on phpbb_styles (theme_id) / -CREATE INDEX i_phpbb_styles03 on phpbb_styles (imageset_id) +CREATE INDEX phpbb_styles_imageset_id on phpbb_styles (imageset_id) / + /* Table: phpbb_styles_template */ CREATE TABLE phpbb_styles_template ( template_id number(4) NOT NULL, - template_name varchar2(30), - template_copyright varchar2(50), - template_path varchar2(30), + template_name varchar2(255), + template_copyright varchar2(255), + template_path varchar2(100), bbcode_bitfield number(11) DEFAULT '0' NOT NULL, template_storedb number(1) DEFAULT '0' NOT NULL, CONSTRAINT pk_phpbb_styles_template PRIMARY KEY (template_id), @@ -1357,77 +1406,80 @@ CREATE TABLE phpbb_styles_template ( ) / -CREATE SEQUENCE sq_phpbb_styles_template_templ +CREATE SEQUENCE phpbb_styles_template_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_styles_template_templ +CREATE OR REPLACE TRIGGER ai_phpbb_styles_template_seq BEFORE INSERT ON phpbb_styles_template FOR EACH ROW WHEN ( new.template_id IS NULL OR new.template_id = 0 ) BEGIN - SELECT sq_phpbb_styles_template_templ.nextval + SELECT phpbb_styles_template_seq.nextval INTO :new.template_id FROM dual; END; / + /* Table: phpbb_styles_template_data */ CREATE TABLE phpbb_styles_template_data ( template_id number(4) NOT NULL, - template_filename varchar2(50) DEFAULT '', + template_filename varchar2(100) DEFAULT '', template_included clob, template_mtime number(11) DEFAULT '0' NOT NULL, template_data clob ) / -CREATE INDEX i_phpbb_styles_template_data on phpbb_styles_template_data (template_id) +CREATE INDEX phpbb_styles_template_data_template_id on phpbb_styles_template_data (template_id) / -CREATE INDEX i_phpbb_styles_template_data02 on phpbb_styles_template_data (template_filename) +CREATE INDEX phpbb_styles_template_data_template_filename on phpbb_styles_template_data (template_filename) / + /* Table: phpbb_styles_theme */ CREATE TABLE phpbb_styles_theme ( theme_id number(4) NOT NULL, - theme_name varchar2(30) DEFAULT '', - theme_copyright varchar2(50) DEFAULT '', - theme_path varchar2(30) DEFAULT '', + theme_name varchar2(255) DEFAULT '', + theme_copyright varchar2(255) DEFAULT '', + theme_path varchar2(100) DEFAULT '', theme_storedb number(1) DEFAULT '0' NOT NULL, theme_mtime number(11) DEFAULT '0' NOT NULL, - theme_data clob DEFAULT '', + theme_data clob, CONSTRAINT pk_phpbb_styles_theme PRIMARY KEY (theme_id), CONSTRAINT u_theme_name UNIQUE (theme_name) ) / -CREATE SEQUENCE sq_phpbb_styles_theme_theme_id +CREATE SEQUENCE phpbb_styles_theme_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_styles_theme_theme_id +CREATE OR REPLACE TRIGGER ai_phpbb_styles_theme_seq BEFORE INSERT ON phpbb_styles_theme FOR EACH ROW WHEN ( new.theme_id IS NULL OR new.theme_id = 0 ) BEGIN - SELECT sq_phpbb_styles_theme_theme_id.nextval + SELECT phpbb_styles_theme_seq.nextval INTO :new.theme_id FROM dual; END; / + /* Table: phpbb_styles_imageset */ CREATE TABLE phpbb_styles_imageset ( imageset_id number(4) NOT NULL, - imageset_name varchar2(30) DEFAULT '', - imageset_copyright varchar2(50) DEFAULT '', - imageset_path varchar2(30) DEFAULT '', + imageset_name varchar2(255) DEFAULT '', + imageset_copyright varchar2(255) DEFAULT '', + imageset_path varchar2(100) DEFAULT '', site_logo varchar2(200) DEFAULT '', btn_post varchar2(200) DEFAULT '', btn_post_pm varchar2(200) DEFAULT '', @@ -1510,21 +1562,22 @@ CREATE TABLE phpbb_styles_imageset ( ) / -CREATE SEQUENCE sq_phpbb_styles_imageset_image +CREATE SEQUENCE phpbb_styles_imageset_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_styles_imageset_image +CREATE OR REPLACE TRIGGER ai_phpbb_styles_imageset_seq BEFORE INSERT ON phpbb_styles_imageset FOR EACH ROW WHEN ( new.imageset_id IS NULL OR new.imageset_id = 0 ) BEGIN - SELECT sq_phpbb_styles_imageset_image.nextval + SELECT phpbb_styles_imageset_seq.nextval INTO :new.imageset_id FROM dual; END; / + /* Table: phpbb_topics */ @@ -1535,7 +1588,7 @@ CREATE TABLE phpbb_topics ( topic_attachment number(1) DEFAULT '0' NOT NULL, topic_approved number(1) DEFAULT '1' NOT NULL, topic_reported number(1) DEFAULT '0' NOT NULL, - topic_title varchar2(60), + topic_title clob, 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, @@ -1545,16 +1598,16 @@ CREATE TABLE phpbb_topics ( 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(30), + topic_first_poster_name varchar2(255), 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(30), + topic_last_poster_name varchar2(255), 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(255) DEFAULT '' NOT NULL, + poll_title clob, 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, @@ -1564,28 +1617,29 @@ CREATE TABLE phpbb_topics ( ) / -CREATE SEQUENCE sq_phpbb_topics_topic_id +CREATE SEQUENCE phpbb_topics_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_topics_topic_id +CREATE OR REPLACE TRIGGER ai_phpbb_topics_seq BEFORE INSERT ON phpbb_topics FOR EACH ROW WHEN ( new.topic_id IS NULL OR new.topic_id = 0 ) BEGIN - SELECT sq_phpbb_topics_topic_id.nextval + SELECT phpbb_topics_seq.nextval INTO :new.topic_id FROM dual; END; / -CREATE INDEX forum_id05 on phpbb_topics (forum_id) +CREATE INDEX phpbb_topics_forum_id on phpbb_topics (forum_id) / -CREATE INDEX forum_id_type on phpbb_topics (forum_id, topic_type) +CREATE INDEX phpbb_topics_forum_id_type on phpbb_topics (forum_id, topic_type) / -CREATE INDEX topic_last_post_time on phpbb_topics (topic_last_post_time) +CREATE INDEX phpbb_topics_topic_last_post_time on phpbb_topics (topic_last_post_time) / + /* Table: phpbb_topics_marking */ @@ -1598,9 +1652,10 @@ CREATE TABLE phpbb_topics_marking ( ) / -CREATE INDEX forum_id06 on phpbb_topics_marking (forum_id) +CREATE INDEX phpbb_topics_marking_forum_id on phpbb_topics_marking (forum_id) / + /* Table: phpbb_topics_posted */ @@ -1612,6 +1667,7 @@ CREATE TABLE phpbb_topics_posted ( ) / + /* Table: phpbb_topics_watch */ @@ -1622,13 +1678,14 @@ CREATE TABLE phpbb_topics_watch ( ) / -CREATE INDEX topic_id06 on phpbb_topics_watch (topic_id) +CREATE INDEX phpbb_topics_watch_topic_id on phpbb_topics_watch (topic_id) / -CREATE INDEX user_id06 on phpbb_topics_watch (user_id) +CREATE INDEX phpbb_topics_watch_user_id on phpbb_topics_watch (user_id) / -CREATE INDEX notify_status02 on phpbb_topics_watch (notify_status) +CREATE INDEX phpbb_topics_watch_notify_status on phpbb_topics_watch (notify_status) / + /* Table: phpbb_user_group */ @@ -1640,13 +1697,14 @@ CREATE TABLE phpbb_user_group ( ) / -CREATE INDEX group_id02 on phpbb_user_group (group_id) +CREATE INDEX phpbb_user_group_group_id on phpbb_user_group (group_id) / -CREATE INDEX user_id07 on phpbb_user_group (user_id) +CREATE INDEX phpbb_user_group_user_id on phpbb_user_group (user_id) / -CREATE INDEX group_leader on phpbb_user_group (group_leader) +CREATE INDEX phpbb_user_group_group_leader on phpbb_user_group (group_leader) / + /* Table: phpbb_users */ @@ -1654,13 +1712,13 @@ CREATE TABLE phpbb_users ( user_id number(8) NOT NULL, user_type number(1) DEFAULT '0' NOT NULL, group_id number(8) DEFAULT '3' NOT NULL, - user_permissions clob DEFAULT '', + user_permissions clob, user_ip varchar2(40) DEFAULT '', user_regdate number(11) DEFAULT '0' NOT NULL, - username varchar2(30) DEFAULT '', - user_password varchar2(32) DEFAULT '', + username varchar2(255) DEFAULT '', + user_password varchar2(40) DEFAULT '', user_passchg number(11) DEFAULT '0' NOT NULL, - user_email varchar2(60) DEFAULT '', + user_email varchar2(100) DEFAULT '', user_email_hash number(20) DEFAULT '0' NOT NULL, user_birthday varchar2(10) DEFAULT '', user_lastvisit number(11) DEFAULT '0' NOT NULL, @@ -1683,7 +1741,7 @@ CREATE TABLE phpbb_users ( 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 '1' 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', @@ -1700,11 +1758,11 @@ CREATE TABLE phpbb_users ( user_allow_viewemail number(1) DEFAULT '1' NOT NULL, user_allow_massemail number(1) DEFAULT '1' NOT NULL, user_options number(11) DEFAULT '893' NOT NULL, - user_avatar varchar2(100) DEFAULT '', + user_avatar varchar2(255) DEFAULT '', user_avatar_type number(2) DEFAULT '0' NOT NULL, user_avatar_width number(4) DEFAULT '0' NOT NULL, user_avatar_height number(4) DEFAULT '0' NOT NULL, - user_sig clob DEFAULT '', + user_sig clob, user_sig_bbcode_uid varchar2(5) DEFAULT '', user_sig_bbcode_bitfield number(11) DEFAULT '0' NOT NULL, user_from varchar2(100) DEFAULT '', @@ -1713,7 +1771,7 @@ CREATE TABLE phpbb_users ( user_yim varchar2(255) DEFAULT '', user_msnm varchar2(255) DEFAULT '', user_jabber varchar2(255) DEFAULT '', - user_website varchar2(100) DEFAULT '', + user_website varchar2(200) DEFAULT '', user_occ varchar2(255) DEFAULT '', user_interests varchar2(255) DEFAULT '', user_actkey varchar2(32) DEFAULT '', @@ -1722,28 +1780,29 @@ CREATE TABLE phpbb_users ( ) / -CREATE SEQUENCE sq_phpbb_users_user_id +CREATE SEQUENCE phpbb_users_seq / -CREATE OR REPLACE TRIGGER ai_phpbb_users_user_id +CREATE OR REPLACE TRIGGER ai_phpbb_users_seq BEFORE INSERT ON phpbb_users FOR EACH ROW WHEN ( new.user_id IS NULL OR new.user_id = 0 ) BEGIN - SELECT sq_phpbb_users_user_id.nextval + SELECT phpbb_users_seq.nextval INTO :new.user_id FROM dual; END; / -CREATE INDEX user_birthday on phpbb_users (user_birthday) +CREATE INDEX phpbb_users_user_birthday on phpbb_users (user_birthday) / -CREATE INDEX user_email_hash on phpbb_users (user_email_hash) +CREATE INDEX phpbb_users_user_email_hash on phpbb_users (user_email_hash) / -CREATE INDEX username on phpbb_users (username) +CREATE INDEX phpbb_users_username on phpbb_users (username) / + /* Table: phpbb_warnings */ @@ -1772,6 +1831,7 @@ BEGIN END; / + /* Table: phpbb_words */ @@ -1798,6 +1858,7 @@ BEGIN END; / + /* Table: phpbb_zebra */ @@ -1809,8 +1870,8 @@ CREATE TABLE phpbb_zebra ( ) / -CREATE INDEX user_id08 on phpbb_zebra (user_id) +CREATE INDEX phpbb_zebra_user_id on phpbb_zebra (user_id) / -CREATE INDEX zebra_id on phpbb_zebra (zebra_id) +CREATE INDEX phpbb_zebra_zebra_id on phpbb_zebra (zebra_id) / diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 680d5c6124..0fdab06b7e 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -8,10 +8,10 @@ BEGIN; /* Table: phpbb_attachments */ -CREATE SEQUENCE phpbb_attachments_attach_id_; +CREATE SEQUENCE phpbb_attachments_seq; CREATE TABLE phpbb_attachments ( - attach_id INT4 DEFAULT nextval('phpbb_attachments_attach_id_'), + attach_id INT4 DEFAULT nextval('phpbb_attachments_seq'), post_msg_id INT4 DEFAULT '0' NOT NULL, topic_id INT4 DEFAULT '0' NOT NULL, in_message INT2 DEFAULT '0' NOT NULL, @@ -19,7 +19,7 @@ CREATE TABLE phpbb_attachments ( physical_filename varchar(255) NOT NULL, real_filename varchar(255) NOT NULL, download_count INT4 DEFAULT '0' NOT NULL, - comment varchar(255), + comment TEXT, extension varchar(100), mimetype varchar(100), filesize INT4 NOT NULL, @@ -35,14 +35,15 @@ CREATE TABLE phpbb_attachments ( CHECK (filetime>=0) ); -CREATE INDEX filetime_phpbb_attachments_index ON phpbb_attachments (filetime); -CREATE INDEX post_msg_id_phpbb_attachments_index ON phpbb_attachments (post_msg_id); -CREATE INDEX topic_id_phpbb_attachments_index ON phpbb_attachments (topic_id); -CREATE INDEX poster_id_phpbb_attachments_index ON phpbb_attachments (poster_id); -CREATE INDEX physical_filename_phpbb_attachments_index ON phpbb_attachments (physical_filename); -CREATE INDEX filesize_phpbb_attachments_index ON phpbb_attachments (filesize); +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_physical_filename ON phpbb_attachments (physical_filename); +CREATE INDEX phpbb_attachments_filesize ON phpbb_attachments (filesize); + +SELECT SETVAL('phpbb_attachments_seq',(select case when max(attach_id)>0 then max(attach_id)+1 else 1 end from phpbb_attachments)); -SELECT SETVAL('phpbb_attachments_attach_id_',(select case when max(attach_id)>0 then max(attach_id)+1 else 1 end from phpbb_attachments)); /* Table: phpbb_auth_groups */ CREATE TABLE phpbb_auth_groups ( @@ -53,14 +54,15 @@ CREATE TABLE phpbb_auth_groups ( auth_setting INT2 DEFAULT '0' NOT NULL ); -CREATE INDEX group_id_phpbb_auth_groups_index ON phpbb_auth_groups (group_id); -CREATE INDEX auth_option_id_phpbb_auth_groups_index ON phpbb_auth_groups (auth_option_id); +CREATE INDEX phpbb_auth_groups_group_id ON phpbb_auth_groups (group_id); +CREATE INDEX phpbb_auth_groups_auth_option_id ON phpbb_auth_groups (auth_option_id); + /* Table: phpbb_auth_options */ -CREATE SEQUENCE phpbb_auth_options_auth_opti; +CREATE SEQUENCE phpbb_auth_options_seq; CREATE TABLE phpbb_auth_options ( - auth_option_id INT4 DEFAULT nextval('phpbb_auth_options_auth_opti'), + auth_option_id INT4 DEFAULT nextval('phpbb_auth_options_seq'), auth_option varchar(20) NOT NULL, is_global INT2 DEFAULT '0' NOT NULL, is_local INT2 DEFAULT '0' NOT NULL, @@ -68,24 +70,26 @@ CREATE TABLE phpbb_auth_options ( PRIMARY KEY (auth_option_id) ); -CREATE INDEX auth_option_phpbb_auth_options_index ON phpbb_auth_options (auth_option); +CREATE INDEX phpbb_auth_options_auth_option ON phpbb_auth_options (auth_option); + +SELECT SETVAL('phpbb_auth_options_seq',(select case when max(auth_option_id)>0 then max(auth_option_id)+1 else 1 end from phpbb_auth_options)); -SELECT SETVAL('phpbb_auth_options_auth_opti',(select case when max(auth_option_id)>0 then max(auth_option_id)+1 else 1 end from phpbb_auth_options)); /* Table: phpbb_auth_roles */ -CREATE SEQUENCE phpbb_auth_roles_role_id; +CREATE SEQUENCE phpbb_auth_roles_seq; CREATE TABLE phpbb_auth_roles ( - role_id INT4 DEFAULT nextval('phpbb_auth_roles_role_id'), - role_name varchar(50) DEFAULT '' NOT NULL, + role_id INT4 DEFAULT nextval('phpbb_auth_roles_seq'), + role_name varchar(255) DEFAULT '' NOT NULL, role_type varchar(10) DEFAULT '' NOT NULL, role_group_ids varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (role_id) ); -CREATE INDEX role_type_phpbb_auth_roles_index ON phpbb_auth_roles (role_type); +CREATE INDEX phpbb_auth_roles_role_type ON phpbb_auth_roles (role_type); + +SELECT SETVAL('phpbb_auth_roles_seq',(select case when max(role_id)>0 then max(role_id)+1 else 1 end from phpbb_auth_roles)); -SELECT SETVAL('phpbb_auth_roles_role_id',(select case when max(role_id)>0 then max(role_id)+1 else 1 end from phpbb_auth_roles)); /* Table: phpbb_auth_roles_data */ CREATE TABLE phpbb_auth_roles_data ( @@ -95,6 +99,7 @@ CREATE TABLE phpbb_auth_roles_data ( PRIMARY KEY (role_id, auth_option_id) ); + /* Table: phpbb_auth_users */ CREATE TABLE phpbb_auth_users ( user_id INT4 DEFAULT '0' NOT NULL, @@ -104,27 +109,29 @@ CREATE TABLE phpbb_auth_users ( auth_setting INT2 DEFAULT '0' NOT NULL ); -CREATE INDEX user_id_phpbb_auth_users_index ON phpbb_auth_users (user_id); -CREATE INDEX auth_option_id_phpbb_auth_users_index ON phpbb_auth_users (auth_option_id); +CREATE INDEX phpbb_auth_users_user_id ON phpbb_auth_users (user_id); +CREATE INDEX phpbb_auth_users_auth_option_id ON phpbb_auth_users (auth_option_id); + /* Table: phpbb_banlist */ -CREATE SEQUENCE phpbb_banlist_ban_id_seq; +CREATE SEQUENCE phpbb_banlist_seq; CREATE TABLE phpbb_banlist ( - ban_id INT4 DEFAULT nextval('phpbb_banlist_ban_id_seq'), - ban_userid INT4 DEFAULT 0 NOT NULL, - ban_ip varchar(40) DEFAULT '' NOT NULL, - ban_email varchar(50) DEFAULT '' NOT NULL, - ban_start INT4 DEFAULT '0' NOT NULL, - ban_end INT4 DEFAULT '0' NOT NULL, - ban_exclude INT2 DEFAULT '0' NOT NULL, - ban_reason varchar(255) DEFAULT '' NOT NULL, - ban_give_reason varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (ban_id), + ban_id INT4 DEFAULT nextval('phpbb_banlist_seq'), + ban_userid INT4 DEFAULT 0 NOT NULL, + ban_ip varchar(40) DEFAULT '' NOT NULL, + ban_email varchar(100) DEFAULT '' NOT NULL, + ban_start INT4 DEFAULT '0' NOT NULL, + ban_end INT4 DEFAULT '0' NOT NULL, + ban_exclude INT2 DEFAULT '0' NOT NULL, + ban_reason TEXT, + ban_give_reason TEXT, + PRIMARY KEY (ban_id), CHECK (ban_userid>=0) ); -SELECT SETVAL('phpbb_banlist_ban_id_seq',(select case when max(ban_id)>0 then max(ban_id)+1 else 1 end from phpbb_banlist)); +SELECT SETVAL('phpbb_banlist_seq',(select case when max(ban_id)>0 then max(ban_id)+1 else 1 end from phpbb_banlist)); + /* Table: phpbb_bbcodes */ CREATE TABLE phpbb_bbcodes ( @@ -132,34 +139,36 @@ CREATE TABLE phpbb_bbcodes ( bbcode_tag varchar(16) DEFAULT '' NOT NULL, display_on_posting INT2 DEFAULT '0' NOT NULL, bbcode_match varchar(255) DEFAULT '' NOT NULL, - bbcode_tpl text DEFAULT '' NOT NULL, + bbcode_tpl TEXT, first_pass_match varchar(255) DEFAULT '' NOT NULL, first_pass_replace varchar(255) DEFAULT '' NOT NULL, second_pass_match varchar(255) DEFAULT '' NOT NULL, - second_pass_replace text DEFAULT '' NOT NULL, + second_pass_replace TEXT, PRIMARY KEY (bbcode_id), CHECK (bbcode_id>=0) ); -CREATE INDEX display_on_posting_phpbb_bbcodes_index ON phpbb_bbcodes (display_on_posting); +CREATE INDEX phpbb_bbcodes_display_on_posting ON phpbb_bbcodes (display_on_posting); + /* Table: phpbb_bookmarks */ CREATE TABLE phpbb_bookmarks ( - topic_id INT4 DEFAULT '0' NOT NULL, - user_id INT4 DEFAULT '0' NOT NULL, - order_id INT4 DEFAULT '0' NOT NULL + topic_id INT4 DEFAULT '0' NOT NULL, + user_id INT4 DEFAULT '0' NOT NULL, + order_id INT4 DEFAULT '0' NOT NULL ); -CREATE INDEX order_id_phpbb_bookmarks_index ON phpbb_bookmarks (order_id); -CREATE INDEX topic_user_id_phpbb_bookmarks_index ON phpbb_bookmarks (topic_id, user_id); +CREATE INDEX phpbb_bookmarks_order_id ON phpbb_bookmarks (order_id); +CREATE INDEX phpbb_bookmarks_topic_user_id ON phpbb_bookmarks (topic_id, user_id); + /* Table: phpbb_bots */ -CREATE SEQUENCE phpbb_bots_bot_id_seq; +CREATE SEQUENCE phpbb_bots_seq; CREATE TABLE phpbb_bots ( - bot_id INT2 DEFAULT nextval('phpbb_bots_bot_id_seq'), + bot_id INT2 DEFAULT nextval('phpbb_bots_seq'), bot_active INT2 DEFAULT '1' NOT NULL, - bot_name varchar(255) DEFAULT '' NOT NULL, + bot_name TEXT, user_id INT4 DEFAULT '0' NOT NULL, bot_agent varchar(255) DEFAULT '' NOT NULL, bot_ip varchar(255) DEFAULT '' NOT NULL, @@ -167,28 +176,31 @@ CREATE TABLE phpbb_bots ( CHECK (user_id>=0) ); -CREATE INDEX bot_active_phpbb_bots_index ON phpbb_bots (bot_active); +CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active); + +SELECT SETVAL('phpbb_bots_seq',(select case when max(bot_id)>0 then max(bot_id)+1 else 1 end from phpbb_bots)); -SELECT SETVAL('phpbb_bots_bot_id_seq',(select case when max(bot_id)>0 then max(bot_id)+1 else 1 end from phpbb_bots)); /* Table: phpbb_cache */ CREATE TABLE phpbb_cache ( var_name varchar(255) DEFAULT '' NOT NULL, var_expires INT4 DEFAULT '0' NOT NULL, - var_data TEXT DEFAULT '' NOT NULL, + var_data TEXT, PRIMARY KEY (var_name), CHECK (var_expires>=0) ); + /* Table: phpbb_config */ CREATE TABLE phpbb_config ( - config_name varchar(255) NOT NULL, - config_value varchar(255) NOT NULL, - is_dynamic INT2 DEFAULT '0' NOT NULL, - PRIMARY KEY (config_name) + config_name varchar(255) NOT NULL, + config_value varchar(255) NOT NULL, + is_dynamic INT2 DEFAULT '0' NOT NULL, + PRIMARY KEY (config_name) ); -CREATE INDEX is_dynamic_phpbb_config_index ON phpbb_config (is_dynamic); +CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic); + /* Table: phpbb_confirm */ CREATE TABLE phpbb_confirm ( @@ -199,28 +211,30 @@ CREATE TABLE phpbb_confirm ( PRIMARY KEY (session_id,confirm_id) ); + /* Table: phpbb_disallow */ -CREATE SEQUENCE phpbb_disallow_disallow_id_s; +CREATE SEQUENCE phpbb_disallow_seq; CREATE TABLE phpbb_disallow ( - disallow_id INT4 DEFAULT nextval('phpbb_disallow_disallow_id_s'), - disallow_username varchar(30) DEFAULT '' NOT NULL, - PRIMARY KEY (disallow_id) + disallow_id INT4 DEFAULT nextval('phpbb_disallow_seq'), + disallow_username varchar(255) DEFAULT '' NOT NULL, + PRIMARY KEY (disallow_id) ); -SELECT SETVAL('phpbb_disallow_disallow_id_s',(select case when max(disallow_id)>0 then max(disallow_id)+1 else 1 end from phpbb_disallow)); +SELECT SETVAL('phpbb_disallow_seq',(select case when max(disallow_id)>0 then max(disallow_id)+1 else 1 end from phpbb_disallow)); + /* Table: phpbb_drafts */ -CREATE SEQUENCE phpbb_drafts_draft_id_seq; +CREATE SEQUENCE phpbb_drafts_seq; CREATE TABLE phpbb_drafts ( - draft_id INT4 DEFAULT nextval('phpbb_drafts_draft_id_seq'), + draft_id INT4 DEFAULT nextval('phpbb_drafts_seq'), user_id INT4 DEFAULT '0' NOT NULL, topic_id INT4 DEFAULT '0' NOT NULL, forum_id INT4 DEFAULT '0' NOT NULL, save_time INT4 DEFAULT '0' NOT NULL, - draft_subject varchar(60), - draft_message text DEFAULT '' NOT NULL, + draft_subject TEXT, + draft_message TEXT, PRIMARY KEY (draft_id), CHECK (user_id>=0), CHECK (topic_id>=0), @@ -228,83 +242,86 @@ CREATE TABLE phpbb_drafts ( CHECK (save_time>=0) ); -CREATE INDEX save_time_phpbb_drafts_index ON phpbb_drafts (save_time); +CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time); + +SELECT SETVAL('phpbb_drafts_seq',(select case when max(draft_id)>0 then max(draft_id)+1 else 1 end from phpbb_drafts)); -SELECT SETVAL('phpbb_drafts_draft_id_seq',(select case when max(draft_id)>0 then max(draft_id)+1 else 1 end from phpbb_drafts)); /* Table: phpbb_extensions */ -CREATE SEQUENCE phpbb_extensions_extension_i; +CREATE SEQUENCE phpbb_extensions_seq; CREATE TABLE phpbb_extensions ( - extension_id INT4 DEFAULT nextval('phpbb_extensions_extension_i'), + extension_id INT4 DEFAULT nextval('phpbb_extensions_seq'), group_id INT4 DEFAULT '0' NOT NULL, extension varchar(100) DEFAULT '' NOT NULL, PRIMARY KEY (extension_id), CHECK (group_id>=0) ); -SELECT SETVAL('phpbb_extensions_extension_i',(select case when max(extension_id)>0 then max(extension_id)+1 else 1 end from phpbb_extensions)); +SELECT SETVAL('phpbb_extensions_seq',(select case when max(extension_id)>0 then max(extension_id)+1 else 1 end from phpbb_extensions)); + /* Table: phpbb_extension_groups */ -CREATE SEQUENCE phpbb_extension_groups_group; +CREATE SEQUENCE phpbb_extension_groups_seq; CREATE TABLE phpbb_extension_groups ( - group_id INT4 DEFAULT nextval('phpbb_extension_groups_group'), - group_name varchar(20) NOT NULL, + group_id INT4 DEFAULT nextval('phpbb_extension_groups_seq'), + group_name varchar(255) NOT NULL, cat_id INT2 DEFAULT '0' NOT NULL, allow_group INT2 DEFAULT '0' NOT NULL, download_mode INT2 DEFAULT '1' NOT NULL, - upload_icon varchar(100) DEFAULT '' NOT NULL, + upload_icon varchar(255) DEFAULT '' NOT NULL, max_filesize INT4 DEFAULT '0' NOT NULL, - allowed_forums TEXT DEFAULT '' NOT NULL, + allowed_forums TEXT, allow_in_pm INT2 DEFAULT '0' NOT NULL, PRIMARY KEY (group_id), CHECK (download_mode>=0) ); -SELECT SETVAL('phpbb_extension_groups_group',(select case when max(group_id)>0 then max(group_id)+1 else 1 end from phpbb_extension_groups)); +SELECT SETVAL('phpbb_extension_groups_seq',(select case when max(group_id)>0 then max(group_id)+1 else 1 end from phpbb_extension_groups)); + /* Table: phpbb_forums */ -CREATE SEQUENCE phpbb_forums_forum_id_seq; +CREATE SEQUENCE phpbb_forums_seq; CREATE TABLE phpbb_forums ( - forum_id INT2 DEFAULT nextval('phpbb_forums_forum_id_seq'), - parent_id INT2 NOT NULL, - left_id INT2 NOT NULL, - right_id INT2 NOT NULL, - forum_parents text, - forum_name varchar(150) NOT NULL, - forum_desc text, - forum_desc_bitfield INT4 DEFAULT '0' NOT NULL, - forum_desc_uid varchar(5) DEFAULT '' NOT NULL, - forum_link varchar(200) DEFAULT '' NOT NULL, - forum_password varchar(32) DEFAULT '' NOT NULL, - forum_style INT2 , - forum_image varchar(50) DEFAULT '' NOT NULL, - forum_rules text DEFAULT '' NOT NULL, - forum_rules_link varchar(200) DEFAULT '' NOT NULL, - forum_rules_bitfield INT4 DEFAULT '0' NOT NULL, - forum_rules_uid varchar(5) 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 INT4 DEFAULT '0' NOT NULL, - forum_topics INT4 DEFAULT '0' NOT NULL, - forum_topics_real INT4 DEFAULT '0' NOT NULL, - forum_last_post_id INT4 DEFAULT '0' NOT NULL, - forum_last_poster_id INT4 DEFAULT '0' NOT NULL, - forum_last_post_time INT4 DEFAULT '0' NOT NULL, - forum_last_poster_name varchar(30), - forum_flags INT2 DEFAULT '0' NOT NULL, - display_on_index INT2 DEFAULT '1' NOT NULL, - enable_indexing INT2 DEFAULT '1' NOT NULL, - enable_icons INT2 DEFAULT '1' NOT NULL, - enable_prune INT2 DEFAULT '0' NOT NULL, - prune_next INT4 , - prune_days INT2 NOT NULL, - prune_viewed INT2 NOT NULL, - prune_freq INT2 DEFAULT '0' NOT NULL, - PRIMARY KEY (forum_id), + forum_id INT2 DEFAULT nextval('phpbb_forums_seq'), + parent_id INT2 NOT NULL, + left_id INT2 NOT NULL, + right_id INT2 NOT NULL, + forum_parents TEXT, + forum_name TEXT, + forum_desc TEXT, + forum_desc_bitfield INT4 DEFAULT '0' NOT NULL, + forum_desc_uid varchar(5) DEFAULT '' NOT NULL, + forum_link varchar(255) DEFAULT '' NOT NULL, + forum_password varchar(40) DEFAULT '' NOT NULL, + forum_style INT2 , + forum_image varchar(255) DEFAULT '' NOT NULL, + forum_rules TEXT, + forum_rules_link varchar(255) DEFAULT '' NOT NULL, + forum_rules_bitfield INT4 DEFAULT '0' NOT NULL, + forum_rules_uid varchar(5) 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 INT4 DEFAULT '0' NOT NULL, + forum_topics INT4 DEFAULT '0' NOT NULL, + forum_topics_real INT4 DEFAULT '0' NOT NULL, + forum_last_post_id INT4 DEFAULT '0' NOT NULL, + forum_last_poster_id INT4 DEFAULT '0' NOT NULL, + forum_last_post_time INT4 DEFAULT '0' NOT NULL, + forum_last_poster_name varchar(255), + forum_flags INT2 DEFAULT '0' NOT NULL, + display_on_index INT2 DEFAULT '1' NOT NULL, + enable_indexing INT2 DEFAULT '1' NOT NULL, + enable_icons INT2 DEFAULT '1' NOT NULL, + enable_prune INT2 DEFAULT '0' NOT NULL, + prune_next INT4 , + prune_days INT2 NOT NULL, + prune_viewed INT2 NOT NULL, + prune_freq INT2 DEFAULT '0' NOT NULL, + PRIMARY KEY (forum_id), CHECK (parent_id>=0), CHECK (left_id>=0), CHECK (right_id>=0), @@ -322,10 +339,11 @@ CREATE TABLE phpbb_forums ( CHECK (prune_freq>=0) ); -CREATE INDEX left_right_id_phpbb_forums_index ON phpbb_forums (left_id, right_id); -CREATE INDEX forum_last_post_id_phpbb_forums_index ON phpbb_forums (forum_last_post_id); +CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums (left_id, right_id); +CREATE INDEX phpbb_forums_forum_last_post_id ON phpbb_forums (forum_last_post_id); + +SELECT SETVAL('phpbb_forums_seq',(select case when max(forum_id)>0 then max(forum_id)+1 else 1 end from phpbb_forums)); -SELECT SETVAL('phpbb_forums_forum_id_seq',(select case when max(forum_id)>0 then max(forum_id)+1 else 1 end from phpbb_forums)); /* Table: phpbb_forum_access */ CREATE TABLE phpbb_forum_access ( @@ -337,16 +355,18 @@ CREATE TABLE phpbb_forum_access ( CHECK (user_id>=0) ); + /* Table: phpbb_forums_marking */ CREATE TABLE phpbb_forums_marking ( - user_id INT4 DEFAULT '0' NOT NULL, - forum_id INT4 DEFAULT '0' NOT NULL, - mark_time INT4 DEFAULT '0' NOT NULL, - PRIMARY KEY (user_id,forum_id), + user_id INT4 DEFAULT '0' NOT NULL, + forum_id INT4 DEFAULT '0' NOT NULL, + mark_time INT4 DEFAULT '0' NOT NULL, + PRIMARY KEY (user_id,forum_id), CHECK (user_id>=0), CHECK (forum_id>=0) ); + /* Table: phpbb_forums_watch */ CREATE TABLE phpbb_forums_watch ( forum_id INT2 DEFAULT '0' NOT NULL, @@ -354,33 +374,34 @@ CREATE TABLE phpbb_forums_watch ( notify_status INT2 DEFAULT '0' NOT NULL ); -CREATE INDEX forum_id_phpbb_forums_watch_index ON phpbb_forums_watch (forum_id); -CREATE INDEX user_id_phpbb_forums_watch_index ON phpbb_forums_watch (user_id); -CREATE INDEX notify_status_phpbb_forums_watch_index ON phpbb_forums_watch (notify_status); +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_status ON phpbb_forums_watch (notify_status); + /* Table: phpbb_groups */ -CREATE SEQUENCE phpbb_groups_group_id_seq; +CREATE SEQUENCE phpbb_groups_seq; CREATE TABLE phpbb_groups ( - group_id INT4 DEFAULT nextval('phpbb_groups_group_id_seq'), - group_type INT2 DEFAULT '1' NOT NULL, - group_name varchar(40) DEFAULT '' NOT NULL, - group_desc text, - group_desc_bitfield INT4 DEFAULT '0' NOT NULL, - group_desc_uid varchar(5) DEFAULT '' NOT NULL, - group_display INT2 DEFAULT '0' NOT NULL, - group_avatar varchar(100) DEFAULT '' NOT NULL, - group_avatar_type INT2 DEFAULT '0' NOT NULL, - group_avatar_width INT2 DEFAULT '0' NOT NULL, - group_avatar_height INT2 DEFAULT '0' NOT NULL, - group_rank INT2 DEFAULT '-1' NOT NULL, - group_colour varchar(6) DEFAULT '' NOT NULL, - group_sig_chars INT4 DEFAULT '0' NOT NULL, - group_receive_pm INT2 DEFAULT '0' NOT NULL, - group_message_limit INT4 DEFAULT '0' NOT NULL, - group_chgpass INT2 DEFAULT '0' NOT NULL, - group_legend INT2 DEFAULT '1' NOT NULL, - PRIMARY KEY (group_id), + group_id INT4 DEFAULT nextval('phpbb_groups_seq'), + group_type INT2 DEFAULT '1' NOT NULL, + group_name varchar(255) NOT NULL, + group_desc TEXT, + group_desc_bitfield INT4 DEFAULT '0' NOT NULL, + group_desc_uid varchar(5) DEFAULT '' NOT NULL, + group_display INT2 DEFAULT '0' NOT NULL, + group_avatar varchar(255) DEFAULT '' NOT NULL, + group_avatar_type INT2 DEFAULT '0' NOT NULL, + group_avatar_width INT2 DEFAULT '0' NOT NULL, + group_avatar_height INT2 DEFAULT '0' NOT NULL, + group_rank INT2 DEFAULT '-1' NOT NULL, + group_colour varchar(6) DEFAULT '' NOT NULL, + group_sig_chars INT4 DEFAULT '0' NOT NULL, + group_receive_pm INT2 DEFAULT '0' NOT NULL, + group_message_limit INT4 DEFAULT '0' NOT NULL, + group_chgpass INT2 DEFAULT '0' NOT NULL, + group_legend INT2 DEFAULT '1' NOT NULL, + PRIMARY KEY (group_id), CHECK (group_avatar_width>=0), CHECK (group_avatar_height>=0), CHECK (group_desc_bitfield>=0), @@ -388,49 +409,52 @@ CREATE TABLE phpbb_groups ( CHECK (group_message_limit>=0) ); -CREATE INDEX group_legend_phpbb_groups_index ON phpbb_groups (group_legend); +CREATE INDEX phpbb_groups_group_legend ON phpbb_groups (group_legend); + +SELECT SETVAL('phpbb_groups_seq',(select case when max(group_id)>0 then max(group_id)+1 else 1 end from phpbb_groups)); -SELECT SETVAL('phpbb_groups_group_id_seq',(select case when max(group_id)>0 then max(group_id)+1 else 1 end from phpbb_groups)); /* Table: phpbb_icons */ -CREATE SEQUENCE phpbb_icons_icons_id_seq; +CREATE SEQUENCE phpbb_icons_seq; CREATE TABLE phpbb_icons ( - icons_id INT2 DEFAULT nextval('phpbb_icons_icons_id_seq'), - icons_url varchar(50), - icons_width INT2 NOT NULL, - icons_height INT2 NOT NULL, - icons_order INT2 NOT NULL, - display_on_posting INT2 DEFAULT '1' NOT NULL, - PRIMARY KEY (icons_id), + icons_id INT2 DEFAULT nextval('phpbb_icons_seq'), + icons_url varchar(255), + icons_width INT2 NOT NULL, + icons_height INT2 NOT NULL, + icons_order INT2 NOT NULL, + display_on_posting INT2 DEFAULT '1' NOT NULL, + PRIMARY KEY (icons_id), CHECK (icons_width>=0), CHECK (icons_height>=0), CHECK (icons_order>=0), CHECK (display_on_posting>=0) ); -SELECT SETVAL('phpbb_icons_icons_id_seq',(select case when max(icons_id)>0 then max(icons_id)+1 else 1 end from phpbb_icons)); +SELECT SETVAL('phpbb_icons_seq',(select case when max(icons_id)>0 then max(icons_id)+1 else 1 end from phpbb_icons)); + /* Table: phpbb_lang */ -CREATE SEQUENCE phpbb_lang_lang_id_seq; +CREATE SEQUENCE phpbb_lang_seq; CREATE TABLE phpbb_lang ( - lang_id INT2 DEFAULT nextval('phpbb_lang_lang_id_seq'), - lang_iso varchar(5) NOT NULL, - lang_dir varchar(30) NOT NULL, - lang_english_name varchar(30), - lang_local_name varchar(100), - lang_author varchar(100), - PRIMARY KEY (lang_id) + lang_id INT2 DEFAULT nextval('phpbb_lang_seq'), + lang_iso varchar(5) NOT NULL, + lang_dir varchar(30) NOT NULL, + lang_english_name varchar(100), + lang_local_name varchar(255), + lang_author varchar(255), + PRIMARY KEY (lang_id) ); -SELECT SETVAL('phpbb_lang_lang_id_seq',(select case when max(lang_id)>0 then max(lang_id)+1 else 1 end from phpbb_lang)); +SELECT SETVAL('phpbb_lang_seq',(select case when max(lang_id)>0 then max(lang_id)+1 else 1 end from phpbb_lang)); + /* Table: phpbb_log */ -CREATE SEQUENCE phpbb_log_log_id_seq; +CREATE SEQUENCE phpbb_log_seq; CREATE TABLE phpbb_log ( - log_id INT4 DEFAULT nextval('phpbb_log_log_id_seq'), + log_id INT4 DEFAULT nextval('phpbb_log_seq'), log_type INT2 DEFAULT '0' NOT NULL, user_id INT4 DEFAULT '0' NOT NULL, forum_id INT4 DEFAULT '0' NOT NULL, @@ -438,8 +462,8 @@ CREATE TABLE phpbb_log ( reportee_id INT4 DEFAULT '0' NOT NULL, log_ip varchar(40) NOT NULL, log_time INT4 NOT NULL, - log_operation text, - log_data text, + log_operation TEXT, + log_data TEXT, PRIMARY KEY (log_id), CHECK (log_type>=0), CHECK (forum_id>=0), @@ -447,61 +471,65 @@ CREATE TABLE phpbb_log ( CHECK (reportee_id>=0) ); -CREATE INDEX log_type_phpbb_log_index ON phpbb_log (log_type); -CREATE INDEX forum_id_phpbb_log_index ON phpbb_log (forum_id); -CREATE INDEX topic_id_phpbb_log_index ON phpbb_log (topic_id); -CREATE INDEX reportee_id_phpbb_log_index ON phpbb_log (reportee_id); -CREATE INDEX user_id_phpbb_log_index ON phpbb_log (user_id); +CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type); +CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id); +CREATE INDEX phpbb_log_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); + +SELECT SETVAL('phpbb_log_seq',(select case when max(log_id)>0 then max(log_id)+1 else 1 end from phpbb_log)); -SELECT SETVAL('phpbb_log_log_id_seq',(select case when max(log_id)>0 then max(log_id)+1 else 1 end from phpbb_log)); /* Table: phpbb_moderator_cache */ CREATE TABLE phpbb_moderator_cache ( forum_id INT4 NOT NULL, user_id INT4 DEFAULT '0' NOT NULL, - username varchar(30) DEFAULT '' NOT NULL, + username varchar(255) DEFAULT '' NOT NULL, group_id INT4 DEFAULT '0' NOT NULL, - groupname varchar(30) DEFAULT '' NOT NULL, + group_name varchar(255) DEFAULT '' NOT NULL, display_on_index INT2 DEFAULT '1' NOT NULL ); -CREATE INDEX display_on_index_phpbb_moderator_cache_index ON phpbb_moderator_cache (display_on_index); -CREATE INDEX forum_id_phpbb_moderator_cache_index ON phpbb_moderator_cache (forum_id); +CREATE INDEX phpbb_moderator_cache_display_on_index ON phpbb_moderator_cache (display_on_index); +CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache (forum_id); + /* Table: phpbb_modules */ -CREATE SEQUENCE phpbb_modules_module_id_seq; +CREATE SEQUENCE phpbb_modules_seq; CREATE TABLE phpbb_modules ( - module_id INT4 DEFAULT nextval('phpbb_modules_module_id_seq'), + module_id INT4 DEFAULT nextval('phpbb_modules_seq'), module_enabled INT2 DEFAULT '1' NOT NULL, module_display INT2 DEFAULT '1' NOT NULL, - module_name varchar(20) DEFAULT '' NOT NULL, - module_class varchar(4) DEFAULT '' NOT NULL, + module_name varchar(255) DEFAULT '' NOT NULL, + module_class varchar(10) DEFAULT '' NOT NULL, parent_id INT4 DEFAULT '0' NOT NULL, left_id INT4 DEFAULT '0' NOT NULL, right_id INT4 DEFAULT '0' NOT NULL, - module_langname varchar(50) DEFAULT '' 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), CHECK (module_enabled>=0) ); -CREATE INDEX module_enabled_phpbb_modules_index ON phpbb_modules (module_enabled); -CREATE INDEX left_id_phpbb_modules_index ON phpbb_modules (left_id); +CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled); +CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id); + +SELECT SETVAL('phpbb_modules_seq',(select case when max(module_id)>0 then max(module_id)+1 else 1 end from phpbb_modules)); -SELECT SETVAL('phpbb_modules_module_id_seq',(select case when max(module_id)>0 then max(module_id)+1 else 1 end from phpbb_modules)); /* Table: phpbb_poll_results */ CREATE TABLE phpbb_poll_results ( poll_option_id INT2 DEFAULT '0' NOT NULL, topic_id INT4 NOT NULL, - poll_option_text varchar(255) NOT NULL, + poll_option_text TEXT, poll_option_total INT4 DEFAULT '0' NOT NULL ); -CREATE INDEX poll_option_id_phpbb_poll_results_index ON phpbb_poll_results (poll_option_id); -CREATE INDEX topic_id_phpbb_poll_results_index ON phpbb_poll_results (topic_id); +CREATE INDEX phpbb_poll_results_poll_option_id ON phpbb_poll_results (poll_option_id); +CREATE INDEX phpbb_poll_results_topic_id ON phpbb_poll_results (topic_id); + /* Table: phpbb_poll_voters */ CREATE TABLE phpbb_poll_voters ( @@ -511,41 +539,42 @@ CREATE TABLE phpbb_poll_voters ( vote_user_ip varchar(40) NOT NULL ); -CREATE INDEX topic_id_phpbb_poll_voters_index ON phpbb_poll_voters (topic_id); -CREATE INDEX vote_user_id_phpbb_poll_voters_index ON phpbb_poll_voters (vote_user_id); -CREATE INDEX vote_user_ip_phpbb_poll_voters_index ON phpbb_poll_voters (vote_user_ip); +CREATE INDEX phpbb_poll_voters_topic_id ON phpbb_poll_voters (topic_id); +CREATE INDEX phpbb_poll_voters_vote_user_id ON phpbb_poll_voters (vote_user_id); +CREATE INDEX phpbb_poll_voters_vote_user_ip ON phpbb_poll_voters (vote_user_ip); + /* Table: phpbb_posts */ -CREATE SEQUENCE phpbb_posts_post_id_seq; +CREATE SEQUENCE phpbb_posts_seq; CREATE TABLE phpbb_posts ( - post_id INT4 DEFAULT nextval('phpbb_posts_post_id_seq'), - topic_id INT4 DEFAULT '0' NOT NULL, - forum_id INT2 DEFAULT '0' NOT NULL, - poster_id INT4 DEFAULT '0' NOT NULL, - icon_id INT2 DEFAULT '1' NOT NULL, - poster_ip varchar(40) NOT NULL, - post_time INT4 DEFAULT '0' NOT NULL, - post_approved INT2 DEFAULT '1' NOT NULL, - post_reported INT2 DEFAULT '0' NOT NULL, - enable_bbcode INT2 DEFAULT '1' NOT NULL, - enable_smilies INT2 DEFAULT '1' NOT NULL, - enable_magic_url INT2 DEFAULT '1' NOT NULL, - enable_sig INT2 DEFAULT '1' NOT NULL, - post_username varchar(30), - post_subject varchar(60), - post_text text, - post_checksum varchar(32) NOT NULL, - post_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, - post_attachment INT2 DEFAULT '0' NOT NULL, - bbcode_bitfield INT4 DEFAULT '0' NOT NULL, - bbcode_uid varchar(5) DEFAULT '' NOT NULL, - post_edit_time INT4 DEFAULT '0' NOT NULL, - post_edit_reason varchar(100), - post_edit_user INT4 DEFAULT '0' NOT NULL, - post_edit_count INT2 DEFAULT '0' NOT NULL, - post_edit_locked INT2 DEFAULT '0' NOT NULL, - PRIMARY KEY (post_id), + post_id INT4 DEFAULT nextval('phpbb_posts_seq'), + topic_id INT4 DEFAULT '0' NOT NULL, + forum_id INT2 DEFAULT '0' NOT NULL, + poster_id INT4 DEFAULT '0' NOT NULL, + icon_id INT2 DEFAULT '1' NOT NULL, + poster_ip varchar(40) NOT NULL, + post_time INT4 DEFAULT '0' NOT NULL, + post_approved INT2 DEFAULT '1' NOT NULL, + post_reported INT2 DEFAULT '0' NOT NULL, + enable_bbcode INT2 DEFAULT '1' NOT NULL, + enable_smilies INT2 DEFAULT '1' NOT NULL, + enable_magic_url INT2 DEFAULT '1' NOT NULL, + enable_sig INT2 DEFAULT '1' NOT NULL, + post_username varchar(255), + post_subject TEXT, + post_text TEXT, + post_checksum varchar(32) NOT NULL, + post_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, + post_attachment INT2 DEFAULT '0' NOT NULL, + bbcode_bitfield INT4 DEFAULT '0' NOT NULL, + bbcode_uid varchar(5) DEFAULT '' NOT NULL, + post_edit_time INT4 DEFAULT '0' NOT NULL, + post_edit_reason TEXT, + post_edit_user INT4 DEFAULT '0' NOT NULL, + post_edit_count INT2 DEFAULT '0' NOT NULL, + post_edit_locked INT2 DEFAULT '0' NOT NULL, + PRIMARY KEY (post_id), CHECK (topic_id>=0), CHECK (forum_id>=0), CHECK (poster_id>=0), @@ -557,42 +586,43 @@ CREATE TABLE phpbb_posts ( CHECK (post_edit_locked>=0) ); -CREATE INDEX forum_id_phpbb_posts_index ON phpbb_posts (forum_id); -CREATE INDEX topic_id_phpbb_posts_index ON phpbb_posts (topic_id); -CREATE INDEX poster_ip_phpbb_posts_index ON phpbb_posts (poster_ip); -CREATE INDEX poster_id_phpbb_posts_index ON phpbb_posts (poster_id); -CREATE INDEX post_approved_phpbb_posts_index ON phpbb_posts (post_approved); -CREATE INDEX post_time_phpbb_posts_index ON phpbb_posts (post_time); +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_approved ON phpbb_posts (post_approved); +CREATE INDEX phpbb_posts_post_time ON phpbb_posts (post_time); + +SELECT SETVAL('phpbb_posts_seq',(select case when max(post_id)>0 then max(post_id)+1 else 1 end from phpbb_posts)); -SELECT SETVAL('phpbb_posts_post_id_seq',(select case when max(post_id)>0 then max(post_id)+1 else 1 end from phpbb_posts)); /* Table: phpbb_privmsgs */ -CREATE SEQUENCE phpbb_privmsgs_msg_id_seq; +CREATE SEQUENCE phpbb_privmsgs_seq; CREATE TABLE phpbb_privmsgs ( - msg_id INT4 DEFAULT nextval('phpbb_privmsgs_msg_id_seq'), - root_level INT4 DEFAULT '0' NOT NULL, - author_id INT4 DEFAULT '0' NOT NULL, - icon_id INT2 DEFAULT '1' NOT NULL, - author_ip varchar(40) DEFAULT '' NOT NULL, - message_time INT4 DEFAULT '0' NOT NULL, - enable_bbcode INT2 DEFAULT '1' NOT NULL, - enable_smilies INT2 DEFAULT '1' NOT NULL, - enable_magic_url INT2 DEFAULT '1' NOT NULL, - enable_sig INT2 DEFAULT '1' NOT NULL, - message_subject varchar(60), - message_text text, - message_edit_reason varchar(100), - message_edit_user INT4 DEFAULT '0' NOT NULL, - message_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, - message_attachment INT2 DEFAULT '0' NOT NULL, - bbcode_bitfield INT4 DEFAULT '0' NOT NULL, - bbcode_uid varchar(5) DEFAULT '' NOT NULL, - message_edit_time INT4 DEFAULT '0' NOT NULL, - message_edit_count INT2 DEFAULT '0' NOT NULL, - to_address text, - bcc_address text, - PRIMARY KEY (msg_id), + msg_id INT4 DEFAULT nextval('phpbb_privmsgs_msg_id_seq'), + root_level INT4 DEFAULT '0' NOT NULL, + author_id INT4 DEFAULT '0' NOT NULL, + icon_id INT2 DEFAULT '1' NOT NULL, + author_ip varchar(40) DEFAULT '' NOT NULL, + message_time INT4 DEFAULT '0' NOT NULL, + enable_bbcode INT2 DEFAULT '1' NOT NULL, + enable_smilies INT2 DEFAULT '1' NOT NULL, + enable_magic_url INT2 DEFAULT '1' NOT NULL, + enable_sig INT2 DEFAULT '1' NOT NULL, + message_subject TEXT, + message_text TEXT, + message_edit_reason TEXT, + message_edit_user INT4 DEFAULT '0' NOT NULL, + message_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, + message_attachment INT2 DEFAULT '0' NOT NULL, + bbcode_bitfield INT4 DEFAULT '0' NOT NULL, + bbcode_uid varchar(5) DEFAULT '' NOT NULL, + message_edit_time INT4 DEFAULT '0' NOT NULL, + message_edit_count INT2 DEFAULT '0' NOT NULL, + to_address TEXT, + bcc_address TEXT, + PRIMARY KEY (msg_id), CHECK (root_level>=0), CHECK (author_id>=0), CHECK (icon_id>=0), @@ -602,44 +632,46 @@ CREATE TABLE phpbb_privmsgs ( CHECK (message_edit_count>=0) ); -CREATE INDEX author_ip_phpbb_privmsgs_index ON phpbb_privmsgs (author_ip); -CREATE INDEX message_time_phpbb_privmsgs_index ON phpbb_privmsgs (message_time); -CREATE INDEX author_id_phpbb_privmsgs_index ON phpbb_privmsgs (author_id); -CREATE INDEX root_level_phpbb_privmsgs_index ON phpbb_privmsgs (root_level); +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); + +SELECT SETVAL('phpbb_privmsgs_seq',(select case when max(msg_id)>0 then max(msg_id)+1 else 1 end from phpbb_privmsgs)); -SELECT SETVAL('phpbb_privmsgs_msg_id_seq',(select case when max(msg_id)>0 then max(msg_id)+1 else 1 end from phpbb_privmsgs)); /* Table: phpbb_privmsgs_folder */ -CREATE SEQUENCE phpbb_privmsgs_folder_folder; +CREATE SEQUENCE phpbb_privmsgs_folder_seq; CREATE TABLE phpbb_privmsgs_folder ( - folder_id INT4 DEFAULT nextval('phpbb_privmsgs_folder_folder'), - user_id INT4 DEFAULT '0' NOT NULL, - folder_name varchar(40) DEFAULT '' NOT NULL, - pm_count INT4 DEFAULT '0' NOT NULL, - PRIMARY KEY (folder_id), + folder_id INT4 DEFAULT nextval('phpbb_privmsgs_folder_seq'), + user_id INT4 DEFAULT '0' NOT NULL, + folder_name varchar(255) DEFAULT '' NOT NULL, + pm_count INT4 DEFAULT '0' NOT NULL, + PRIMARY KEY (folder_id), CHECK (user_id>=0), CHECK (pm_count>=0) ); -CREATE INDEX user_id_phpbb_privmsgs_folder_index ON phpbb_privmsgs_folder (user_id); +CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id); + +SELECT SETVAL('phpbb_privmsgs_folder_seq',(select case when max(folder_id)>0 then max(folder_id)+1 else 1 end from phpbb_privmsgs_folder)); -SELECT SETVAL('phpbb_privmsgs_folder_folder',(select case when max(folder_id)>0 then max(folder_id)+1 else 1 end from phpbb_privmsgs_folder)); /* Table: phpbb_privmsgs_rules */ -CREATE SEQUENCE phpbb_privmsgs_rules_rule_id; +CREATE SEQUENCE phpbb_privmsgs_rules_seq; CREATE TABLE phpbb_privmsgs_rules ( - rule_id INT4 DEFAULT nextval('phpbb_privmsgs_rules_rule_id'), - user_id INT4 DEFAULT '0' NOT NULL, - rule_check INT4 DEFAULT '0' NOT NULL, - rule_connection INT4 DEFAULT '0' NOT NULL, - rule_string varchar(255) DEFAULT '' NOT NULL, - rule_user_id INT4 DEFAULT '0' NOT NULL, - rule_group_id INT4 DEFAULT '0' NOT NULL, - rule_action INT4 DEFAULT '0' NOT NULL, - rule_folder_id INT4 DEFAULT '0' NOT NULL, - PRIMARY KEY (rule_id), + rule_id INT4 DEFAULT nextval('phpbb_privmsgs_rules_seq'), + user_id INT4 DEFAULT '0' NOT NULL, + rule_check INT4 DEFAULT '0' NOT NULL, + rule_connection INT4 DEFAULT '0' NOT NULL, + rule_string varchar(255) DEFAULT '' NOT NULL, + rule_user_id INT4 DEFAULT '0' NOT NULL, + rule_group_id INT4 DEFAULT '0' NOT NULL, + rule_action INT4 DEFAULT '0' NOT NULL, + rule_folder_id INT4 DEFAULT '0' NOT NULL, + PRIMARY KEY (rule_id), CHECK (user_id>=0), CHECK (rule_check>=0), CHECK (rule_connection>=0), @@ -649,47 +681,49 @@ CREATE TABLE phpbb_privmsgs_rules ( CHECK (rule_folder_id>=0) ); -SELECT SETVAL('phpbb_privmsgs_rules_rule_id',(select case when max(rule_id)>0 then max(rule_id)+1 else 1 end from phpbb_privmsgs_rules)); +SELECT SETVAL('phpbb_privmsgs_rules_seq',(select case when max(rule_id)>0 then max(rule_id)+1 else 1 end from phpbb_privmsgs_rules)); + /* Table: phpbb_privmsgs_to */ CREATE TABLE phpbb_privmsgs_to ( - msg_id INT4 DEFAULT '0' NOT NULL, - user_id INT4 DEFAULT '0' NOT NULL, - author_id INT4 DEFAULT '0' NOT NULL, - deleted INT2 DEFAULT '0' NOT NULL, - "new" INT2 DEFAULT '1' NOT NULL, - unread INT2 DEFAULT '1' NOT NULL, - replied INT2 DEFAULT '0' NOT NULL, - marked INT2 DEFAULT '0' NOT NULL, - forwarded INT2 DEFAULT '0' NOT NULL, - folder_id INT4 DEFAULT '0' NOT NULL + msg_id INT4 DEFAULT '0' NOT NULL, + user_id INT4 DEFAULT '0' NOT NULL, + author_id INT4 DEFAULT '0' NOT NULL, + deleted INT2 DEFAULT '0' NOT NULL, + new INT2 DEFAULT '1' NOT NULL, + unread INT2 DEFAULT '1' NOT NULL, + replied INT2 DEFAULT '0' NOT NULL, + marked INT2 DEFAULT '0' NOT NULL, + forwarded INT2 DEFAULT '0' NOT NULL, + folder_id INT4 DEFAULT '0' NOT NULL ); -CREATE INDEX msg_id_phpbb_privmsgs_to_index ON phpbb_privmsgs_to (msg_id); -CREATE INDEX user_id_phpbb_privmsgs_to_index ON phpbb_privmsgs_to (user_id,folder_id); +CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id); +CREATE INDEX phpbb_privmsgs_to_user_id ON phpbb_privmsgs_to (user_id,folder_id); + /* Table: phpbb_profile_fields */ -CREATE SEQUENCE phpbb_profile_fields_field_i; +CREATE SEQUENCE phpbb_profile_fields_seq; CREATE TABLE phpbb_profile_fields ( - field_id INT4 DEFAULT nextval('phpbb_profile_fields_field_i'), - field_name varchar(50) DEFAULT '' NOT NULL, - field_desc varchar(255) DEFAULT '' NOT NULL, - field_type INT4 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 '0' NOT NULL, - field_validation varchar(20) DEFAULT '' NOT NULL, - field_required INT2 DEFAULT '0' NOT NULL, - field_show_on_reg INT2 DEFAULT '0' NOT NULL, - field_hide INT2 DEFAULT '0' NOT NULL, - field_no_view INT2 DEFAULT '0' NOT NULL, - field_active INT2 DEFAULT '0' NOT NULL, - field_order INT2 DEFAULT '0' NOT NULL, - PRIMARY KEY (field_id), + field_id INT4 DEFAULT nextval('phpbb_profile_fields_seq'), + field_name varchar(255) DEFAULT '' NOT NULL, + field_desc TEXT, + field_type INT4 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 '0' NOT NULL, + field_validation varchar(20) DEFAULT '' NOT NULL, + field_required INT2 DEFAULT '0' NOT NULL, + field_show_on_reg INT2 DEFAULT '0' NOT NULL, + field_hide INT2 DEFAULT '0' NOT NULL, + field_no_view INT2 DEFAULT '0' NOT NULL, + field_active INT2 DEFAULT '0' NOT NULL, + field_order INT2 DEFAULT '0' NOT NULL, + PRIMARY KEY (field_id), CHECK (field_type>=0), CHECK (field_required>=0), CHECK (field_show_on_reg>=0), @@ -699,82 +733,88 @@ CREATE TABLE phpbb_profile_fields ( CHECK (field_order>=0) ); -CREATE INDEX field_type_phpbb_profile_fields_index ON phpbb_profile_fields (field_type); -CREATE INDEX field_order_phpbb_profile_fields_index ON phpbb_profile_fields (field_order); +CREATE INDEX phpbb_profile_fields_field_type ON phpbb_profile_fields (field_type); +CREATE INDEX phpbb_profile_fields_field_order ON phpbb_profile_fields (field_order); + +SELECT SETVAL('phpbb_profile_fields_seq',(select case when max(field_id)>0 then max(field_id)+1 else 1 end from phpbb_profile_fields)); -SELECT SETVAL('phpbb_profile_fields_field_i',(select case when max(field_id)>0 then max(field_id)+1 else 1 end from phpbb_profile_fields)); /* Table: phpbb_profile_fields_data */ CREATE TABLE phpbb_profile_fields_data ( - user_id INT4 DEFAULT '0' NOT NULL, - PRIMARY KEY (user_id), + user_id INT4 DEFAULT '0' NOT NULL, + PRIMARY KEY (user_id), CHECK (user_id>=0) ); + /* Table: phpbb_profile_fields_lang */ CREATE TABLE phpbb_profile_fields_lang ( - field_id INT4 DEFAULT '0' NOT NULL, - lang_id INT4 DEFAULT '0' NOT NULL, - option_id INT4 DEFAULT '0' NOT NULL, - field_type INT2 DEFAULT '0' NOT NULL, - value varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (field_id,lang_id,option_id), + field_id INT4 DEFAULT '0' NOT NULL, + lang_id INT4 DEFAULT '0' NOT NULL, + option_id INT4 DEFAULT '0' NOT NULL, + field_type INT2 DEFAULT '0' NOT NULL, + value varchar(255) DEFAULT '' NOT NULL, + PRIMARY KEY (field_id,lang_id,option_id), CHECK (field_id>=0), CHECK (lang_id>=0), CHECK (option_id>=0) ); + /* Table: phpbb_profile_lang */ CREATE TABLE phpbb_profile_lang ( - field_id INT4 DEFAULT '0' NOT NULL, - lang_id INT2 DEFAULT '0' NOT NULL, - lang_name varchar(255) DEFAULT '' NOT NULL, - lang_explain TEXT DEFAULT '' NOT NULL, - lang_DEFAULT_value varchar(255) DEFAULT '' NOT NULL, - PRIMARY KEY (field_id,lang_id), + field_id INT4 DEFAULT '0' NOT NULL, + lang_id INT2 DEFAULT '0' NOT NULL, + lang_name varchar(255) DEFAULT '' NOT NULL, + lang_explain TEXT, + lang_default_value varchar(255) DEFAULT '' NOT NULL, + PRIMARY KEY (field_id,lang_id), CHECK (field_id>=0), CHECK (lang_id>=0) ); + /* Table: phpbb_ranks */ -CREATE SEQUENCE phpbb_ranks_rank_id_seq; +CREATE SEQUENCE phpbb_ranks_seq; CREATE TABLE phpbb_ranks ( - rank_id INT2 DEFAULT nextval('phpbb_ranks_rank_id_seq'), - rank_title varchar(50) NOT NULL, - rank_min INT4 DEFAULT '0' NOT NULL, - rank_special INT2 DEFAULT '0', - rank_image varchar(100), - PRIMARY KEY (rank_id) + rank_id INT2 DEFAULT nextval('phpbb_ranks_seq'), + rank_title varchar(255) NOT NULL, + rank_min INT4 DEFAULT '0' NOT NULL, + rank_special INT2 DEFAULT '0', + rank_image varchar(255), + PRIMARY KEY (rank_id) ); -SELECT SETVAL('phpbb_ranks_rank_id_seq',(select case when max(rank_id)>0 then max(rank_id)+1 else 1 end from phpbb_ranks)); +SELECT SETVAL('phpbb_ranks_seq',(select case when max(rank_id)>0 then max(rank_id)+1 else 1 end from phpbb_ranks)); + /* Table: phpbb_reports_reasons */ -CREATE SEQUENCE phpbb_reports_reasons_reason; +CREATE SEQUENCE phpbb_reports_reasons_seq; CREATE TABLE phpbb_reports_reasons ( - reason_id INT2 DEFAULT nextval('phpbb_reports_reasons_reason'), + reason_id INT2 DEFAULT nextval('phpbb_reports_reasons_seq'), reason_title varchar(255) DEFAULT '' NOT NULL, - reason_description TEXT DEFAULT '' NOT NULL, + reason_description TEXT, reason_order INT2 DEFAULT '0' NOT NULL, PRIMARY KEY (reason_id) ); -SELECT SETVAL('phpbb_reports_reasons_reason',(select case when max(reason_id)>0 then max(reason_id)+1 else 1 end from phpbb_reports_reasons)); +SELECT SETVAL('phpbb_reports_reasons_seq',(select case when max(reason_id)>0 then max(reason_id)+1 else 1 end from phpbb_reports_reasons)); + /* Table: phpbb_reports */ -CREATE SEQUENCE phpbb_reports_report_id_seq; +CREATE SEQUENCE phpbb_reports_seq; CREATE TABLE phpbb_reports ( - report_id INT2 DEFAULT nextval('phpbb_reports_report_id_seq'), + report_id INT2 DEFAULT nextval('phpbb_reports_seq'), reason_id INT2 DEFAULT '0' NOT NULL, post_id INT4 DEFAULT '0' NOT NULL, user_id INT4 DEFAULT '0' NOT NULL, user_notify INT2 DEFAULT '0' NOT NULL, report_closed INT2 DEFAULT '0' NOT NULL, report_time INT4 DEFAULT '0' NOT NULL, - report_text TEXT DEFAULT '' NOT NULL, + report_text TEXT, PRIMARY KEY (report_id), CHECK (reason_id>=0), CHECK (post_id>=0), @@ -782,31 +822,34 @@ CREATE TABLE phpbb_reports ( CHECK (report_time>=0) ); -SELECT SETVAL('phpbb_reports_report_id_seq',(select case when max(report_id)>0 then max(report_id)+1 else 1 end from phpbb_reports)); +SELECT SETVAL('phpbb_reports_seq',(select case when max(report_id)>0 then max(report_id)+1 else 1 end from phpbb_reports)); + /* Table: phpbb_search_results */ CREATE TABLE phpbb_search_results ( search_key varchar(32) DEFAULT '' NOT NULL, search_time INT4 DEFAULT '0' NOT NULL, - search_keywords TEXT DEFAULT '' NOT NULL, - search_authors TEXT DEFAULT '' NOT NULL, + search_keywords TEXT, + search_authors TEXT, PRIMARY KEY (search_key) ); + /* Table: phpbb_search_wordlist */ -CREATE SEQUENCE phpbb_search_wordlist_word_i; +CREATE SEQUENCE phpbb_search_wordlist_seq; CREATE TABLE phpbb_search_wordlist ( + word_id INT4 DEFAULT nextval('phpbb_search_wordlist_seq'), word_text varchar(50) DEFAULT '' NOT NULL, - word_id INT4 DEFAULT nextval('phpbb_search_wordlist_word_i'), word_common INT2 DEFAULT '0' NOT NULL, PRIMARY KEY (word_text), CHECK (word_common>=0) ); -CREATE INDEX word_id_phpbb_search_wordlist_index ON phpbb_search_wordlist (word_id); +CREATE INDEX phpbb_search_wordlist_word_id ON phpbb_search_wordlist (word_id); + +SELECT SETVAL('phpbb_search_wordlist_seq',(select case when max(word_id)>0 then max(word_id)+1 else 1 end from phpbb_search_wordlist)); -SELECT SETVAL('phpbb_search_wordlist_word_i',(select case when max(word_id)>0 then max(word_id)+1 else 1 end from phpbb_search_wordlist)); /* Table: phpbb_search_wordmatch */ CREATE TABLE phpbb_search_wordmatch ( @@ -815,27 +858,29 @@ CREATE TABLE phpbb_search_wordmatch ( title_match INT2 DEFAULT '0' NOT NULL ); -CREATE INDEX word_id_phpbb_search_wordmatch_index ON phpbb_search_wordmatch (word_id); +CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id); + /* Table: phpbb_sessions */ CREATE TABLE phpbb_sessions ( - session_id varchar(32) DEFAULT '' NOT NULL, - session_user_id INT4 DEFAULT '0' NOT NULL, - session_last_visit INT4 DEFAULT '0' NOT NULL, - session_start INT4 DEFAULT '0' NOT NULL, - session_time INT4 DEFAULT '0' NOT NULL, - session_ip varchar(40) DEFAULT '0' NOT NULL, - session_browser varchar(150) DEFAULT '' NULL, - session_page varchar(200) DEFAULT '' NOT NULL, - session_viewonline INT2 DEFAULT '1' NOT NULL, - session_autologin INT2 DEFAULT '0' NOT NULL, - session_admin INT2 DEFAULT '0' NOT NULL, - PRIMARY KEY (session_id), + session_id varchar(32) DEFAULT '' NOT NULL, + session_user_id INT4 DEFAULT '0' NOT NULL, + session_last_visit INT4 DEFAULT '0' NOT NULL, + session_start INT4 DEFAULT '0' NOT NULL, + session_time INT4 DEFAULT '0' NOT NULL, + session_ip varchar(40) DEFAULT '0' NOT NULL, + session_browser varchar(150) DEFAULT '' NULL, + session_page varchar(200) DEFAULT '' NOT NULL, + session_viewonline INT2 DEFAULT '1' NOT NULL, + session_autologin INT2 DEFAULT '0' NOT NULL, + session_admin INT2 DEFAULT '0' NOT NULL, + PRIMARY KEY (session_id), CHECK (session_user_id>=0) ); -CREATE INDEX session_time_phpbb_sessions_index ON phpbb_sessions (session_time); -CREATE INDEX session_user_id_phpbb_sessions_index ON phpbb_sessions (session_user_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); + /* Table: phpbb_sessions_keys */ CREATE TABLE phpbb_sessions_keys ( @@ -846,117 +891,123 @@ CREATE TABLE phpbb_sessions_keys ( PRIMARY KEY (key_id,user_id) ); -CREATE INDEX last_login_phpbb_sessions_keys_index ON phpbb_sessions_keys (last_login); +CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login); + /* Table: phpbb_sitelist */ -CREATE SEQUENCE phpbb_sitelist_site_id_seq; +CREATE SEQUENCE phpbb_sitelist_seq; CREATE TABLE phpbb_sitelist ( - site_id INT4 DEFAULT nextval('phpbb_sitelist_site_id_seq'), - site_ip varchar(40) DEFAULT '' NOT NULL, - site_hostname varchar(255) DEFAULT '' NOT NULL, - ip_exclude INT2 DEFAULT '0' NOT NULL, - PRIMARY KEY (site_id) + 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, + PRIMARY KEY (site_id) ); -SELECT SETVAL('phpbb_sitelist_site_id_seq',(select case when max(site_id)>0 then max(site_id)+1 else 1 end from phpbb_sitelist)); +SELECT SETVAL('phpbb_sitelist_seq',(select case when max(site_id)>0 then max(site_id)+1 else 1 end from phpbb_sitelist)); + /* Table: phpbb_smilies */ -CREATE SEQUENCE phpbb_smilies_smiley_id_seq; +CREATE SEQUENCE phpbb_smilies_seq; CREATE TABLE phpbb_smilies ( - smiley_id INT2 DEFAULT nextval('phpbb_smilies_smiley_id_seq'), - code varchar(10), - emotion varchar(50), - smiley_url varchar(50), - smiley_width INT2 NOT NULL, - smiley_height INT2 NOT NULL, - smiley_order INT2 NOT NULL, - display_on_posting INT2 DEFAULT '1' NOT NULL, - PRIMARY KEY (smiley_id), + smiley_id INT2 DEFAULT nextval('phpbb_smilies_seq'), + code varchar(10), + emotion varchar(50), + smiley_url varchar(50), + smiley_width INT2 NOT NULL, + smiley_height INT2 NOT NULL, + smiley_order INT2 NOT NULL, + display_on_posting INT2 DEFAULT '1' NOT NULL, + PRIMARY KEY (smiley_id), CHECK (smiley_width>=0), CHECK (smiley_height>=0), CHECK (smiley_order>=0), CHECK (display_on_posting>=0) ); -SELECT SETVAL('phpbb_smilies_smiley_id_seq',(select case when max(smiley_id)>0 then max(smiley_id)+1 else 1 end from phpbb_smilies)); +SELECT SETVAL('phpbb_smilies_seq',(select case when max(smiley_id)>0 then max(smiley_id)+1 else 1 end from phpbb_smilies)); + /* Table: phpbb_styles */ -CREATE SEQUENCE phpbb_styles_style_id_seq; +CREATE SEQUENCE phpbb_styles_seq; CREATE TABLE phpbb_styles ( - style_id INT2 DEFAULT nextval('phpbb_styles_style_id_seq'), - style_name varchar(30) DEFAULT '' NOT NULL, - style_copyright varchar(50) DEFAULT '' NOT NULL, - style_active INT2 DEFAULT '1' NOT NULL, - template_id INT2 NOT NULL, - theme_id INT2 NOT NULL, - imageset_id INT2 NOT NULL, - PRIMARY KEY (style_id), - + style_id INT2 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, + template_id INT2 NOT NULL, + theme_id INT2 NOT NULL, + imageset_id INT2 NOT NULL, + PRIMARY KEY (style_id), CHECK (template_id>=0), CHECK (theme_id>=0), CHECK (imageset_id>=0) ); -CREATE UNIQUE INDEX style_name_phpbb_styles_index ON phpbb_styles (style_name); +CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name); + +SELECT SETVAL('phpbb_styles_seq',(select case when max(style_id)>0 then max(style_id)+1 else 1 end from phpbb_styles)); -SELECT SETVAL('phpbb_styles_style_id_seq',(select case when max(style_id)>0 then max(style_id)+1 else 1 end from phpbb_styles)); /* Table: phpbb_styles_template */ -CREATE SEQUENCE phpbb_styles_template_templa; +CREATE SEQUENCE phpbb_styles_template_seq; CREATE TABLE phpbb_styles_template ( - template_id INT2 DEFAULT nextval('phpbb_styles_template_templa'), - template_name varchar(30) NOT NULL, - template_copyright varchar(50) NOT NULL, - template_path varchar(30) NOT NULL, - bbcode_bitfield INT4 DEFAULT '0' NOT NULL, - template_storedb INT2 DEFAULT '0' NOT NULL, - PRIMARY KEY (template_id), + template_id INT2 DEFAULT nextval('phpbb_styles_template_seq'), + template_name varchar(255) NOT NULL, + template_copyright varchar(255) NOT NULL, + template_path varchar(100) NOT NULL, + bbcode_bitfield INT4 DEFAULT '0' NOT NULL, + template_storedb INT2 DEFAULT '0' NOT NULL, + PRIMARY KEY (template_id), CHECK (bbcode_bitfield>=0) ); -CREATE UNIQUE INDEX template_name_phpbb_styles_template_index ON phpbb_styles_template (template_name); +CREATE UNIQUE INDEX phpbb_styles_template_template_name ON phpbb_styles_template (template_name); + +SELECT SETVAL('phpbb_styles_template_seq',(select case when max(template_id)>0 then max(template_id)+1 else 1 end from phpbb_styles_template)); -SELECT SETVAL('phpbb_styles_template_templa',(select case when max(template_id)>0 then max(template_id)+1 else 1 end from phpbb_styles_template)); /* Table: phpbb_styles_template_data */ CREATE TABLE phpbb_styles_template_data ( - template_id INT2 NOT NULL, - template_filename varchar(50) DEFAULT '' NOT NULL, - template_included TEXT DEFAULT '' NOT NULL, - template_mtime INT4 DEFAULT '0' NOT NULL, - template_data text + template_id INT2 NOT NULL, + template_filename varchar(100) DEFAULT '' NOT NULL, + template_included TEXT, + template_mtime INT4 DEFAULT '0' NOT NULL, + template_data TEXT ); + /* Table: phpbb_styles_theme */ -CREATE SEQUENCE phpbb_styles_theme_theme_id_; +CREATE SEQUENCE phpbb_styles_theme_seq; CREATE TABLE phpbb_styles_theme ( - theme_id INT2 DEFAULT nextval('phpbb_styles_theme_theme_id_'), - theme_name varchar(30) DEFAULT '' NOT NULL, - theme_copyright varchar(50) DEFAULT '' NOT NULL, - theme_path varchar(30) DEFAULT '' NOT NULL, - theme_storedb INT2 DEFAULT '0' NOT NULL, - theme_mtime INT4 DEFAULT '0' NOT NULL, - theme_data text DEFAULT '' NOT NULL, - PRIMARY KEY (theme_id) + theme_id INT2 DEFAULT nextval('phpbb_styles_theme_seq'), + theme_name varchar(255) DEFAULT '' NOT NULL, + theme_copyright varchar(255) DEFAULT '' NOT NULL, + theme_path varchar(100) DEFAULT '' NOT NULL, + theme_storedb INT2 DEFAULT '0' NOT NULL, + theme_mtime INT4 DEFAULT '0' NOT NULL, + theme_data TEXT, + PRIMARY KEY (theme_id) ); -CREATE UNIQUE INDEX theme_name_phpbb_styles_theme_index ON phpbb_styles_theme (theme_name); +CREATE UNIQUE INDEX phpbb_styles_theme_theme_name ON phpbb_styles_theme (theme_name); + +SELECT SETVAL('phpbb_styles_theme_seq',(select case when max(theme_id)>0 then max(theme_id)+1 else 1 end from phpbb_styles_theme)); -SELECT SETVAL('phpbb_styles_theme_theme_id_',(select case when max(theme_id)>0 then max(theme_id)+1 else 1 end from phpbb_styles_theme)); /* Table: phpbb_styles_imageset */ -CREATE SEQUENCE phpbb_styles_imageset_images; +CREATE SEQUENCE phpbb_styles_imageset_seq; CREATE TABLE phpbb_styles_imageset ( - imageset_id INT2 DEFAULT nextval('phpbb_styles_imageset_images'), - imageset_name varchar(30) DEFAULT '' NOT NULL, - imageset_copyright varchar(50) DEFAULT '' NOT NULL, - imageset_path varchar(30) DEFAULT '' NOT NULL, + imageset_id INT2 DEFAULT nextval('phpbb_styles_imageset_seq'), + imageset_name varchar(255) DEFAULT '' NOT NULL, + imageset_copyright varchar(255) DEFAULT '' NOT NULL, + imageset_path varchar(100) DEFAULT '' NOT NULL, site_logo varchar(200) DEFAULT '' NOT NULL, btn_post varchar(200) DEFAULT '' NOT NULL, btn_post_pm varchar(200) DEFAULT '' NOT NULL, @@ -1037,46 +1088,47 @@ CREATE TABLE phpbb_styles_imageset ( PRIMARY KEY (imageset_id) ); -CREATE UNIQUE INDEX imageset_name_phpbb_styles_imageset_index ON phpbb_styles_imageset (imageset_name); +CREATE UNIQUE INDEX phpbb_styles_imageset_imageset_name ON phpbb_styles_imageset (imageset_name); + +SELECT SETVAL('phpbb_styles_imageset_seq',(select case when max(imageset_id)>0 then max(imageset_id)+1 else 1 end from phpbb_styles_imageset)); -SELECT SETVAL('phpbb_styles_imageset_images',(select case when max(imageset_id)>0 then max(imageset_id)+1 else 1 end from phpbb_styles_imageset)); /* Table: phpbb_topics */ -CREATE SEQUENCE phpbb_topics_topic_id_seq; +CREATE SEQUENCE phpbb_topics_seq; CREATE TABLE phpbb_topics ( - topic_id INT4 DEFAULT nextval('phpbb_topics_topic_id_seq'), - forum_id INT2 DEFAULT '0' NOT NULL, - icon_id INT2 DEFAULT '1' NOT NULL, - topic_attachment INT2 DEFAULT '0' NOT NULL, - topic_approved INT2 DEFAULT '1' NOT NULL, - topic_reported INT2 DEFAULT '0' NOT NULL, - topic_title varchar(60) NOT NULL, - topic_poster INT4 DEFAULT '0' NOT NULL, - topic_time INT4 DEFAULT '0' NOT NULL, - topic_time_limit INT4 DEFAULT '0' NOT NULL, - topic_views INT4 DEFAULT '0' NOT NULL, - topic_replies INT4 DEFAULT '0' NOT NULL, - topic_replies_real INT4 DEFAULT '0' NOT NULL, - topic_status INT2 DEFAULT '0' NOT NULL, - topic_type INT2 DEFAULT '0' NOT NULL, - topic_first_post_id INT4 DEFAULT '0' NOT NULL, - topic_first_poster_name varchar(30), - topic_last_post_id INT4 DEFAULT '0' NOT NULL, - topic_last_poster_id INT4 DEFAULT '0' NOT NULL, - topic_last_poster_name varchar(30), - topic_last_post_time INT4 DEFAULT '0' NOT NULL, - topic_last_view_time INT4 DEFAULT '0' NOT NULL, - topic_moved_id INT4 DEFAULT '0' NOT NULL, - topic_bumped INT2 DEFAULT '0' NOT NULL, - topic_bumper INT4 DEFAULT '0' NOT NULL, - poll_title varchar(255) DEFAULT '' NOT NULL, - poll_start INT4 DEFAULT '0' NOT NULL, - poll_length INT4 DEFAULT '0' NOT NULL, - poll_max_options INT2 DEFAULT '1' NOT NULL, - poll_last_vote INT4 DEFAULT '0', - poll_vote_change INT2 DEFAULT '0' NOT NULL, - PRIMARY KEY (topic_id), + topic_id INT4 DEFAULT nextval('phpbb_topics_seq'), + forum_id INT2 DEFAULT '0' NOT NULL, + icon_id INT2 DEFAULT '1' NOT NULL, + topic_attachment INT2 DEFAULT '0' NOT NULL, + topic_approved INT2 DEFAULT '1' NOT NULL, + topic_reported INT2 DEFAULT '0' NOT NULL, + topic_title TEXT, + topic_poster INT4 DEFAULT '0' NOT NULL, + topic_time INT4 DEFAULT '0' NOT NULL, + topic_time_limit INT4 DEFAULT '0' NOT NULL, + topic_views INT4 DEFAULT '0' NOT NULL, + topic_replies INT4 DEFAULT '0' NOT NULL, + topic_replies_real INT4 DEFAULT '0' NOT NULL, + topic_status INT2 DEFAULT '0' NOT NULL, + topic_type INT2 DEFAULT '0' NOT NULL, + topic_first_post_id INT4 DEFAULT '0' NOT NULL, + topic_first_poster_name varchar(255), + topic_last_post_id INT4 DEFAULT '0' NOT NULL, + topic_last_poster_id INT4 DEFAULT '0' NOT NULL, + topic_last_poster_name varchar(255), + topic_last_post_time INT4 DEFAULT '0' NOT NULL, + topic_last_view_time INT4 DEFAULT '0' NOT NULL, + topic_moved_id INT4 DEFAULT '0' NOT NULL, + topic_bumped INT2 DEFAULT '0' NOT NULL, + topic_bumper INT4 DEFAULT '0' NOT NULL, + poll_title TEXT, + poll_start INT4 DEFAULT '0' NOT NULL, + poll_length INT4 DEFAULT '0' NOT NULL, + poll_max_options INT2 DEFAULT '1' NOT NULL, + poll_last_vote INT4 DEFAULT '0', + poll_vote_change INT2 DEFAULT '0' NOT NULL, + PRIMARY KEY (topic_id), CHECK (forum_id>=0), CHECK (icon_id>=0), CHECK (topic_approved>=0), @@ -1098,36 +1150,39 @@ CREATE TABLE phpbb_topics ( CHECK (poll_vote_change>=0) ); -CREATE INDEX forum_id_phpbb_topics_index ON phpbb_topics (forum_id); -CREATE INDEX forum_id_type_phpbb_topics_index ON phpbb_topics (forum_id, topic_type); -CREATE INDEX topic_last_post_time_phpbb_topics_index ON phpbb_topics (topic_last_post_time); +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_topic_last_post_time ON phpbb_topics (topic_last_post_time); + +SELECT SETVAL('phpbb_topics_seq',(select case when max(topic_id)>0 then max(topic_id)+1 else 1 end from phpbb_topics)); -SELECT SETVAL('phpbb_topics_topic_id_seq',(select case when max(topic_id)>0 then max(topic_id)+1 else 1 end from phpbb_topics)); /* Table: phpbb_topics_marking */ CREATE TABLE phpbb_topics_marking ( - user_id INT4 DEFAULT '0' NOT NULL, - topic_id INT4 DEFAULT '0' NOT NULL, - forum_id INT4 DEFAULT '0' NOT NULL, - mark_time INT4 DEFAULT '0' NOT NULL, - PRIMARY KEY (user_id,topic_id), + user_id INT4 DEFAULT '0' NOT NULL, + topic_id INT4 DEFAULT '0' NOT NULL, + forum_id INT4 DEFAULT '0' NOT NULL, + mark_time INT4 DEFAULT '0' NOT NULL, + PRIMARY KEY (user_id,topic_id), CHECK (user_id>=0), CHECK (topic_id>=0), CHECK (forum_id>=0) ); -CREATE INDEX forum_id_phpbb_topics_marking_index ON phpbb_topics_marking (forum_id); +CREATE INDEX phpbb_topics_marking_forum_id ON phpbb_topics_marking (forum_id); + /* Table: phpbb_topics_posted */ CREATE TABLE phpbb_topics_posted ( - user_id INT4 DEFAULT '0' NOT NULL, - topic_id INT4 DEFAULT '0' NOT NULL, - topic_posted INT2 DEFAULT '0' NOT NULL, - PRIMARY KEY (user_id,topic_id), + user_id INT4 DEFAULT '0' NOT NULL, + topic_id INT4 DEFAULT '0' NOT NULL, + topic_posted INT2 DEFAULT '0' NOT NULL, + PRIMARY KEY (user_id,topic_id), CHECK (user_id>=0), CHECK (topic_id>=0) ); + /* Table: phpbb_topics_watch */ CREATE TABLE phpbb_topics_watch ( topic_id INT4 DEFAULT '0' NOT NULL, @@ -1135,96 +1190,96 @@ CREATE TABLE phpbb_topics_watch ( notify_status INT2 DEFAULT '0' NOT NULL ); -CREATE INDEX topic_id_phpbb_topics_watch_index ON phpbb_topics_watch (topic_id); -CREATE INDEX user_id_phpbb_topics_watch_index ON phpbb_topics_watch (user_id); -CREATE INDEX notify_status_phpbb_topics_watch_index ON phpbb_topics_watch (notify_status); +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_status ON phpbb_topics_watch (notify_status); + /* Table: phpbb_user_group */ CREATE TABLE phpbb_user_group ( - group_id INT4 DEFAULT '0' NOT NULL, - user_id INT4 DEFAULT '0' NOT NULL, - group_leader INT2 DEFAULT '0' NOT NULL, - user_pending INT2 + group_id INT4 DEFAULT '0' NOT NULL, + user_id INT4 DEFAULT '0' NOT NULL, + group_leader INT2 DEFAULT '0' NOT NULL, + user_pending INT2 ); -CREATE INDEX group_id_phpbb_user_group_index ON phpbb_user_group (group_id); -CREATE INDEX user_id_phpbb_user_group_index ON phpbb_user_group (user_id); -CREATE INDEX group_leader_phpbb_user_group_index ON phpbb_user_group (group_leader); +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_user_id_seq; +CREATE SEQUENCE phpbb_users_seq; CREATE TABLE phpbb_users ( - user_id INT4 DEFAULT nextval('phpbb_users_user_id_seq'), - user_type INT2 DEFAULT '0' NOT NULL, - group_id INT4 DEFAULT '3' NOT NULL, - user_permissions text DEFAULT '' NOT NULL, - user_ip varchar(40) DEFAULT '' NOT NULL, - user_regdate INT4 DEFAULT '0' NOT NULL, - username varchar(30) DEFAULT '' NOT NULL, - user_password varchar(32) DEFAULT '' NOT NULL, - user_passchg INT4 DEFAULT '0' NOT NULL, - user_email varchar(60) 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, - user_lastmark INT4 DEFAULT '0' NOT NULL, - user_lastpost_time INT4 DEFAULT '0' NOT NULL, - user_lastpage varchar(200) DEFAULT '' NOT NULL, - user_last_confirm_key varchar(10) DEFAULT '' NOT NULL, - user_warnings INT2 DEFAULT '0' NOT NULL, - user_last_warning INT4 DEFAULT '0' NOT NULL, - user_login_attempts INT4 DEFAULT '0' NOT NULL, - user_posts INT4 DEFAULT '0' NOT NULL, - user_lang varchar(30) DEFAULT '' NOT NULL, - user_timezone decimal(5,2) DEFAULT '0.0' NOT NULL, - user_dst INT2 DEFAULT '0' NOT NULL, - user_dateformat varchar(30) DEFAULT 'd M Y H:i' NOT NULL, - user_style INT2 DEFAULT '0' NOT NULL, - user_rank INT4 DEFAULT '0', - user_colour varchar(6) DEFAULT '' NOT NULL, - user_new_privmsg INT2 DEFAULT '0' NOT NULL, - user_unread_privmsg INT2 DEFAULT '0' NOT NULL, - user_last_privmsg INT4 DEFAULT '0' NOT NULL, - user_message_rules INT2 DEFAULT '0' NOT NULL, - user_full_folder INT4 DEFAULT '-3' NOT NULL, - user_emailtime INT4 DEFAULT '0' NOT NULL, - user_sortby_type varchar(1) DEFAULT '' NOT NULL, - user_sortby_dir varchar(1) DEFAULT '' NOT NULL, - user_topic_show_days INT4 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 INT4 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 INT2 DEFAULT '0' NOT NULL, - user_notify_pm INT2 DEFAULT '1' NOT NULL, - user_notify_type INT2 DEFAULT '0' NOT NULL, - user_allow_pm INT2 DEFAULT '1' NOT NULL, - user_allow_email INT2 DEFAULT '1' NOT NULL, - user_allow_viewonline INT2 DEFAULT '1' NOT NULL, - user_allow_viewemail INT2 DEFAULT '1' NOT NULL, - user_allow_massemail INT2 DEFAULT '1' NOT NULL, - user_options INT4 DEFAULT '893' NOT NULL, - user_avatar varchar(100) DEFAULT '' NOT NULL, - user_avatar_type INT2 DEFAULT '0' NOT NULL, - user_avatar_width INT2 DEFAULT '0' NOT NULL, - user_avatar_height INT2 DEFAULT '0' NOT NULL, - user_sig text DEFAULT '' NOT NULL, - user_sig_bbcode_uid varchar(5) DEFAULT '' NOT NULL, - user_sig_bbcode_bitfield INT4 DEFAULT '0' NOT NULL, - user_from varchar(100) DEFAULT '' NOT NULL, - user_icq varchar(15) DEFAULT '' NOT NULL, - user_aim varchar(255) DEFAULT '' NOT NULL, - user_yim varchar(255) DEFAULT '' NOT NULL, - user_msnm varchar(255) DEFAULT '' NOT NULL, - user_jabber varchar(255) DEFAULT '' NOT NULL, - user_website varchar(100) DEFAULT '' NOT NULL, - user_occ varchar(255) DEFAULT '' NOT NULL, - user_interests varchar(255) DEFAULT '' NOT NULL, - user_actkey varchar(32) DEFAULT '' NOT NULL, - user_newpasswd varchar(32) DEFAULT '' NOT NULL, - PRIMARY KEY (user_id), + user_id INT4 DEFAULT nextval('phpbb_users_seq'), + user_type INT2 DEFAULT '0' NOT NULL, + group_id INT4 DEFAULT '3' NOT NULL, + user_permissions TEXT, + user_ip varchar(40) DEFAULT '' NOT NULL, + user_regdate INT4 DEFAULT '0' NOT NULL, + username varchar(255) DEFAULT '' NOT NULL, + user_password varchar(40) DEFAULT '' NOT NULL, + user_passchg INT4 DEFAULT '0' 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, + user_lastmark INT4 DEFAULT '0' NOT NULL, + user_lastpost_time INT4 DEFAULT '0' NOT NULL, + user_lastpage varchar(200) DEFAULT '' NOT NULL, + user_last_confirm_key varchar(10) DEFAULT '' NOT NULL, + user_warnings INT2 DEFAULT '0' NOT NULL, + user_last_warning INT4 DEFAULT '0' NOT NULL, + user_login_attempts INT4 DEFAULT '0' NOT NULL, + user_posts INT4 DEFAULT '0' NOT NULL, + user_lang varchar(30) DEFAULT '' NOT NULL, + user_timezone decimal(5,2) DEFAULT '0.0' NOT NULL, + user_dst INT2 DEFAULT '0' NOT NULL, + user_dateformat varchar(30) DEFAULT 'd M Y H:i' NOT NULL, + user_style INT2 DEFAULT '0' NOT NULL, + user_rank INT4 DEFAULT '0', + user_colour varchar(6) DEFAULT '' NOT NULL, + user_new_privmsg INT2 DEFAULT '0' NOT NULL, + user_unread_privmsg INT2 DEFAULT '0' NOT NULL, + user_last_privmsg INT4 DEFAULT '0' NOT NULL, + user_message_rules INT2 DEFAULT '0' NOT NULL, + user_full_folder INT4 DEFAULT '-3' NOT NULL, + user_emailtime INT4 DEFAULT '0' NOT NULL, + user_topic_show_days INT4 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 INT4 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 INT2 DEFAULT '0' NOT NULL, + user_notify_pm INT2 DEFAULT '1' NOT NULL, + user_notify_type INT2 DEFAULT '0' NOT NULL, + user_allow_pm INT2 DEFAULT '1' NOT NULL, + user_allow_email INT2 DEFAULT '1' NOT NULL, + user_allow_viewonline INT2 DEFAULT '1' NOT NULL, + user_allow_viewemail INT2 DEFAULT '1' NOT NULL, + user_allow_massemail INT2 DEFAULT '1' NOT NULL, + user_options INT4 DEFAULT '893' NOT NULL, + user_avatar varchar(255) DEFAULT '' NOT NULL, + user_avatar_type INT2 DEFAULT '0' NOT NULL, + user_avatar_width INT2 DEFAULT '0' NOT NULL, + user_avatar_height INT2 DEFAULT '0' NOT NULL, + user_sig TEXT, + user_sig_bbcode_uid varchar(5) DEFAULT '' NOT NULL, + user_sig_bbcode_bitfield INT4 DEFAULT '0' NOT NULL, + user_from varchar(100) DEFAULT '' NOT NULL, + user_icq varchar(15) DEFAULT '' NOT NULL, + user_aim varchar(255) DEFAULT '' NOT NULL, + user_yim varchar(255) DEFAULT '' NOT NULL, + user_msnm varchar(255) DEFAULT '' NOT NULL, + user_jabber varchar(255) DEFAULT '' NOT NULL, + user_website varchar(200) DEFAULT '' NOT NULL, + user_occ varchar(255) DEFAULT '' NOT NULL, + user_interests varchar(255) DEFAULT '' NOT NULL, + user_actkey varchar(32) DEFAULT '' NOT NULL, + user_newpasswd varchar(32) DEFAULT '' NOT NULL, + PRIMARY KEY (user_id), CHECK (user_posts>=0), CHECK (user_new_privmsg>=0), CHECK (user_unread_privmsg>=0), @@ -1233,35 +1288,40 @@ CREATE TABLE phpbb_users ( CHECK (user_avatar_height>=0) ); -CREATE INDEX user_birthday_phpbb_users_index ON phpbb_users (user_birthday); -CREATE INDEX user_email_hash_phpbb_users_index ON phpbb_users (user_email_hash); -CREATE INDEX username_phpbb_users_index ON phpbb_users (username); +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_username ON phpbb_users (username); + +SELECT SETVAL('phpbb_users_seq',(select case when max(user_id)>0 then max(user_id)+1 else 1 end from phpbb_users)); -SELECT SETVAL('phpbb_users_user_id_seq',(select case when max(user_id)>0 then max(user_id)+1 else 1 end from phpbb_users)); /* Table: phpbb_warnings */ -CREATE SEQUENCE phpbb_warnings_warning_id_seq; +CREATE SEQUENCE phpbb_warnings_seq; CREATE TABLE phpbb_warnings ( - warning_id INT4 DEFAULT nextval('phpbb_warnings_warning_id_seq'), - user_id INT4 DEFAULT '0' NOT NULL, - post_id INT4 DEFAULT '0' NOT NULL, - log_id INT4 DEFAULT '0' NOT NULL, - warning_time INT4 DEFAULT '0' NOT NULL, - PRIMARY KEY (warning_id) + warning_id INT4 DEFAULT nextval('phpbb_warnings_seq'), + user_id INT4 DEFAULT '0' NOT NULL, + post_id INT4 DEFAULT '0' NOT NULL, + log_id INT4 DEFAULT '0' NOT NULL, + warning_time INT4 DEFAULT '0' NOT NULL, + PRIMARY KEY (warning_id) ); +SELECT SETVAL('phpbb_warnings_seq',(select case when max(warning_id)>0 then max(warning_id)+1 else 1 end from phpbb_warnings)); + + /* Table: phpbb_words */ -CREATE SEQUENCE phpbb_words_word_id_seq; +CREATE SEQUENCE phpbb_words_seq; CREATE TABLE phpbb_words ( - word_id INT4 DEFAULT nextval('phpbb_words_word_id_seq'), - word varchar(100) NOT NULL, - replacement varchar(100) NOT NULL, - PRIMARY KEY (word_id) + word_id INT4 DEFAULT nextval('phpbb_words_seq'), + word varchar(100) NOT NULL, + replacement varchar(100) NOT NULL, + PRIMARY KEY (word_id) ); -SELECT SETVAL('phpbb_words_word_id_seq',(select case when max(word_id)>0 then max(word_id)+1 else 1 end from phpbb_words)); +SELECT SETVAL('phpbb_words_seq',(select case when max(word_id)>0 then max(word_id)+1 else 1 end from phpbb_words)); + /* Table: phpbb_zebra */ CREATE TABLE phpbb_zebra ( @@ -1271,7 +1331,7 @@ CREATE TABLE phpbb_zebra ( foe INT2 DEFAULT '0' NOT NULL ); -CREATE INDEX user_id_phpbb_zebra_index ON phpbb_zebra (user_id); -CREATE INDEX zebra_id_phpbb_zebra_index ON phpbb_zebra (zebra_id); +CREATE INDEX phpbb_zebra_user_id ON phpbb_zebra (user_id); +CREATE INDEX phpbb_zebra_zebra_id ON phpbb_zebra (zebra_id); COMMIT; diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 2bfdc2c08f..6fd9cbc8e0 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -678,7 +678,7 @@ INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) # -- Moderator cache -INSERT INTO phpbb_moderator_cache (user_id, forum_id, username, groupname) VALUES (2, 2, 'Admin', 'Administrators'); +INSERT INTO phpbb_moderator_cache (user_id, forum_id, username, group_name) VALUES (2, 2, 'Admin', 'Administrators'); # MSSQL IDENTITY phpbb_topics ON # diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 12bae7bcb4..0df2b54a35 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -16,7 +16,7 @@ CREATE TABLE phpbb_attachments ( physical_filename varchar(255) NOT NULL, real_filename varchar(255) NOT NULL, download_count mediumint(8) NOT NULL DEFAULT '0', - comment varchar(255), + comment text(65535), extension varchar(100), mimetype varchar(100), filesize int(20) NOT NULL, @@ -24,12 +24,13 @@ CREATE TABLE phpbb_attachments ( thumbnail tinyint(1) NOT NULL DEFAULT '0' ); -CREATE INDEX filetime_phpbb_attachments on phpbb_attachments (filetime); -CREATE INDEX post_msg_id_phpbb_attachments on phpbb_attachments (post_msg_id); -CREATE INDEX topic_id_phpbb_attachments on phpbb_attachments (topic_id); -CREATE INDEX poster_id_phpbb_attachments on phpbb_attachments (poster_id); -CREATE INDEX physical_filename_phpbb_attach on phpbb_attachments (physical_filename); -CREATE INDEX filesize_phpbb_attachments on phpbb_attachments (filesize); +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_physical_filename on phpbb_attachments (physical_filename); +CREATE INDEX phpbb_attachments_filesize on phpbb_attachments (filesize); + # Table: phpbb_auth_groups CREATE TABLE phpbb_auth_groups ( @@ -40,19 +41,21 @@ CREATE TABLE phpbb_auth_groups ( auth_setting tinyint(4) NOT NULL DEFAULT '0' ); -CREATE INDEX group_id_phpbb_auth_groups on phpbb_auth_groups (group_id); -CREATE INDEX auth_option_id_phpbb_auth_grou on phpbb_auth_groups (auth_option_id); +CREATE INDEX phpbb_auth_groups_group_id on phpbb_auth_groups (group_id); +CREATE INDEX phpbb_auth_groups_auth_option_id on phpbb_auth_groups (auth_option_id); + # Table: phpbb_auth_options CREATE TABLE phpbb_auth_options ( auth_option_id INTEGER PRIMARY KEY NOT NULL, - auth_option char(20) NOT NULL, + auth_option varchar(20) NOT NULL, is_global tinyint(1) NOT NULL DEFAULT '0', is_local tinyint(1) NOT NULL DEFAULT '0', founder_only tinyint(1) NOT NULL DEFAULT '0' ); -CREATE INDEX auth_option_phpbb_auth_options on phpbb_auth_options (auth_option); +CREATE INDEX phpbb_auth_options_auth_option on phpbb_auth_options (auth_option); + # Table: phpbb_auth_roles CREATE TABLE phpbb_auth_roles ( @@ -62,7 +65,8 @@ CREATE TABLE phpbb_auth_roles ( role_group_ids varchar(255) NOT NULL DEFAULT '' ); -CREATE INDEX role_type_phpbb_auth_roles on phpbb_auth_roles (role_type); +CREATE INDEX phpbb_auth_roles_role_type on phpbb_auth_roles (role_type); + # Table: phpbb_auth_roles_data CREATE TABLE phpbb_auth_roles_data ( @@ -72,6 +76,7 @@ CREATE TABLE phpbb_auth_roles_data ( PRIMARY KEY (role_id, auth_option_id) ); + # Table: phpbb_auth_users CREATE TABLE phpbb_auth_users ( user_id mediumint(8) NOT NULL DEFAULT '0', @@ -81,36 +86,39 @@ CREATE TABLE phpbb_auth_users ( auth_setting tinyint(4) NOT NULL DEFAULT '0' ); -CREATE INDEX user_id_phpbb_auth_users on phpbb_auth_users (user_id); -CREATE INDEX auth_option_id_phpbb_auth_user on phpbb_auth_users (auth_option_id); +CREATE INDEX phpbb_auth_users_user_id on phpbb_auth_users (user_id); +CREATE INDEX phpbb_auth_users_auth_option_id on phpbb_auth_users (auth_option_id); + # Table: phpbb_banlist CREATE TABLE phpbb_banlist ( ban_id INTEGER PRIMARY KEY NOT NULL, ban_userid mediumint(8) NOT NULL DEFAULT '0', ban_ip varchar(40) NOT NULL DEFAULT '', - ban_email varchar(50) NOT NULL DEFAULT '', + ban_email varchar(100) NOT NULL DEFAULT '', ban_start int(11) NOT NULL DEFAULT '0', ban_end int(11) NOT NULL DEFAULT '0', ban_exclude tinyint(1) NOT NULL DEFAULT '0', - ban_reason varchar(255) NOT NULL DEFAULT '', - ban_give_reason varchar(255) NOT NULL DEFAULT '' + ban_reason text(65535), + ban_give_reason text(65535) ); + # Table: phpbb_bbcodes CREATE TABLE phpbb_bbcodes ( bbcode_id INTEGER PRIMARY KEY NOT NULL DEFAULT '0', bbcode_tag varchar(16) NOT NULL DEFAULT '', display_on_posting tinyint(1) NOT NULL DEFAULT '0', bbcode_match varchar(255) NOT NULL DEFAULT '', - bbcode_tpl text(65535) NOT NULL DEFAULT '', + bbcode_tpl text(65535), first_pass_match varchar(255) NOT NULL DEFAULT '', first_pass_replace varchar(255) NOT NULL DEFAULT '', second_pass_match varchar(255) NOT NULL DEFAULT '', - second_pass_replace text(65535) NOT NULL DEFAULT '' + second_pass_replace text(65535) ); -CREATE INDEX display_on_posting_phpbb_bbcodes on phpbb_bbcodes (display_on_posting); +CREATE INDEX phpbb_bbcodes_display_on_posting on phpbb_bbcodes (display_on_posting); + # Table: phpbb_bookmarks CREATE TABLE phpbb_bookmarks ( @@ -119,29 +127,32 @@ CREATE TABLE phpbb_bookmarks ( order_id mediumint(8) NOT NULL DEFAULT '0' ); -CREATE INDEX order_id_phpbb_bookmarks on phpbb_bookmarks (order_id); -CREATE INDEX topic_user_id_phpbb_bookmarks on phpbb_bookmarks (topic_id, user_id); +CREATE INDEX phpbb_bookmarks_order_id on phpbb_bookmarks (order_id); +CREATE INDEX phpbb_bookmarks_topic_user_id on phpbb_bookmarks (topic_id, user_id); + # Table: phpbb_bots CREATE TABLE phpbb_bots ( bot_id INTEGER PRIMARY KEY NOT NULL, bot_active tinyint(1) NOT NULL DEFAULT '1', - bot_name varchar(255) NOT NULL DEFAULT '', + bot_name text(65535), user_id mediumint(8) NOT NULL DEFAULT '0', bot_agent varchar(255) NOT NULL DEFAULT '', bot_ip varchar(255) NOT NULL DEFAULT '' ); -CREATE INDEX bot_active_phpbb_bots on phpbb_bots (bot_active); +CREATE INDEX phpbb_bots_bot_active on phpbb_bots (bot_active); + # Table: phpbb_cache CREATE TABLE phpbb_cache ( var_name varchar(255) NOT NULL DEFAULT '', var_expires int(10) NOT NULL DEFAULT '0', - var_data mediumtext(16777215) NOT NULL, + var_data mediumtext(16777215), PRIMARY KEY (var_name) ); + # Table: phpbb_config CREATE TABLE phpbb_config ( config_name varchar(255) NOT NULL, @@ -150,23 +161,26 @@ CREATE TABLE phpbb_config ( PRIMARY KEY (config_name) ); -CREATE INDEX is_dynamic_phpbb_config on phpbb_config (is_dynamic); +CREATE INDEX phpbb_config_is_dynamic on phpbb_config (is_dynamic); + # Table: phpbb_confirm CREATE TABLE phpbb_confirm ( confirm_id char(32) NOT NULL DEFAULT '', session_id char(32) NOT NULL DEFAULT '', confirm_type INTEGER NOT NULL DEFAULT '0', - code char(8) NOT NULL DEFAULT '', + code varchar(8) NOT NULL DEFAULT '', PRIMARY KEY (session_id, confirm_id) ); + # Table: phpbb_disallow CREATE TABLE phpbb_disallow ( disallow_id INTEGER PRIMARY KEY NOT NULL, - disallow_username varchar(30) NOT NULL DEFAULT '' + disallow_username varchar(255) NOT NULL DEFAULT '' ); + # Table: phpbb_drafts CREATE TABLE phpbb_drafts ( draft_id INTEGER PRIMARY KEY NOT NULL, @@ -174,11 +188,12 @@ CREATE TABLE phpbb_drafts ( topic_id mediumint(8) NOT NULL DEFAULT '0', forum_id mediumint(8) NOT NULL DEFAULT '0', save_time int(11) NOT NULL DEFAULT '0', - draft_subject varchar(60), - draft_message mediumtext(16777215) NOT NULL DEFAULT '' + draft_subject text(65535), + draft_message mediumtext(16777215) ); -CREATE INDEX save_time_phpbb_drafts on phpbb_drafts (save_time); +CREATE INDEX phpbb_drafts_save_time on phpbb_drafts (save_time); + # Table: phpbb_extensions CREATE TABLE phpbb_extensions ( @@ -187,19 +202,21 @@ CREATE TABLE phpbb_extensions ( extension varchar(100) NOT NULL DEFAULT '' ); + # Table: phpbb_extension_groups CREATE TABLE phpbb_extension_groups ( group_id INTEGER PRIMARY KEY NOT NULL, - group_name char(20) NOT NULL, + group_name varchar(255) NOT NULL, cat_id tinyint(2) NOT NULL DEFAULT '0', allow_group tinyint(1) NOT NULL DEFAULT '0', download_mode tinyint(1) NOT NULL DEFAULT '1', - upload_icon varchar(100) NOT NULL DEFAULT '', + upload_icon varchar(255) NOT NULL DEFAULT '', max_filesize int(20) NOT NULL DEFAULT '0', - allowed_forums text(65535) NOT NULL, + allowed_forums text(65535), allow_in_pm tinyint(1) NOT NULL DEFAULT '0' ); + # Table: phpbb_forums CREATE TABLE phpbb_forums ( forum_id INTEGER PRIMARY KEY NOT NULL, @@ -207,16 +224,16 @@ CREATE TABLE phpbb_forums ( left_id smallint(5) NOT NULL, right_id smallint(5) NOT NULL, forum_parents text(65535), - forum_name varchar(150) NOT NULL, + forum_name text(65535), forum_desc text(65535), forum_desc_bitfield int(11) NOT NULL DEFAULT '0', forum_desc_uid varchar(5) NOT NULL DEFAULT '', - forum_link varchar(200) NOT NULL DEFAULT '', - forum_password varchar(32) NOT NULL DEFAULT '', + forum_link varchar(255) NOT NULL DEFAULT '', + forum_password varchar(40) NOT NULL DEFAULT '', forum_style tinyint(4), - forum_image varchar(50) NOT NULL DEFAULT '', - forum_rules text(65535) NOT NULL DEFAULT '', - forum_rules_link varchar(200) NOT NULL DEFAULT '', + forum_image varchar(255) NOT NULL DEFAULT '', + forum_rules text(65535), + forum_rules_link varchar(255) NOT NULL DEFAULT '', forum_rules_bitfield int(11) NOT NULL DEFAULT '0', forum_rules_uid varchar(5) NOT NULL DEFAULT '', forum_topics_per_page tinyint(4) NOT NULL DEFAULT '0', @@ -228,7 +245,7 @@ CREATE TABLE phpbb_forums ( forum_last_post_id mediumint(8) NOT NULL DEFAULT '0', forum_last_poster_id mediumint(8) NOT NULL DEFAULT '0', forum_last_post_time int(11) NOT NULL DEFAULT '0', - forum_last_poster_name varchar(30), + forum_last_poster_name varchar(255), forum_flags tinyint(4) NOT NULL DEFAULT '0', display_on_index tinyint(1) NOT NULL DEFAULT '1', enable_indexing tinyint(1) NOT NULL DEFAULT '1', @@ -240,17 +257,19 @@ CREATE TABLE phpbb_forums ( prune_freq tinyint(4) NOT NULL DEFAULT '0' ); -CREATE INDEX left_right_id_phpbb_forums on phpbb_forums (left_id, right_id); -CREATE INDEX forum_last_post_id_phpbb_forum on phpbb_forums (forum_last_post_id); +CREATE INDEX phpbb_forums_left_right_id on phpbb_forums (left_id, right_id); +CREATE INDEX phpbb_forums_forum_last_post_id on phpbb_forums (forum_last_post_id); + # Table: phpbb_forum_access CREATE TABLE phpbb_forum_access ( forum_id mediumint(8) NOT NULL DEFAULT '0', user_id mediumint(8) NOT NULL DEFAULT '0', - session_id char(32) NOT NULL DEFAULT '', + session_id varchar(32) NOT NULL DEFAULT '', PRIMARY KEY (forum_id, user_id, session_id) ); + # Table: phpbb_forums_marking CREATE TABLE phpbb_forums_marking ( user_id mediumint(9) NOT NULL DEFAULT '0', @@ -259,6 +278,7 @@ CREATE TABLE phpbb_forums_marking ( PRIMARY KEY (user_id, forum_id) ); + # Table: phpbb_forums_watch CREATE TABLE phpbb_forums_watch ( forum_id smallint(5) NOT NULL DEFAULT '0', @@ -266,20 +286,21 @@ CREATE TABLE phpbb_forums_watch ( notify_status tinyint(1) NOT NULL DEFAULT '0' ); -CREATE INDEX forum_id_phpbb_forums_watch on phpbb_forums_watch (forum_id); -CREATE INDEX user_id_phpbb_forums_watch on phpbb_forums_watch (user_id); -CREATE INDEX notify_status_phpbb_forums_wat on phpbb_forums_watch (notify_status); +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_status 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_name varchar(40) NOT NULL DEFAULT '', + group_name varchar(255) NOT NULL, group_desc text(65535), group_desc_bitfield int(11) NOT NULL DEFAULT '0', group_desc_uid varchar(5) NOT NULL DEFAULT '', group_display tinyint(1) NOT NULL DEFAULT '0', - group_avatar varchar(100) NOT NULL DEFAULT '', + group_avatar varchar(255) NOT NULL DEFAULT '', group_avatar_type tinyint(4) NOT NULL DEFAULT '0', group_avatar_width tinyint(4) NOT NULL DEFAULT '0', group_avatar_height tinyint(4) NOT NULL DEFAULT '0', @@ -292,28 +313,31 @@ CREATE TABLE phpbb_groups ( group_legend tinyint(1) NOT NULL DEFAULT '1' ); -CREATE INDEX group_legend_phpbb_groups on phpbb_groups (group_legend); +CREATE INDEX phpbb_groups_group_legend on phpbb_groups (group_legend); + # Table: phpbb_icons CREATE TABLE phpbb_icons ( icons_id INTEGER PRIMARY KEY NOT NULL, - icons_url varchar(50), + icons_url varchar(255), icons_width tinyint(4) NOT NULL, icons_height tinyint(4) NOT NULL, icons_order tinyint(4) NOT NULL, display_on_posting tinyint(1) NOT NULL DEFAULT '1' ); + # Table: phpbb_lang CREATE TABLE phpbb_lang ( lang_id INTEGER PRIMARY KEY NOT NULL, lang_iso varchar(5) NOT NULL, lang_dir varchar(30) NOT NULL, - lang_english_name varchar(30), - lang_local_name varchar(100), - lang_author varchar(100) + lang_english_name varchar(100), + lang_local_name varchar(255), + lang_author varchar(255) ); + # Table: phpbb_log CREATE TABLE phpbb_log ( log_id INTEGER PRIMARY KEY NOT NULL, @@ -328,53 +352,57 @@ CREATE TABLE phpbb_log ( log_data text(65535) ); -CREATE INDEX log_type_phpbb_log on phpbb_log (log_type); -CREATE INDEX forum_id_phpbb_log on phpbb_log (forum_id); -CREATE INDEX topic_id_phpbb_log on phpbb_log (topic_id); -CREATE INDEX reportee_id_phpbb_log on phpbb_log (reportee_id); -CREATE INDEX user_id_phpbb_log on phpbb_log (user_id); +CREATE INDEX phpbb_log_log_type on phpbb_log (log_type); +CREATE INDEX phpbb_log_forum_id on phpbb_log (forum_id); +CREATE INDEX phpbb_log_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_moderator_cache CREATE TABLE phpbb_moderator_cache ( forum_id mediumint(8) NOT NULL, user_id mediumint(8) NOT NULL DEFAULT '0', - username char(30) NOT NULL DEFAULT '', + username varchar(255) NOT NULL DEFAULT '', group_id mediumint(8) NOT NULL DEFAULT '0', - groupname char(30) NOT NULL DEFAULT '', + group_name varchar(255) NOT NULL DEFAULT '', display_on_index tinyint(1) NOT NULL DEFAULT '1' ); -CREATE INDEX display_on_index_phpbb_moderat on phpbb_moderator_cache (display_on_index); -CREATE INDEX forum_id_phpbb_moderator_cache on phpbb_moderator_cache (forum_id); +CREATE INDEX phpbb_moderator_cache_display_on_index on phpbb_moderator_cache (display_on_index); +CREATE INDEX phpbb_moderator_cache_forum_id on phpbb_moderator_cache (forum_id); + # Table: phpbb_modules CREATE TABLE phpbb_modules ( module_id INTEGER PRIMARY KEY NOT NULL, module_enabled tinyint(1) NOT NULL DEFAULT '1', module_display tinyint(1) NOT NULL DEFAULT '1', - module_name varchar(20) NOT NULL DEFAULT '', - module_class varchar(4) NOT NULL DEFAULT '', - parent_id smallint(5) NOT NULL DEFAULT '0', - left_id smallint(5) NOT NULL DEFAULT '0', - right_id smallint(5) NOT NULL DEFAULT '0', - module_langname varchar(50) NOT NULL DEFAULT '', + module_name varchar(255) NOT NULL DEFAULT '', + module_class varchar(10) NOT NULL DEFAULT '', + parent_id mediumint(8) NOT NULL DEFAULT '0', + left_id mediumint(8) NOT NULL DEFAULT '0', + right_id mediumint(8) 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 module_enabled_phpbb_modules on phpbb_modules (module_enabled); -CREATE INDEX left_id_phpbb_modules on phpbb_modules (left_id); +CREATE INDEX phpbb_modules_module_enabled on phpbb_modules (module_enabled); +CREATE INDEX phpbb_modules_left_right_id on phpbb_modules (left_id, right_id); + # Table: phpbb_poll_results CREATE TABLE phpbb_poll_results ( poll_option_id tinyint(4) NOT NULL DEFAULT '0', topic_id mediumint(8) NOT NULL, - poll_option_text varchar(255) NOT NULL, + poll_option_text text(65535), poll_option_total mediumint(8) NOT NULL DEFAULT '0' ); -CREATE INDEX poll_option_id_phpbb_poll_resu on phpbb_poll_results (poll_option_id); -CREATE INDEX topic_id_phpbb_poll_results on phpbb_poll_results (topic_id); +CREATE INDEX phpbb_poll_results_poll_option_id on phpbb_poll_results (poll_option_id); +CREATE INDEX phpbb_poll_results_topic_id on phpbb_poll_results (topic_id); + # Table: phpbb_poll_voters CREATE TABLE phpbb_poll_voters ( @@ -384,9 +412,10 @@ CREATE TABLE phpbb_poll_voters ( vote_user_ip varchar(40) NOT NULL ); -CREATE INDEX topic_id_phpbb_poll_voters on phpbb_poll_voters (topic_id); -CREATE INDEX vote_user_id_phpbb_poll_voters on phpbb_poll_voters (vote_user_id); -CREATE INDEX vote_user_ip_phpbb_poll_voters on phpbb_poll_voters (vote_user_ip); +CREATE INDEX phpbb_poll_voters_topic_id on phpbb_poll_voters (topic_id); +CREATE INDEX phpbb_poll_voters_vote_user_id on phpbb_poll_voters (vote_user_id); +CREATE INDEX phpbb_poll_voters_vote_user_ip on phpbb_poll_voters (vote_user_ip); + # Table: phpbb_posts CREATE TABLE phpbb_posts ( @@ -403,8 +432,8 @@ CREATE TABLE phpbb_posts ( enable_smilies tinyint(1) NOT NULL DEFAULT '1', enable_magic_url tinyint(1) NOT NULL DEFAULT '1', enable_sig tinyint(1) NOT NULL DEFAULT '1', - post_username varchar(30), - post_subject varchar(60), + post_username varchar(255), + post_subject text(65535), post_text mediumtext(16777215), post_checksum varchar(32) NOT NULL, post_encoding varchar(20) NOT NULL DEFAULT 'iso-8859-1', @@ -412,18 +441,19 @@ CREATE TABLE phpbb_posts ( bbcode_bitfield int(11) NOT NULL DEFAULT '0', bbcode_uid varchar(5) NOT NULL DEFAULT '', post_edit_time int(11) NOT NULL DEFAULT '0', - post_edit_reason varchar(100), + post_edit_reason text(65535), post_edit_user mediumint(8) NOT NULL DEFAULT '0', post_edit_count smallint(5) NOT NULL DEFAULT '0', post_edit_locked tinyint(1) NOT NULL DEFAULT '0' ); -CREATE INDEX forum_id_phpbb_posts on phpbb_posts (forum_id); -CREATE INDEX topic_id_phpbb_posts on phpbb_posts (topic_id); -CREATE INDEX poster_ip_phpbb_posts on phpbb_posts (poster_ip); -CREATE INDEX poster_id_phpbb_posts on phpbb_posts (poster_id); -CREATE INDEX post_approved_phpbb_posts on phpbb_posts (post_approved); -CREATE INDEX post_time_phpbb_posts on phpbb_posts (post_time); +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_approved on phpbb_posts (post_approved); +CREATE INDEX phpbb_posts_post_time on phpbb_posts (post_time); + # Table: phpbb_privmsgs CREATE TABLE phpbb_privmsgs ( @@ -437,9 +467,9 @@ CREATE TABLE phpbb_privmsgs ( enable_smilies tinyint(1) NOT NULL DEFAULT '1', enable_magic_url tinyint(1) NOT NULL DEFAULT '1', enable_sig tinyint(1) NOT NULL DEFAULT '1', - message_subject varchar(60), + message_subject text(65535), message_text mediumtext(16777215), - message_edit_reason varchar(100), + message_edit_reason text(65535), message_edit_user mediumint(8) NOT NULL DEFAULT '0', message_encoding varchar(20) NOT NULL DEFAULT 'iso-8859-1', message_attachment tinyint(1) NOT NULL DEFAULT '0', @@ -451,20 +481,22 @@ CREATE TABLE phpbb_privmsgs ( bcc_address text(65535) ); -CREATE INDEX author_ip_phpbb_privmsgs on phpbb_privmsgs (author_ip); -CREATE INDEX message_time_phpbb_privmsgs on phpbb_privmsgs (message_time); -CREATE INDEX author_id_phpbb_privmsgs on phpbb_privmsgs (author_id); -CREATE INDEX root_level_phpbb_privmsgs on phpbb_privmsgs (root_level); +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 mediumint(8) NOT NULL DEFAULT '0', - folder_name varchar(40) NOT NULL DEFAULT '', + folder_name varchar(255) NOT NULL DEFAULT '', pm_count mediumint(8) NOT NULL DEFAULT '0' ); -CREATE INDEX user_id_phpbb_privmsgs_folder on phpbb_privmsgs_folder (user_id); +CREATE INDEX phpbb_privmsgs_folder_user_id on phpbb_privmsgs_folder (user_id); + # Table: phpbb_privmsgs_rules CREATE TABLE phpbb_privmsgs_rules ( @@ -479,6 +511,7 @@ CREATE TABLE phpbb_privmsgs_rules ( rule_folder_id mediumint(8) NOT NULL DEFAULT '0' ); + # Table: phpbb_privmsgs_to CREATE TABLE phpbb_privmsgs_to ( msg_id mediumint(8) NOT NULL DEFAULT '0', @@ -493,14 +526,15 @@ CREATE TABLE phpbb_privmsgs_to ( folder_id int(10) NOT NULL DEFAULT '0' ); -CREATE INDEX msg_id_phpbb_privmsgs_to on phpbb_privmsgs_to (msg_id); -CREATE INDEX user_id_phpbb_privmsgs_to on phpbb_privmsgs_to (user_id, folder_id); +CREATE INDEX phpbb_privmsgs_to_msg_id on phpbb_privmsgs_to (msg_id); +CREATE INDEX phpbb_privmsgs_to_user_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(50) NOT NULL DEFAULT '', - field_desc varchar(255) NOT NULL DEFAULT '', + field_name varchar(255) NOT NULL DEFAULT '', + field_desc text(65535), field_type mediumint(8) NOT NULL, field_ident varchar(20) NOT NULL DEFAULT '', field_length varchar(20) NOT NULL DEFAULT '', @@ -517,14 +551,16 @@ CREATE TABLE phpbb_profile_fields ( field_order tinyint(4) NOT NULL DEFAULT '0' ); -CREATE INDEX field_type_phpbb_profile_field on phpbb_profile_fields (field_type); -CREATE INDEX field_order_phpbb_profile_fiel on phpbb_profile_fields (field_order); +CREATE INDEX phpbb_profile_fields_field_type on phpbb_profile_fields (field_type); +CREATE INDEX phpbb_profile_fields_field_order on phpbb_profile_fields (field_order); + # Table: phpbb_profile_fields_data CREATE TABLE phpbb_profile_fields_data ( user_id INTEGER PRIMARY KEY NOT NULL DEFAULT '0' ); + # Table: phpbb_profile_fields_lang CREATE TABLE phpbb_profile_fields_lang ( field_id mediumint(8) NOT NULL DEFAULT '0', @@ -535,33 +571,37 @@ CREATE TABLE phpbb_profile_fields_lang ( PRIMARY KEY (field_id, lang_id, option_id) ); + # Table: phpbb_profile_lang CREATE TABLE phpbb_profile_lang ( field_id mediumint(8) NOT NULL DEFAULT '0', lang_id tinyint(4) NOT NULL DEFAULT '0', lang_name varchar(255) NOT NULL DEFAULT '', - lang_explain text(65535) NOT NULL, + lang_explain text(65535), 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(50) NOT NULL, + rank_title varchar(255) NOT NULL, rank_min mediumint(8) NOT NULL DEFAULT '0', rank_special tinyint(1) DEFAULT '0', - rank_image varchar(100) + rank_image varchar(255) ); + # 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 text(65535) NOT NULL, + reason_description text(65535), reason_order tinyint(4) NOT NULL DEFAULT '0' ); + # Table: phpbb_reports CREATE TABLE phpbb_reports ( report_id INTEGER PRIMARY KEY NOT NULL, @@ -571,18 +611,20 @@ CREATE TABLE phpbb_reports ( user_notify tinyint(1) NOT NULL DEFAULT '0', report_closed tinyint(1) NOT NULL DEFAULT '0', report_time int(10) NOT NULL DEFAULT '0', - report_text text(65535) NOT NULL + report_text mediumtext(16777215) ); + # Table: phpbb_search_results CREATE TABLE phpbb_search_results ( search_key varchar(32) NOT NULL DEFAULT '', search_time int(11) NOT NULL DEFAULT '0', - search_keywords mediumtext(16777215) NOT NULL, - search_authors mediumtext(16777215) NOT NULL, + search_keywords mediumtext(16777215), + search_authors mediumtext(16777215), PRIMARY KEY (search_key) ); + # Table: phpbb_search_wordlist CREATE TABLE phpbb_search_wordlist ( word_text varchar(50) NOT NULL DEFAULT '', @@ -591,7 +633,8 @@ CREATE TABLE phpbb_search_wordlist ( PRIMARY KEY (word_text) ); -CREATE INDEX word_id_phpbb_search_wordlist on phpbb_search_wordlist (word_id); +CREATE INDEX phpbb_search_wordlist_word_id on phpbb_search_wordlist (word_id); + # Table: phpbb_search_wordmatch CREATE TABLE phpbb_search_wordmatch ( @@ -600,7 +643,8 @@ CREATE TABLE phpbb_search_wordmatch ( title_match tinyint(1) NOT NULL DEFAULT '0' ); -CREATE INDEX word_id_phpbb_search_wordmatch on phpbb_search_wordmatch (word_id); +CREATE INDEX phpbb_search_wordmatch_word_id on phpbb_search_wordmatch (word_id); + # Table: phpbb_sessions CREATE TABLE phpbb_sessions ( @@ -618,8 +662,9 @@ CREATE TABLE phpbb_sessions ( PRIMARY KEY (session_id) ); -CREATE INDEX session_time_phpbb_sessions on phpbb_sessions (session_time); -CREATE INDEX session_user_id_phpbb_sessions on phpbb_sessions (session_user_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); + # Table: phpbb_sessions_keys CREATE TABLE phpbb_sessions_keys ( @@ -630,7 +675,8 @@ CREATE TABLE phpbb_sessions_keys ( PRIMARY KEY (key_id,user_id) ); -CREATE INDEX last_login_phpbb_sessions_keys on phpbb_sessions_keys (last_login); +CREATE INDEX phpbb_sessions_keys_last_login on phpbb_sessions_keys (last_login); + # Table: phpbb_sitelist CREATE TABLE phpbb_sitelist ( @@ -640,77 +686,83 @@ CREATE TABLE phpbb_sitelist ( ip_exclude tinyint(1) NOT NULL DEFAULT '0' ); + # Table: phpbb_smilies CREATE TABLE phpbb_smilies ( smiley_id INTEGER PRIMARY KEY NOT NULL, - code char(10), - emotion char(50), - smiley_url char(50), + code varchar(10), + emotion varchar(50), + smiley_url varchar(50), smiley_width tinyint(4) NOT NULL, smiley_height tinyint(4) NOT NULL, smiley_order tinyint(4) NOT NULL, display_on_posting tinyint(1) NOT NULL DEFAULT '1' ); + # Table: phpbb_styles CREATE TABLE phpbb_styles ( style_id INTEGER PRIMARY KEY NOT NULL, - style_name varchar(30) NOT NULL DEFAULT '', - style_copyright varchar(50) NOT NULL DEFAULT '', + style_name varchar(255) NOT NULL DEFAULT '', + style_copyright varchar(255) NOT NULL DEFAULT '', style_active tinyint(1) NOT NULL DEFAULT '1', template_id tinyint(4) NOT NULL, theme_id tinyint(4) NOT NULL, imageset_id tinyint(4) NOT NULL ); -CREATE INDEX B_phpbb_styles on phpbb_styles (template_id); -CREATE INDEX C_phpbb_styles on phpbb_styles (theme_id); -CREATE INDEX D_phpbb_styles on phpbb_styles (imageset_id); -CREATE UNIQUE INDEX style_name_phpbb_styles on phpbb_styles (style_name); +CREATE INDEX phpbb_styles_template_id on phpbb_styles (template_id); +CREATE INDEX phpbb_styles_theme_id on phpbb_styles (theme_id); +CREATE INDEX phpbb_styles_imageset_id on phpbb_styles (imageset_id); +CREATE UNIQUE INDEX phpbb_styles_style_name on phpbb_styles (style_name); + # Table: phpbb_styles_template CREATE TABLE phpbb_styles_template ( template_id INTEGER PRIMARY KEY NOT NULL, - template_name varchar(30) NOT NULL, - template_copyright varchar(50) NOT NULL, - template_path varchar(30) NOT NULL, + template_name varchar(255) NOT NULL, + template_copyright varchar(255) NOT NULL, + template_path varchar(100) NOT NULL, bbcode_bitfield int(11) NOT NULL DEFAULT '0', template_storedb tinyint(1) NOT NULL DEFAULT '0' ); -CREATE UNIQUE INDEX template_name_phpbb_styles_tem on phpbb_styles_template (template_name); +CREATE UNIQUE INDEX phpbb_styles_template_template_name on phpbb_styles_template (template_name); + # Table: phpbb_styles_template_data CREATE TABLE phpbb_styles_template_data ( template_id tinyint(4) NOT NULL, - template_filename varchar(50) NOT NULL DEFAULT '', - template_included text(65535) NOT NULL, + template_filename varchar(100) NOT NULL DEFAULT '', + template_included text(65535), template_mtime int(11) NOT NULL DEFAULT '0', template_data mediumtext(16777215) ); -CREATE INDEX B_phpbb_styles_template_data on phpbb_styles_template_data (template_id); -CREATE INDEX C_phpbb_styles_template_data on phpbb_styles_template_data (template_filename); +CREATE INDEX phpbb_styles_template_data_template_id on phpbb_styles_template_data (template_id); +CREATE INDEX phpbb_styles_template_data_template_filename on phpbb_styles_template_data (template_filename); + # Table: phpbb_styles_theme CREATE TABLE phpbb_styles_theme ( theme_id INTEGER PRIMARY KEY NOT NULL, - theme_name varchar(30) NOT NULL DEFAULT '', - theme_copyright varchar(50) NOT NULL DEFAULT '', - theme_path varchar(30) NOT NULL DEFAULT '', + theme_name varchar(255) NOT NULL DEFAULT '', + theme_copyright varchar(255) NOT NULL DEFAULT '', + theme_path varchar(100) NOT NULL DEFAULT '', theme_storedb tinyint(1) NOT NULL DEFAULT '0', theme_mtime int(11) NOT NULL DEFAULT '0', - theme_data mediumtext(16777215) NOT NULL DEFAULT '' + theme_data mediumtext(16777215) ); -CREATE UNIQUE INDEX theme_name_phpbb_styles_theme on phpbb_styles_theme (theme_name); +CREATE UNIQUE INDEX phpbb_styles_theme_theme_name on phpbb_styles_theme (theme_name); + # Table: phpbb_styles_imageset CREATE TABLE phpbb_styles_imageset ( imageset_id INTEGER PRIMARY KEY NOT NULL, - imageset_name varchar(30) NOT NULL DEFAULT '', - imageset_copyright varchar(50) NOT NULL DEFAULT '', - imageset_path varchar(30) NOT NULL DEFAULT '', + imageset_name varchar(255) NOT NULL DEFAULT '', + imageset_copyright varchar(255) NOT NULL DEFAULT '', + imageset_path varchar(100) NOT NULL DEFAULT '', site_logo varchar(200) NOT NULL DEFAULT '', btn_post varchar(200) NOT NULL DEFAULT '', btn_post_pm varchar(200) NOT NULL DEFAULT '', @@ -790,17 +842,18 @@ CREATE TABLE phpbb_styles_imageset ( user_icon10 varchar(200) NOT NULL DEFAULT '' ); -CREATE UNIQUE INDEX imageset_name_phpbb_styles_ima on phpbb_styles_imageset (imageset_name); +CREATE UNIQUE INDEX phpbb_styles_imageset_imageset_name on phpbb_styles_imageset (imageset_name); + # Table: phpbb_topics CREATE TABLE phpbb_topics ( topic_id INTEGER PRIMARY KEY NOT NULL, - forum_id smallint(8) NOT NULL DEFAULT '0', + forum_id smallint(5) NOT NULL DEFAULT '0', icon_id tinyint(4) NOT NULL DEFAULT '1', topic_attachment tinyint(1) NOT NULL DEFAULT '0', topic_approved tinyint(1) NOT NULL DEFAULT '1', topic_reported tinyint(1) NOT NULL DEFAULT '0', - topic_title varchar(60) NOT NULL, + topic_title text(65535), topic_poster mediumint(8) NOT NULL DEFAULT '0', topic_time int(11) NOT NULL DEFAULT '0', topic_time_limit int(11) NOT NULL DEFAULT '0', @@ -810,16 +863,16 @@ CREATE TABLE phpbb_topics ( topic_status tinyint(3) NOT NULL DEFAULT '0', topic_type tinyint(3) NOT NULL DEFAULT '0', topic_first_post_id mediumint(8) NOT NULL DEFAULT '0', - topic_first_poster_name varchar(30), + topic_first_poster_name varchar(255), topic_last_post_id mediumint(8) NOT NULL DEFAULT '0', topic_last_poster_id mediumint(8) NOT NULL DEFAULT '0', - topic_last_poster_name varchar(30), + topic_last_poster_name varchar(255), topic_last_post_time int(11) NOT NULL DEFAULT '0', topic_last_view_time int(11) NOT NULL DEFAULT '0', topic_moved_id mediumint(8) NOT NULL DEFAULT '0', topic_bumped tinyint(1) NOT NULL DEFAULT '0', topic_bumper mediumint(8) NOT NULL DEFAULT '0', - poll_title varchar(255) NOT NULL DEFAULT '', + poll_title text(65535), poll_start int(11) NOT NULL DEFAULT '0', poll_length int(11) NOT NULL DEFAULT '0', poll_max_options tinyint(4) NOT NULL DEFAULT '1', @@ -827,9 +880,10 @@ CREATE TABLE phpbb_topics ( poll_vote_change tinyint(1) NOT NULL DEFAULT '0' ); -CREATE INDEX forum_id_phpbb_topics on phpbb_topics (forum_id); -CREATE INDEX forum_id_type_phpbb_topics on phpbb_topics (forum_id, topic_type); -CREATE INDEX topic_last_post_time_phpbb_top on phpbb_topics (topic_last_post_time); +CREATE INDEX phpbb_topics_forum_id on phpbb_topics (forum_id); +CREATE INDEX phpbb_topics_forum_topic_type on phpbb_topics (forum_id, topic_type); +CREATE INDEX phpbb_topics_topic_last_post_time on phpbb_topics (topic_last_post_time); + # Table: phpbb_topics_marking CREATE TABLE phpbb_topics_marking ( @@ -840,6 +894,7 @@ CREATE TABLE phpbb_topics_marking ( PRIMARY KEY (user_id, topic_id) ); + # Table: phpbb_topics_posted CREATE TABLE phpbb_topics_posted ( user_id mediumint(8) NOT NULL DEFAULT '0', @@ -848,6 +903,7 @@ CREATE TABLE phpbb_topics_posted ( PRIMARY KEY (user_id, topic_id) ); + # Table: phpbb_topics_watch CREATE TABLE phpbb_topics_watch ( topic_id mediumint(8) NOT NULL DEFAULT '0', @@ -855,9 +911,10 @@ CREATE TABLE phpbb_topics_watch ( notify_status tinyint(1) NOT NULL DEFAULT '0' ); -CREATE INDEX topic_id_phpbb_topics_watch on phpbb_topics_watch (topic_id); -CREATE INDEX user_id_phpbb_topics_watch on phpbb_topics_watch (user_id); -CREATE INDEX notify_status_phpbb_topics_wat on phpbb_topics_watch (notify_status); +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_status on phpbb_topics_watch (notify_status); + # Table: phpbb_user_group CREATE TABLE phpbb_user_group ( @@ -867,22 +924,23 @@ CREATE TABLE phpbb_user_group ( user_pending tinyint(1) ); -CREATE INDEX group_id_phpbb_user_group on phpbb_user_group (group_id); -CREATE INDEX user_id_phpbb_user_group on phpbb_user_group (user_id); -CREATE INDEX group_leader_phpbb_user_group on phpbb_user_group (group_leader); +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(1) NOT NULL DEFAULT '0', group_id mediumint(8) NOT NULL DEFAULT '3', - user_permissions text(65535) NOT NULL DEFAULT '', + user_permissions text(65535), user_ip varchar(40) NOT NULL DEFAULT '', user_regdate int(11) NOT NULL DEFAULT '0', - username varchar(30) NOT NULL DEFAULT '', - user_password varchar(32) NOT NULL DEFAULT '', + username varchar(255) NOT NULL DEFAULT '', + user_password varchar(40) NOT NULL DEFAULT '', user_passchg int(11) NOT NULL DEFAULT '0', - user_email varchar(60) 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 int(11) NOT NULL DEFAULT '0', @@ -922,11 +980,11 @@ CREATE TABLE phpbb_users ( user_allow_viewemail tinyint(1) NOT NULL DEFAULT '1', user_allow_massemail tinyint(1) NOT NULL DEFAULT '1', user_options int(11) NOT NULL DEFAULT '893', - user_avatar varchar(100) NOT NULL DEFAULT '', + user_avatar varchar(255) NOT NULL DEFAULT '', user_avatar_type tinyint(2) NOT NULL DEFAULT '0', user_avatar_width tinyint(4) NOT NULL DEFAULT '0', user_avatar_height tinyint(4) NOT NULL DEFAULT '0', - user_sig text(65535) NOT NULL DEFAULT '', + user_sig text(65535), user_sig_bbcode_uid varchar(5) NOT NULL DEFAULT '', user_sig_bbcode_bitfield int(11) NOT NULL DEFAULT '0', user_from varchar(100) NOT NULL DEFAULT '', @@ -935,16 +993,17 @@ CREATE TABLE phpbb_users ( user_yim varchar(255) NOT NULL DEFAULT '', user_msnm varchar(255) NOT NULL DEFAULT '', user_jabber varchar(255) NOT NULL DEFAULT '', - user_website varchar(100) NOT NULL DEFAULT '', + user_website varchar(200) NOT NULL DEFAULT '', user_occ varchar(255) NOT NULL DEFAULT '', user_interests varchar(255) NOT NULL DEFAULT '', user_actkey varchar(32) NOT NULL DEFAULT '', user_newpasswd varchar(32) NOT NULL DEFAULT '' ); -CREATE INDEX user_birthday_phpbb_users on phpbb_users (user_birthday); -CREATE INDEX user_email_hash_phpbb_users on phpbb_users (user_email_hash); -CREATE INDEX username_phpbb_users on phpbb_users (username); +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_username on phpbb_users (username); + # Table: phpbb_warnings CREATE TABLE phpbb_warnings ( @@ -955,6 +1014,7 @@ CREATE TABLE phpbb_warnings ( warning_time int(11) NOT NULL DEFAULT '0' ); + # Table: phpbb_words CREATE TABLE phpbb_words ( word_id INTEGER PRIMARY KEY NOT NULL, @@ -962,6 +1022,7 @@ CREATE TABLE phpbb_words ( replacement char(100) NOT NULL ); + # Table: phpbb_zebra CREATE TABLE phpbb_zebra ( user_id mediumint(8) NOT NULL DEFAULT '0', @@ -970,7 +1031,7 @@ CREATE TABLE phpbb_zebra ( foe tinyint(1) NOT NULL DEFAULT '0' ); -CREATE INDEX user_id_phpbb_zebra on phpbb_zebra (user_id); -CREATE INDEX zebra_id_phpbb_zebra on phpbb_zebra (zebra_id); +CREATE INDEX phpbb_zebra_user_id on phpbb_zebra (user_id); +CREATE INDEX phpbb_zebra_zebra_id on phpbb_zebra (zebra_id); COMMIT; diff --git a/phpBB/language/en/email/email_notify.txt b/phpBB/language/en/email/email_notify.txt index 992af0987e..0543165627 100644 --- a/phpBB/language/en/email/email_notify.txt +++ b/phpBB/language/en/email/email_notify.txt @@ -11,7 +11,7 @@ You can find it at: {U_TOPIC} -A message from {USERNAME} may also be included below. Please note that this message has not been seen or approved by the board administrators. If you wish to complain about having received this email please contact the board administrator {CONTACT_EMAIL}. Please quote the the message headers when contacting this address. +A message from {FROM_USERNAME} may also be included below. Please note that this message has not been seen or approved by the board administrators. If you wish to complain about having received this email please contact the board administrator at {BOARD_EMAIL}. Please quote the the message headers when contacting this address. ---------- diff --git a/phpBB/language/en/email/forum_notify.txt b/phpBB/language/en/email/forum_notify.txt index f9ded9edf3..af9e9e3bab 100644 --- a/phpBB/language/en/email/forum_notify.txt +++ b/phpBB/language/en/email/forum_notify.txt @@ -7,7 +7,7 @@ You are receiving this email because you are watching the forum, "{FORUM_NAME}" {U_NEWEST_POST} -If you no longer wish to watch this forum you can either click the "Stop watching this forum link" found at the bottom of the forum above, or by clicking the following link: +If you no longer wish to watch this forum you can either click the "Unsubscribe forum link" found in the forum above, or by clicking the following link: {U_STOP_WATCHING_FORUM} diff --git a/phpBB/language/en/email/newtopic_notify.txt b/phpBB/language/en/email/newtopic_notify.txt index 4977f82cd7..93c62fe9e2 100644 --- a/phpBB/language/en/email/newtopic_notify.txt +++ b/phpBB/language/en/email/newtopic_notify.txt @@ -7,7 +7,7 @@ You are receiving this email because you are watching the forum, "{FORUM_NAME}" {U_FORUM} -If you no longer wish to watch this forum you can either click the "Stop watching this forum link" found at the bottom of the forum above, or by clicking the following link: +If you no longer wish to watch this forum you can either click the "Unsubscribe forum link" found in the forum above, or by clicking the following link: {U_STOP_WATCHING_FORUM} diff --git a/phpBB/mcp.php b/phpBB/mcp.php index 1060e0c8fc..b0f39d819f 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -72,7 +72,7 @@ $post_id = request_var('p', 0); $topic_id = request_var('t', 0); $forum_id = request_var('f', 0); $user_id = request_var('u', 0); -$username = request_var('username', ''); +$username = request_var('username', '', true); if ($post_id) { diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index c3818f179f..b1d4b91d66 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -421,6 +421,7 @@ switch ($mode) break; case 'email': + // Send an email $page_title = $user->lang['SEND_EMAIL']; $template_html = 'memberlist_email.html'; @@ -430,11 +431,6 @@ switch ($mode) trigger_error('EMAIL_DISABLED'); } - if (($user_id == ANONYMOUS || !$config['board_email_form']) && !$topic_id) - { - trigger_error('NO_EMAIL'); - } - if (!$auth->acl_get('u_sendemail')) { trigger_error('NO_EMAIL'); @@ -446,29 +442,31 @@ switch ($mode) trigger_error('FLOOD_EMAIL_LIMIT'); } - $name = request_var('name', ''); - $email = request_var('email', ''); - $email_lang = request_var('lang', ''); - $subject = request_var('subject', ''); - $message = request_var('message', ''); - $cc = (!empty($_POST['cc_email'])) ? true : false; + // Determine action... + $user_id = request_var('u', 0); + $topic_id = request_var('t', 0); - // Are we sending an email to a user on this board? Or are we sending a - // topic heads-up message? - if (!$topic_id) + // Send email to user... + if ($user_id) { + if ($user_id == ANONYMOUS || !$config['board_email_form']) + { + trigger_error('NO_EMAIL'); + } + // Get the appropriate username, etc. $sql = 'SELECT username, user_email, user_allow_viewemail, user_lang, user_jabber, user_notify_type FROM ' . USERS_TABLE . " WHERE user_id = $user_id AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')'; $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!($row = $db->sql_fetchrow($result))) + if (!$row) { trigger_error('NO_USER'); } - $db->sql_freeresult($result); // Can we send email to this user? if (!$row['user_allow_viewemail'] && !$auth->acl_get('a_user')) @@ -476,18 +474,20 @@ switch ($mode) trigger_error('NO_EMAIL'); } } - else + else if ($topic_id) { + // Send topic heads-up to email address $sql = 'SELECT forum_id, topic_title FROM ' . TOPICS_TABLE . " WHERE topic_id = $topic_id"; $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!($row = $db->sql_fetchrow($result))) + if (!$row) { trigger_error('NO_TOPIC'); } - $db->sql_freeresult($result); if (!$auth->acl_get('f_read', $row['forum_id'])) { @@ -499,12 +499,24 @@ switch ($mode) trigger_error('NO_EMAIL'); } } + else + { + trigger_error('NO_EMAIL'); + } - // User has submitted a message, handle it $error = array(); + + $name = request_var('name', ''); + $email = request_var('email', ''); + $email_lang = request_var('lang', $config['default_lang']); + $subject = request_var('subject', ''); + $message = request_var('message', ''); + $cc = (isset($_POST['cc_email'])) ? true : false; + $submit = (isset($_POST['submit'])) ? true : false; + if ($submit) { - if (!$topic_id) + if ($user_id) { if (!$subject) { @@ -515,6 +527,10 @@ switch ($mode) { $error[] = $user->lang['EMPTY_MESSAGE_EMAIL']; } + + $name = $row['username']; + $email_lang = $row['user_lang']; + $email = $row['user_email']; } else { @@ -537,22 +553,24 @@ switch ($mode) $result = $db->sql_query($sql); include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); + $messenger = new messenger(false); - $email_tpl = (!$topic_id) ? 'profile_send_email' : 'email_notify'; - $email_lang = (!$topic_id) ? $row['user_lang'] : $email_lang; - $email = (!$topic_id) ? $row['user_email'] : $email; - - $messenger = new messenger(); + $email_tpl = ($user_id) ? 'profile_send_email' : 'email_notify'; $messenger->template($email_tpl, $email_lang); - $messenger->subject($subject); $messenger->replyto($user->data['user_email']); - $messenger->to($email, $row['username']); + $messenger->to($email, $name); - if (!$topic_id) + if ($user_id) { + $messenger->subject($subject); $messenger->im($row['user_jabber'], $row['username']); + $notify_type = $row['user_notify_type']; + } + else + { + $notify_type = NOTIFY_EMAIL; } if ($cc) @@ -568,46 +586,55 @@ switch ($mode) $messenger->assign_vars(array( 'SITENAME' => $config['sitename'], 'BOARD_EMAIL' => $config['board_contact'], - 'FROM_USERNAME' => stripslashes($user->data['username']), - 'TO_USERNAME' => ($topic_id) ? stripslashes($name) : stripslashes($row['username']), - 'MESSAGE' => $message, - 'TOPIC_NAME' => ($topic_id) ? html_entity_decode($row['topic_title']) : '', - - 'U_TOPIC' => ($topic_id) ? generate_board_url() . "/viewtopic.$phpEx?f=" . $row['forum_id'] . "&t=$topic_id" : '') + 'TO_USERNAME' => html_entity_decode($name), + 'FROM_USERNAME' => html_entity_decode($user->data['username']), + 'MESSAGE' => html_entity_decode($message)) ); - $messenger->send($row['user_notify_type']); + if ($topic_id) + { + $messenger->assign_vars(array( + 'TOPIC_NAME' => html_entity_decode($row['topic_title']), + 'U_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=" . $row['forum_id'] . "&t=$topic_id") + ); + } + + $messenger->send($notify_type); $messenger->save_queue(); meta_refresh(3, "index.$phpEx$SID"); - $message = (!$topic_id) ? sprintf($user->lang['RETURN_INDEX'], '<a href="' . "index.$phpEx$SID" . '">', '</a>') : sprintf($user->lang['RETURN_TOPIC'], "<a href=\"viewtopic.$phpEx$SID&f=$forum_id&t=" . $row['topic_id'] . '">', '</a>'); + $message = ($user_id) ? sprintf($user->lang['RETURN_INDEX'], '<a href="' . "index.$phpEx$SID" . '">', '</a>') : sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $phpbb_root_path . "viewtopic.$phpEx$SID&f={$row['forum_id']}&t=$topic_id" . '">', '</a>'); trigger_error($user->lang['EMAIL_SENT'] . '<br /><br />' . $message); } } - if ($topic_id) + if ($user_id) { $template->assign_vars(array( - 'EMAIL' => htmlspecialchars($email), - 'NAME' => htmlspecialchars($name), - 'TOPIC_TITLE' => $row['topic_title'], - - 'U_TOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f={$row['forum_id']}&t=$topic_id", + 'S_SEND_USER' => true, + 'USERNAME' => $row['username'], + + 'L_EMAIL_BODY_EXPLAIN' => $user->lang['EMAIL_BODY_EXPLAIN'], + 'S_POST_ACTION' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=email&u=$user_id") + ); + } + else + { + $template->assign_vars(array( + 'EMAIL' => $email, + 'NAME' => $name, + 'S_LANG_OPTIONS' => language_select($email_lang), - 'S_LANG_OPTIONS'=> ($topic_id) ? language_select($email_lang) : '') + 'L_EMAIL_BODY_EXPLAIN' => $user->lang['EMAIL_TOPIC_EXPLAIN'], + 'S_POST_ACTION' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=email&t=$topic_id") ); } $template->assign_vars(array( - 'USERNAME' => (!$topic_id) ? addslashes($row['username']) : '', - 'ERROR_MESSAGE' => (sizeof($error)) ? implode('<br />', $error) : '', - - 'L_EMAIL_BODY_EXPLAIN' => (!$topic_id) ? $user->lang['EMAIL_BODY_EXPLAIN'] : $user->lang['EMAIL_TOPIC_EXPLAIN'], - - 'S_POST_ACTION' => (!$topic_id) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=email&u=$user_id" : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=email&f=$forum_id&t=$topic_id", - 'S_SEND_USER' => (!$topic_id) ? true : false) + 'ERROR_MESSAGE' => (sizeof($error)) ? implode('<br />', $error) : '') ); - break; + + break; case 'group': default: @@ -644,7 +671,7 @@ switch ($mode) if ($mode == 'searchuser' && ($config['load_search'] || $auth->acl_get('a_'))) { - $username = request_var('username', ''); + $username = request_var('username', '', true); $email = request_var('email', ''); $icq = request_var('icq', ''); $aim = request_var('aim', ''); diff --git a/phpBB/posting.php b/phpBB/posting.php index 121314da7e..646002a696 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -528,7 +528,7 @@ if ($submit || $preview || $refresh) $message_parser->message = request_var('message', '', true); - $username = (isset($_POST['username'])) ? request_var('username', '') : $username; + $username = (isset($_POST['username'])) ? request_var('username', '', true) : $username; $post_edit_reason = (isset($_POST['edit_reason']) && !empty($_POST['edit_reason']) && $mode == 'edit' && $user->data['user_id'] != $poster_id) ? request_var('edit_reason', '', true) : ''; $topic_type = (isset($_POST['topic_type'])) ? (int) $_POST['topic_type'] : (($mode != 'post') ? $topic_type : POST_NORMAL); diff --git a/phpBB/styles/subSilver/template/memberlist_email.html b/phpBB/styles/subSilver/template/memberlist_email.html index 8fd8c59a3d..b7fa3259fa 100644 --- a/phpBB/styles/subSilver/template/memberlist_email.html +++ b/phpBB/styles/subSilver/template/memberlist_email.html @@ -45,7 +45,7 @@ function checkForm(formObj) { <td class="row2"><input class="post" type="text" name="subject" size="50" maxlength="100" tabindex="2" value="{SUBJECT}" /></td> </tr> <!-- ELSE ---> - <tr> + <tr> <td class="row1" width="35%"><b class="genmed">{L_EMAIL_ADDRESS}</b></td> <td class="row2"><input class="post" type="text" name="email" size="50" maxlength="100" value="{EMAIL}" /></td> </tr> diff --git a/phpBB/styles/subSilver/template/posting_body.html b/phpBB/styles/subSilver/template/posting_body.html index fb26e50b1c..077e60270e 100644 --- a/phpBB/styles/subSilver/template/posting_body.html +++ b/phpBB/styles/subSilver/template/posting_body.html @@ -43,7 +43,7 @@ function checkForm() //--> </script> -<script language="javascript" type="text/javascript" src="styles/subSilver/template/editor.js"></script> +<script language="javascript" type="text/javascript" src="{T_TEMPLATE_PATH}/editor.js"></script> <!-- IF S_FORUM_RULES --> <div class="forumrules"> diff --git a/phpBB/styles/subSilver/template/ucp_profile_signature.html b/phpBB/styles/subSilver/template/ucp_profile_signature.html index 89911e361b..8d28984840 100644 --- a/phpBB/styles/subSilver/template/ucp_profile_signature.html +++ b/phpBB/styles/subSilver/template/ucp_profile_signature.html @@ -8,7 +8,7 @@ var text_name = 'signature'; // Define the bbCode tags bbcode = new Array(); -bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]'); +bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->); imageTag = false; // Helpline messages @@ -52,33 +52,36 @@ function marklist(form_name, status) <tr> <td class="row1" width="35%"><b class="genmed">{L_SIGNATURE}: </b><br /><span class="gensmall">{L_SIGNATURE_EXPLAIN}</span></td> <td class="row2"><table cellspacing="0" cellpadding="2" border="0"> - <tr align="center" valign="middle"> - <td><input class="btnbbcode" type="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" onmouseover="helpline('b')" /></td> - <td><input class="btnbbcode" type="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onclick="bbstyle(2)" onmouseover="helpline('i')" /></td> - <td><input class="btnbbcode" type="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onclick="bbstyle(4)" onmouseover="helpline('u')" /></td> - <td><input class="btnbbcode" type="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" /></td> - <td><input class="btnbbcode" type="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" /></td> - <td><input class="btnbbcode" type="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" /></td> - <td><input class="btnbbcode" type="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" /></td> - <td><input class="btnbbcode" type="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /></td> - <td><input class="btnbbcode" type="button" accesskey="w" name="addbbcode18" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(18)" onmouseover="helpline('w')" /></td> - </tr> - <tr> - <td colspan="9"><table width="100%" cellspacing="0" cellpadding="0" border="0"> - <tr> - <td><span class="genmed"> {L_FONT_SIZE}:</span> <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')"> - <option value="7">{L_FONT_TINY}</option> - <option value="9">{L_FONT_SMALL}</option> - <option value="12" selected="selected">{L_FONT_NORMAL}</option> - <option value="18">{L_FONT_LARGE}</option> - <option value="24">{L_FONT_HUGE}</option> - </select></td> - <td class="gensmall" nowrap="nowrap" align="right"><a href="javascript:bbstyle(-1)" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a></td> - </tr> - </table></td> + <tr valign="middle" align="left"> + <td colspan="2"><input type="button" class="btnbbcode" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" /> + <input type="button" class="btnbbcode" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" /> + <input type="button" class="btnbbcode" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" /> + <!-- IF S_BBCODE_QUOTE --><input type="button" class="btnbbcode" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" /><!-- ENDIF --> + <input type="button" class="btnbbcode" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" /> + <input type="button" class="btnbbcode" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" /> + <input type="button" class="btnbbcode" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" /> + <!-- IF S_BBCODE_IMG --><input type="button" class="btnbbcode" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /><!-- ENDIF --> + <input type="button" class="btnbbcode" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" /> + <!-- IF S_BBCODE_FLASH --><input type="button" class="btnbbcode" accesskey="f" name="addbbcode18" value="Flash" onclick="bbstyle(18)" /><!-- ENDIF --> + <span class="genmed" style="white-space: nowrap;">{L_FONT_SIZE}: <select class="gensmall" name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')"> + <option value="7">{L_FONT_TINY}</option> + <option value="9">{L_FONT_SMALL}</option> + <option value="12" selected="selected">{L_FONT_NORMAL}</option> + <option value="18">{L_FONT_LARGE}</option> + <option value="24">{L_FONT_HUGE}</option> + </select> | <a href="javascript:bbstyle(-1)" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a></span> + </td> </tr> + <!-- IF .custom_tags --> + <tr valign="middle" align="left"> + <td colspan="2"> + <!-- BEGIN custom_tags --> + <input type="button" class="btnbbcode" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" /> + <!-- END custom_tags --> + </td> + <!-- ENDIF --> <tr> - <td colspan="9"><input class="helpline" type="text" name="helpbox" size="45" maxlength="100" style="width:100%" value="{L_STYLES_TIP}" /></td> + <td colspan="9"><input type="text" name="helpbox" style="width:100%" maxlength="100" class="helpline" value="{L_STYLES_TIP}" /></td> </tr> <tr> <td colspan="9"><textarea class="post" name="signature" rows="10" cols="70" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></td> |