aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/common.php3
-rw-r--r--phpBB/develop/create_schema_files.php10
-rw-r--r--phpBB/develop/mysql_upgrader.php10
-rw-r--r--phpBB/docs/README.html4
-rw-r--r--phpBB/feed.php28
-rw-r--r--phpBB/includes/acp/acp_forums.php8
-rw-r--r--phpBB/includes/acp/acp_main.php6
-rw-r--r--phpBB/includes/acp/acp_users.php4
-rw-r--r--phpBB/includes/constants.php4
-rw-r--r--phpBB/includes/functions_admin.php77
-rw-r--r--phpBB/includes/functions_convert.php6
-rw-r--r--phpBB/includes/functions_posting.php64
-rw-r--r--phpBB/includes/mcp/mcp_forum.php10
-rw-r--r--phpBB/includes/mcp/mcp_front.php4
-rw-r--r--phpBB/includes/mcp/mcp_main.php12
-rw-r--r--phpBB/includes/mcp/mcp_post.php4
-rw-r--r--phpBB/includes/mcp/mcp_queue.php12
-rw-r--r--phpBB/includes/mcp/mcp_reports.php2
-rw-r--r--phpBB/includes/mcp/mcp_topic.php22
-rw-r--r--phpBB/includes/search/fulltext_mysql.php14
-rw-r--r--phpBB/includes/search/fulltext_native.php15
-rw-r--r--phpBB/install/install_convert.php2
-rw-r--r--phpBB/install/schemas/firebird_schema.sql2732
-rw-r--r--phpBB/install/schemas/mssql_schema.sql3312
-rw-r--r--phpBB/install/schemas/mysql_40_schema.sql1954
-rw-r--r--phpBB/install/schemas/mysql_41_schema.sql1954
-rw-r--r--phpBB/install/schemas/oracle_schema.sql3572
-rw-r--r--phpBB/install/schemas/postgres_schema.sql2476
-rw-r--r--phpBB/install/schemas/schema_data.sql2
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql1898
-rw-r--r--phpBB/mcp.php10
-rw-r--r--phpBB/memberlist.php2
-rw-r--r--phpBB/posting.php18
-rw-r--r--phpBB/search.php19
-rw-r--r--phpBB/viewforum.php11
-rw-r--r--phpBB/viewtopic.php32
36 files changed, 9164 insertions, 9149 deletions
diff --git a/phpBB/common.php b/phpBB/common.php
index c7c5859c25..6e226aea9f 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -82,6 +82,9 @@ require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
+
+include($phpbb_root_path . 'includes/class_visibility.'.$phpEx);
+
// Set PHP error handler to ours
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index 6eb4a80199..6ef73266ba 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -1331,7 +1331,7 @@ function get_schema_struct()
'icon_id' => array('UINT', 0),
'poster_ip' => array('VCHAR:40', ''),
'post_time' => array('TIMESTAMP', 0),
- 'post_approved' => array('BOOL', 1),
+ 'post_visibility' => array('TINT:3', 0),
'post_reported' => array('BOOL', 0),
'enable_bbcode' => array('BOOL', 1),
'enable_smilies' => array('BOOL', 1),
@@ -1357,7 +1357,7 @@ function get_schema_struct()
'topic_id' => array('INDEX', 'topic_id'),
'poster_ip' => array('INDEX', 'poster_ip'),
'poster_id' => array('INDEX', 'poster_id'),
- 'post_approved' => array('INDEX', 'post_approved'),
+ 'post_visibility' => array('INDEX', 'post_visibility'),
'post_username' => array('INDEX', 'post_username'),
'tid_post_time' => array('INDEX', array('topic_id', 'post_time')),
),
@@ -1673,7 +1673,7 @@ function get_schema_struct()
'forum_id' => array('UINT', 0),
'icon_id' => array('UINT', 0),
'topic_attachment' => array('BOOL', 0),
- 'topic_approved' => array('BOOL', 1),
+ 'topic_visibility' => array('TINT:3', 0),
'topic_reported' => array('BOOL', 0),
'topic_title' => array('STEXT_UNI', '', 'true_sort'),
'topic_poster' => array('UINT', 0),
@@ -1709,8 +1709,8 @@ function get_schema_struct()
'forum_id' => array('INDEX', 'forum_id'),
'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')),
'last_post_time' => array('INDEX', 'topic_last_post_time'),
- 'topic_approved' => array('INDEX', 'topic_approved'),
- 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_approved', 'topic_last_post_id')),
+ 'topic_visibility' => array('INDEX', 'topic_visibility'),
+ 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_visibility', 'topic_last_post_id')),
'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')),
),
);
diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php
index 7f82ebfeab..3d3891c7b9 100644
--- a/phpBB/develop/mysql_upgrader.php
+++ b/phpBB/develop/mysql_upgrader.php
@@ -768,7 +768,7 @@ function get_schema_struct()
'icon_id' => array('UINT', 0),
'poster_ip' => array('VCHAR:40', ''),
'post_time' => array('TIMESTAMP', 0),
- 'post_approved' => array('BOOL', 1),
+ 'post_visibility' => array('TINT:3', 0),
'post_reported' => array('BOOL', 0),
'enable_bbcode' => array('BOOL', 1),
'enable_smilies' => array('BOOL', 1),
@@ -794,7 +794,7 @@ function get_schema_struct()
'topic_id' => array('INDEX', 'topic_id'),
'poster_ip' => array('INDEX', 'poster_ip'),
'poster_id' => array('INDEX', 'poster_id'),
- 'post_approved' => array('INDEX', 'post_approved'),
+ 'post_visibility' => array('INDEX', 'post_visibility'),
'post_username' => array('INDEX', 'post_username'),
'tid_post_time' => array('INDEX', array('topic_id', 'post_time')),
),
@@ -1107,7 +1107,7 @@ function get_schema_struct()
'forum_id' => array('UINT', 0),
'icon_id' => array('UINT', 0),
'topic_attachment' => array('BOOL', 0),
- 'topic_approved' => array('BOOL', 1),
+ 'topic_visibility' => array('TINT:3', 0),
'topic_reported' => array('BOOL', 0),
'topic_title' => array('STEXT_UNI', '', 'true_sort'),
'topic_poster' => array('UINT', 0),
@@ -1143,8 +1143,8 @@ function get_schema_struct()
'forum_id' => array('INDEX', 'forum_id'),
'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')),
'last_post_time' => array('INDEX', 'topic_last_post_time'),
- 'topic_approved' => array('INDEX', 'topic_approved'),
- 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_approved', 'topic_last_post_id')),
+ 'topic_visibility' => array('INDEX', 'topic_visibility'),
+ 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_visibility', 'topic_last_post_id')),
'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')),
),
);
diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html
index 8f9e960275..9bd6f13bf4 100644
--- a/phpBB/docs/README.html
+++ b/phpBB/docs/README.html
@@ -324,11 +324,7 @@
<p>Please remember that running any application on a developmental version of PHP can lead to strange/unexpected results which may appear to be bugs in the application (which may not be true). Therefore we recommend you upgrade to the newest stable version of PHP before running phpBB3. If you are running a developmental version of PHP please check any bugs you find on a system running a stable release before submitting.</p>
-<<<<<<< HEAD
<p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MSSQL Server 2000, PostgreSQL 8.x, Oracle 8, SQLite and Firebird. Versions of PHP used range from 5.3.x to 5.4.x without problem.</p>
-=======
- <p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MSSQL Server 2000, PostgreSQL 7.x, Oracle 8, SQLite 2 and Firebird. Versions of PHP used range from 4.3.3 to 5.4.x without problem. </p>
->>>>>>> develop-olympus
<a name="phpsec"></a><h3>7.i. Notice on PHP security issues</h3>
diff --git a/phpBB/feed.php b/phpBB/feed.php
index 9b7ef3a575..a806cdd608 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -681,7 +681,7 @@ class phpbb_feed_post_base extends phpbb_feed_base
{
$item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row)
. ' ' . $this->separator_stats . ' ' . $user->format_date($row[$this->get('published')])
- . (($this->is_moderator_approve_forum($row['forum_id']) && !$row['post_approved']) ? ' ' . $this->separator_stats . ' ' . $user->lang['POST_UNAPPROVED'] : '');
+ . (($this->is_moderator_approve_forum($row['forum_id']) && $row['post_visibility'] !== ITEM_APPROVED) ? ' ' . $this->separator_stats . ' ' . $user->lang['POST_UNAPPROVED'] : '');
}
}
}
@@ -760,8 +760,7 @@ class phpbb_feed_overall extends phpbb_feed_post_base
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids) . '
AND topic_moved_id = 0
- AND (topic_approved = 1
- ' . $sql_m_approve . ')
+ AND ' . topic_visibility::get_visibility_sql_global('topic') . '
ORDER BY topic_last_post_time DESC';
$result = $db->sql_query_limit($sql, $this->num_items);
@@ -783,7 +782,7 @@ class phpbb_feed_overall extends phpbb_feed_post_base
// Get the actual data
$this->sql = array(
'SELECT' => 'f.forum_id, f.forum_name, ' .
- 'p.post_id, p.topic_id, p.post_time, p.post_edit_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
+ 'p.post_id, p.topic_id, p.post_time, p.post_edit_time, p.post_visibility, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
'u.username, u.user_id',
'FROM' => array(
USERS_TABLE => 'u',
@@ -796,8 +795,7 @@ class phpbb_feed_overall extends phpbb_feed_post_base
),
),
'WHERE' => $db->sql_in_set('p.topic_id', $topic_ids) . '
- AND (p.post_approved = 1
- ' . str_replace('forum_id', 'p.forum_id', $sql_m_approve) . ')
+ AND ' . topic_visibility::get_visibility_sql('post', array(), 'p.') . '
AND p.post_time >= ' . $min_post_time . '
AND u.user_id = p.poster_id',
'ORDER_BY' => 'p.post_time DESC',
@@ -894,7 +892,7 @@ class phpbb_feed_forum extends phpbb_feed_post_base
FROM ' . TOPICS_TABLE . '
WHERE forum_id = ' . $this->forum_id . '
AND topic_moved_id = 0
- ' . ((!$m_approve) ? 'AND topic_approved = 1' : '') . '
+ AND ' . topic_visibility::get_visibility_sql('topic', $this->forum_id) . '
ORDER BY topic_last_post_time DESC';
$result = $db->sql_query_limit($sql, $this->num_items);
@@ -914,14 +912,14 @@ class phpbb_feed_forum extends phpbb_feed_post_base
}
$this->sql = array(
- 'SELECT' => 'p.post_id, p.topic_id, p.post_time, p.post_edit_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
+ 'SELECT' => 'p.post_id, p.topic_id, p.post_time, p.post_edit_time, p.post_visibility, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
'u.username, u.user_id',
'FROM' => array(
POSTS_TABLE => 'p',
USERS_TABLE => 'u',
),
'WHERE' => $db->sql_in_set('p.topic_id', $topic_ids) . '
- ' . ((!$m_approve) ? 'AND p.post_approved = 1' : '') . '
+ AND ' . topic_visibility::get_visibility_sql('post', $this->forum_id, 'p.') . '
AND p.post_time >= ' . $min_post_time . '
AND p.poster_id = u.user_id',
'ORDER_BY' => 'p.post_time DESC',
@@ -967,7 +965,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base
{
global $auth, $db, $user;
- $sql = 'SELECT f.forum_options, f.forum_password, t.topic_id, t.forum_id, t.topic_approved, t.topic_title, t.topic_time, t.topic_views, t.topic_replies, t.topic_type
+ $sql = 'SELECT f.forum_options, f.forum_password, t.topic_id, t.forum_id, t.topic_visibility, t.topic_title, t.topic_time, t.topic_views, t.topic_replies, t.topic_type
FROM ' . TOPICS_TABLE . ' t
LEFT JOIN ' . FORUMS_TABLE . ' f
ON (f.forum_id = t.forum_id)
@@ -1020,14 +1018,14 @@ class phpbb_feed_topic extends phpbb_feed_post_base
global $auth, $db;
$this->sql = array(
- 'SELECT' => 'p.post_id, p.post_time, p.post_edit_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
+ 'SELECT' => 'p.post_id, p.post_time, p.post_edit_time, p.post_visibility, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
'u.username, u.user_id',
'FROM' => array(
POSTS_TABLE => 'p',
USERS_TABLE => 'u',
),
'WHERE' => 'p.topic_id = ' . $this->topic_id . '
- ' . ($this->forum_id && !$auth->acl_get('m_approve', $this->forum_id) ? 'AND p.post_approved = 1' : '') . '
+ AND ' . topic_visibility::get_visibility_sql('post', $this->forum_id, 'p.') . '
AND p.poster_id = u.user_id',
'ORDER_BY' => 'p.post_time DESC',
);
@@ -1163,7 +1161,7 @@ class phpbb_feed_news extends phpbb_feed_topic_base
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $in_fid_ary) . '
AND topic_moved_id = 0
- AND topic_approved = 1
+ AND topic_visibility = ' . ITEM_APPROVED . '
ORDER BY topic_time DESC';
$result = $db->sql_query_limit($sql, $this->num_items);
@@ -1233,7 +1231,7 @@ class phpbb_feed_topics extends phpbb_feed_topic_base
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $in_fid_ary) . '
AND topic_moved_id = 0
- AND topic_approved = 1
+ AND topic_visibility = ' . ITEM_APPROVED .'
ORDER BY topic_time DESC';
$result = $db->sql_query_limit($sql, $this->num_items);
@@ -1325,7 +1323,7 @@ class phpbb_feed_topics_active extends phpbb_feed_topic_base
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $in_fid_ary) . '
AND topic_moved_id = 0
- AND topic_approved = 1
+ AND topic_visibility = ' . ITEM_APPROVED . '
' . $last_post_time_sql . '
ORDER BY topic_last_post_time DESC';
$result = $db->sql_query_limit($sql, $this->num_items);
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index c6dbf5eb9c..622d84d15e 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -314,7 +314,7 @@ class acp_forums
$end = $start + $batch_size;
// Sync all topics in batch mode...
- sync('topic_approved', 'range', 'topic_id BETWEEN ' . $start . ' AND ' . $end, true, false);
+ sync('topic_visibility', 'range', 'topic_id BETWEEN ' . $start . ' AND ' . $end, true, false);
sync('topic', 'range', 'topic_id BETWEEN ' . $start . ' AND ' . $end, true, true);
if ($end < $row2['max_topic_id'])
@@ -1793,7 +1793,7 @@ class acp_forums
FROM ' . POSTS_TABLE . '
WHERE forum_id = ' . $forum_id . '
AND post_postcount = 1
- AND post_approved = 1';
+ AND post_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
$post_counts = array();
@@ -1931,7 +1931,7 @@ class acp_forums
// Make sure the overall post/topic count is correct...
$sql = 'SELECT COUNT(post_id) AS stat
FROM ' . POSTS_TABLE . '
- WHERE post_approved = 1';
+ WHERE post_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -1940,7 +1940,7 @@ class acp_forums
$sql = 'SELECT COUNT(topic_id) AS stat
FROM ' . TOPICS_TABLE . '
- WHERE topic_approved = 1';
+ WHERE topic_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index eb613535bf..0584bb510e 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -144,14 +144,14 @@ class acp_main
$sql = 'SELECT COUNT(post_id) AS stat
FROM ' . POSTS_TABLE . '
- WHERE post_approved = 1';
+ WHERE post_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
set_config('num_posts', (int) $db->sql_fetchfield('stat'), true);
$db->sql_freeresult($result);
$sql = 'SELECT COUNT(topic_id) AS stat
FROM ' . TOPICS_TABLE . '
- WHERE topic_approved = 1';
+ WHERE topic_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
set_config('num_topics', (int) $db->sql_fetchfield('stat'), true);
$db->sql_freeresult($result);
@@ -232,7 +232,7 @@ class acp_main
$sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
FROM ' . POSTS_TABLE . '
WHERE post_id BETWEEN ' . ($start + 1) . ' AND ' . ($start + $step) . '
- AND post_postcount = 1 AND post_approved = 1
+ AND post_postcount = 1 AND post_visibility = ' . ITEM_APPROVED . '
GROUP BY poster_id';
$result = $db->sql_query($sql);
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index b54257b04a..304027df45 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -676,7 +676,7 @@ class acp_users
'topic_time' => time(),
'forum_id' => $new_forum_id,
'icon_id' => 0,
- 'topic_approved' => 1,
+ 'topic_visibility' => ITEM_APPROVED,
'topic_title' => $post_ary['title'],
'topic_first_poster_name' => $user_row['username'],
'topic_type' => POST_NORMAL,
@@ -1033,7 +1033,7 @@ class acp_users
$sql = 'SELECT COUNT(post_id) as posts_in_queue
FROM ' . POSTS_TABLE . '
WHERE poster_id = ' . $user_id . '
- AND post_approved = 0';
+ AND post_visibility = ' . ITEM_UNAPPROVED;
$result = $db->sql_query($sql);
$user_row['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue');
$db->sql_freeresult($result);
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index 68af41ab20..62c06dc1d0 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -87,6 +87,10 @@ define('ITEM_UNLOCKED', 0);
define('ITEM_LOCKED', 1);
define('ITEM_MOVED', 2);
+define('ITEM_UNAPPROVED', 0); // => has not yet been approved
+define('ITEM_APPROVED', 1); // => has been approved, and has not been soft deleted
+define('ITEM_DELETED', 2); // => has been soft deleted
+
// Forum Flags
define('FORUM_FLAG_LINK_TRACK', 1);
define('FORUM_FLAG_PRUNE_POLL', 2);
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 5e2ee8c8f6..328c8e9778 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -644,7 +644,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
'posts' => ($call_delete_posts) ? delete_posts($where_type, $where_ids, false, true, $post_count_sync, false) : 0,
);
- $sql = 'SELECT topic_id, forum_id, topic_approved, topic_moved_id
+ $sql = 'SELECT topic_id, forum_id, topic_visibility, topic_moved_id
FROM ' . TOPICS_TABLE . '
WHERE ' . $where_clause;
$result = $db->sql_query($sql);
@@ -654,7 +654,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
$forum_ids[] = $row['forum_id'];
$topic_ids[] = $row['topic_id'];
- if ($row['topic_approved'] && !$row['topic_moved_id'])
+ if ($row['topic_visibility'] == ITEM_APPROVED && !$row['topic_moved_id'])
{
$approved_topics++;
}
@@ -767,7 +767,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
$approved_posts = 0;
$post_ids = $topic_ids = $forum_ids = $post_counts = $remove_topics = array();
- $sql = 'SELECT post_id, poster_id, post_approved, post_postcount, topic_id, forum_id
+ $sql = 'SELECT post_id, poster_id, post_visibility, post_postcount, topic_id, forum_id
FROM ' . POSTS_TABLE . '
WHERE ' . $where_clause;
$result = $db->sql_query($sql);
@@ -779,12 +779,12 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
$topic_ids[] = (int) $row['topic_id'];
$forum_ids[] = (int) $row['forum_id'];
- if ($row['post_postcount'] && $post_count_sync && $row['post_approved'])
+ if ($row['post_postcount'] && $post_count_sync && $row['post_visibility'] == ITEM_APPROVED)
{
$post_counts[$row['poster_id']] = (!empty($post_counts[$row['poster_id']])) ? $post_counts[$row['poster_id']] + 1 : 1;
}
- if ($row['post_approved'])
+ if ($row['post_visibility'] == ITEM_APPROVED)
{
$approved_posts++;
}
@@ -1274,7 +1274,7 @@ function phpbb_unlink($filename, $mode = 'file', $entry_removed = false)
* - forum Resync complete forum
* - topic Resync topics
* - topic_moved Removes topic shadows that would be in the same forum as the topic they link to
-* - topic_approved Resyncs the topic_approved flag according to the status of the first post
+* - topic_visibility Resyncs the topic_visibility flag according to the status of the first post
* - post_reported Resyncs the post_reported flag, relying on actual reports
* - topic_reported Resyncs the topic_reported flag, relying on post_reported flags
* - post_attachement Same as post_reported, but with attachment flags
@@ -1294,7 +1294,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$where_ids = ($where_ids) ? array((int) $where_ids) : array();
}
- if ($mode == 'forum' || $mode == 'topic' || $mode == 'topic_approved' || $mode == 'topic_reported' || $mode == 'post_reported')
+ if ($mode == 'forum' || $mode == 'topic' || $mode == 'topic_visibility' || $mode == 'topic_reported' || $mode == 'post_reported')
{
if (!$where_type)
{
@@ -1380,7 +1380,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$db->sql_transaction('commit');
break;
- case 'topic_approved':
+ case 'topic_visibility':
$db->sql_transaction('begin');
switch ($db->sql_layer)
@@ -1388,22 +1388,22 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
case 'mysql4':
case 'mysqli':
$sql = 'UPDATE ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
- SET t.topic_approved = p.post_approved
+ SET t.topic_visibility = p.post_visibility
$where_sql_and t.topic_first_post_id = p.post_id";
$db->sql_query($sql);
break;
default:
- $sql = 'SELECT t.topic_id, p.post_approved
+ $sql = 'SELECT t.topic_id, p.post_visibility
FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
$where_sql_and p.post_id = t.topic_first_post_id
- AND p.post_approved <> t.topic_approved";
+ AND p.post_visibility <> t.topic_visibility";
$result = $db->sql_query($sql);
$topic_ids = array();
while ($row = $db->sql_fetchrow($result))
{
- $topic_ids[] = $row['topic_id'];
+ $topic_ids[$row['topic_id']] = $row['post_visibility'];
}
$db->sql_freeresult($result);
@@ -1412,10 +1412,13 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
return;
}
- $sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_approved = 1 - topic_approved
- WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
- $db->sql_query($sql);
+ foreach ($topic_ids as $topic_id => $visibility)
+ {
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_visibility = ' . $visibility . '
+ WHERE topic_id' . $topic_id;
+ $db->sql_query($sql);
+ }
break;
}
@@ -1680,10 +1683,10 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
// 2: Get topic counts for each forum (optional)
if ($sync_extra)
{
- $sql = 'SELECT forum_id, topic_approved, COUNT(topic_id) AS forum_topics
+ $sql = 'SELECT forum_id, topic_visibility, COUNT(topic_id) AS forum_topics
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids) . '
- GROUP BY forum_id, topic_approved';
+ GROUP BY forum_id, topic_visibility';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -1691,7 +1694,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$forum_id = (int) $row['forum_id'];
$forum_data[$forum_id]['topics_real'] += $row['forum_topics'];
- if ($row['topic_approved'])
+ if ($row['topic_visibility'] == ITEM_APPROVED)
{
$forum_data[$forum_id]['topics'] = $row['forum_topics'];
}
@@ -1707,7 +1710,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$sql = 'SELECT SUM(t.topic_replies + 1) AS forum_posts
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . '
- AND t.topic_approved = 1
+ AND t.topic_visibility = ' . ITEM_APPROVED . '
AND t.topic_status <> ' . ITEM_MOVED;
}
else
@@ -1715,7 +1718,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$sql = 'SELECT t.forum_id, SUM(t.topic_replies + 1) AS forum_posts
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . '
- AND t.topic_approved = 1
+ AND t.topic_visibility = ' . ITEM_APPROVED . '
AND t.topic_status <> ' . ITEM_MOVED . '
GROUP BY t.forum_id';
}
@@ -1737,14 +1740,14 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$sql = 'SELECT MAX(t.topic_last_post_id) as last_post_id
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . '
- AND t.topic_approved = 1';
+ AND t.topic_visibility = ' . ITEM_APPROVED;
}
else
{
$sql = 'SELECT t.forum_id, MAX(t.topic_last_post_id) as last_post_id
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('t.forum_id', $forum_ids) . '
- AND t.topic_approved = 1
+ AND t.topic_visibility = ' . ITEM_APPROVED . '
GROUP BY t.forum_id';
}
@@ -1846,7 +1849,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$db->sql_transaction('begin');
- $sql = 'SELECT t.topic_id, t.forum_id, t.topic_moved_id, t.topic_approved, ' . (($sync_extra) ? 't.topic_attachment, t.topic_reported, ' : '') . 't.topic_poster, t.topic_time, t.topic_replies, t.topic_replies_real, t.topic_first_post_id, t.topic_first_poster_name, t.topic_first_poster_colour, t.topic_last_post_id, t.topic_last_post_subject, t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_poster_colour, t.topic_last_post_time
+ $sql = 'SELECT t.topic_id, t.forum_id, t.topic_moved_id, t.topic_visibility, ' . (($sync_extra) ? 't.topic_attachment, t.topic_reported, ' : '') . 't.topic_poster, t.topic_time, t.topic_replies, t.topic_replies_real, t.topic_first_post_id, t.topic_first_poster_name, t.topic_first_poster_colour, t.topic_last_post_id, t.topic_last_post_subject, t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_poster_colour, t.topic_last_post_time
FROM ' . TOPICS_TABLE . " t
$where_sql";
$result = $db->sql_query($sql);
@@ -1880,10 +1883,10 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
// Use "t" as table alias because of the $where_sql clause
// NOTE: 't.post_approved' in the GROUP BY is causing a major slowdown.
- $sql = 'SELECT t.topic_id, t.post_approved, COUNT(t.post_id) AS total_posts, MIN(t.post_id) AS first_post_id, MAX(t.post_id) AS last_post_id
+ $sql = 'SELECT t.topic_id, t.post_visibility, COUNT(t.post_id) AS total_posts, MIN(t.post_id) AS first_post_id, MAX(t.post_id) AS last_post_id
FROM ' . POSTS_TABLE . " t
$where_sql
- GROUP BY t.topic_id, t.post_approved";
+ GROUP BY t.topic_id, t.post_visibility";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -1907,7 +1910,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$topic_data[$topic_id]['replies_real'] += $row['total_posts'];
$topic_data[$topic_id]['first_post_id'] = (!$topic_data[$topic_id]['first_post_id']) ? $row['first_post_id'] : min($topic_data[$topic_id]['first_post_id'], $row['first_post_id']);
- if ($row['post_approved'] || !$topic_data[$topic_id]['last_post_id'])
+ if ($row['post_visibility'] || !$topic_data[$topic_id]['last_post_id'])
{
$topic_data[$topic_id]['replies'] = $row['total_posts'] - 1;
$topic_data[$topic_id]['last_post_id'] = $row['last_post_id'];
@@ -1952,7 +1955,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
unset($delete_topics, $delete_topic_ids);
}
- $sql = 'SELECT p.post_id, p.topic_id, p.post_approved, p.poster_id, p.post_subject, p.post_username, p.post_time, u.username, u.user_colour
+ $sql = 'SELECT p.post_id, p.topic_id, p.post_visibility, p.poster_id, p.post_subject, p.post_username, p.post_time, u.username, u.user_colour
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . '
AND u.user_id = p.poster_id';
@@ -1965,9 +1968,9 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
if ($row['post_id'] == $topic_data[$topic_id]['first_post_id'])
{
- if ($topic_data[$topic_id]['topic_approved'] != $row['post_approved'])
+ if ($topic_data[$topic_id]['topic_visibility'] != $row['post_visibility'])
{
- $approved_unapproved_ids[] = $topic_id;
+ $approved_unapproved_ids[$topic_id] = $row['post_visibility'];
}
$topic_data[$topic_id]['time'] = $row['post_time'];
$topic_data[$topic_id]['poster'] = $row['poster_id'];
@@ -2029,7 +2032,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$sync_shadow_topics = array();
if (sizeof($post_ids))
{
- $sql = 'SELECT p.post_id, p.topic_id, p.post_approved, p.poster_id, p.post_subject, p.post_username, p.post_time, u.username, u.user_colour
+ $sql = 'SELECT p.post_id, p.topic_id, p.post_visibility, p.poster_id, p.post_subject, p.post_username, p.post_time, u.username, u.user_colour
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . '
AND u.user_id = p.poster_id';
@@ -2099,10 +2102,14 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
// approved becomes unapproved, and vice-versa
if (sizeof($approved_unapproved_ids))
{
- $sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_approved = 1 - topic_approved
- WHERE ' . $db->sql_in_set('topic_id', $approved_unapproved_ids);
- $db->sql_query($sql);
+ foreach ($approved_unapproved_ids as $update_topic_id => $status)
+ {
+ // @TODO: Consider grouping by $status and only running 3 queries
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_visibility = ' . $status . '
+ WHERE topic_id = ' . $update_topic_id;
+ $db->sql_query($sql);
+ }
}
unset($approved_unapproved_ids);
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php
index ac791e0d9b..a34a193f60 100644
--- a/phpBB/includes/functions_convert.php
+++ b/phpBB/includes/functions_convert.php
@@ -1768,7 +1768,7 @@ function sync_post_count($offset, $limit)
$sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
FROM ' . POSTS_TABLE . '
WHERE post_postcount = 1
- AND post_approved = 1
+ AND post_visibility = ' . ITEM_APPROVED . '
GROUP BY poster_id
ORDER BY poster_id';
$result = $db->sql_query_limit($sql, $limit, $offset);
@@ -1941,7 +1941,7 @@ function update_dynamic_config()
$sql = 'SELECT COUNT(post_id) AS stat
FROM ' . POSTS_TABLE . '
- WHERE post_approved = 1';
+ WHERE post_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -1950,7 +1950,7 @@ function update_dynamic_config()
$sql = 'SELECT COUNT(topic_id) AS stat
FROM ' . TOPICS_TABLE . '
- WHERE topic_approved = 1';
+ WHERE topic_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index c50395a5df..2f51200b48 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -176,7 +176,7 @@ function update_post_information($type, $ids, $return_update_sql = false)
if ($type != 'topic')
{
$topic_join = ', ' . TOPICS_TABLE . ' t';
- $topic_condition = 'AND t.topic_id = p.topic_id AND t.topic_approved = 1';
+ $topic_condition = 'AND t.topic_id = p.topic_id AND t.topic_visibility = ' . ITEM_APPROVED;
}
else
{
@@ -190,7 +190,7 @@ function update_post_information($type, $ids, $return_update_sql = false)
FROM ' . POSTS_TABLE . " p $topic_join
WHERE " . $db->sql_in_set('p.' . $type . '_id', $ids) . "
$topic_condition
- AND p.post_approved = 1";
+ AND p.post_visibility = " . ITEM_APPROVED;
}
else
{
@@ -198,7 +198,7 @@ function update_post_information($type, $ids, $return_update_sql = false)
FROM ' . POSTS_TABLE . " p $topic_join
WHERE " . $db->sql_in_set('p.' . $type . '_id', $ids) . "
$topic_condition
- AND p.post_approved = 1
+ AND p.post_visibility = " . ITEM_APPROVED . "
GROUP BY p.{$type}_id";
}
$result = $db->sql_query($sql);
@@ -993,7 +993,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
$sql = 'SELECT p.post_id
FROM ' . POSTS_TABLE . ' p' . "
WHERE p.topic_id = $topic_id
- " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . '
+ AND " . topic_visibility::get_visibility_sql('post', $forum_id, 'p.') . '
' . (($mode == 'post_review') ? " AND p.post_id > $cur_post_id" : '') . '
' . (($mode == 'post_review_edit') ? " AND p.post_id = $cur_post_id" : '') . '
ORDER BY p.post_time ';
@@ -1489,7 +1489,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
delete_topics('topic_id', array($topic_id), false);
$sql_data[FORUMS_TABLE] .= 'forum_topics_real = forum_topics_real - 1';
- $sql_data[FORUMS_TABLE] .= ($data['topic_approved']) ? ', forum_posts = forum_posts - 1, forum_topics = forum_topics - 1' : '';
+ $sql_data[FORUMS_TABLE] .= ($data['topic_visibility'] == ITEM_APPROVED) ? ', forum_posts = forum_posts - 1, forum_topics = forum_topics - 1' : '';
$update_sql = update_post_information('forum', $forum_id, true);
if (sizeof($update_sql))
@@ -1509,18 +1509,18 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $sql_data[FORUMS_TABLE] = ($data['post_approved']) ? 'forum_posts = forum_posts - 1' : '';
+ $sql_data[FORUMS_TABLE] = ($data['post_visibility'] == ITEM_APPROVED) ? 'forum_posts = forum_posts - 1' : '';
$sql_data[TOPICS_TABLE] = 'topic_poster = ' . intval($row['poster_id']) . ', topic_first_post_id = ' . intval($row['post_id']) . ", topic_first_poster_colour = '" . $db->sql_escape($row['user_colour']) . "', topic_first_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "', topic_time = " . (int) $row['post_time'];
// Decrementing topic_replies here is fine because this case only happens if there is more than one post within the topic - basically removing one "reply"
- $sql_data[TOPICS_TABLE] .= ', topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : '');
+ $sql_data[TOPICS_TABLE] .= ', topic_replies_real = topic_replies_real - 1' . (($data['post_visibility'] == ITEM_APPROVED) ? ', topic_replies = topic_replies - 1' : '');
$next_post_id = (int) $row['post_id'];
break;
case 'delete_last_post':
- $sql_data[FORUMS_TABLE] = ($data['post_approved']) ? 'forum_posts = forum_posts - 1' : '';
+ $sql_data[FORUMS_TABLE] = ($data['post_visibility'] == ITEM_APPROVED) ? 'forum_posts = forum_posts - 1' : '';
$update_sql = update_post_information('forum', $forum_id, true);
if (sizeof($update_sql))
@@ -1529,7 +1529,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
$sql_data[FORUMS_TABLE] .= implode(', ', $update_sql[$forum_id]);
}
- $sql_data[TOPICS_TABLE] = 'topic_bumped = 0, topic_bumper = 0, topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : '');
+ $sql_data[TOPICS_TABLE] = 'topic_bumped = 0, topic_bumper = 0, topic_replies_real = topic_replies_real - 1' . (($data['post_visibility'] == ITEM_APPROVED) ? ', topic_replies = topic_replies - 1' : '');
$update_sql = update_post_information('topic', $topic_id, true);
if (sizeof($update_sql))
@@ -1541,8 +1541,8 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
{
$sql = 'SELECT MAX(post_id) as last_post_id
FROM ' . POSTS_TABLE . "
- WHERE topic_id = $topic_id " .
- ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved = 1' : '');
+ WHERE topic_id = $topic_id
+ AND " . topic_visibility::get_visibility_sql('post', $forum_id);
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -1554,17 +1554,17 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
case 'delete':
$sql = 'SELECT post_id
FROM ' . POSTS_TABLE . "
- WHERE topic_id = $topic_id " .
- ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved = 1' : '') . '
+ WHERE topic_id = $topic_id
+ AND " . topic_visibility::get_visibility_sql('post', $forum_id) . '
AND post_time > ' . $data['post_time'] . '
ORDER BY post_time ASC';
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $sql_data[FORUMS_TABLE] = ($data['post_approved']) ? 'forum_posts = forum_posts - 1' : '';
+ $sql_data[FORUMS_TABLE] = ($data['post_visibility'] == ITEM_APPROVED) ? 'forum_posts = forum_posts - 1' : '';
- $sql_data[TOPICS_TABLE] = 'topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : '');
+ $sql_data[TOPICS_TABLE] = 'topic_replies_real = topic_replies_real - 1' . (($data['post_visibility'] == ITEM_APPROVED) ? ', topic_replies = topic_replies - 1' : '');
$next_post_id = (int) $row['post_id'];
break;
}
@@ -1674,9 +1674,9 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$poster_id = ($mode == 'edit') ? $data['poster_id'] : (int) $user->data['user_id'];
// Retrieve some additional information if not present
- if ($mode == 'edit' && (!isset($data['post_approved']) || !isset($data['topic_approved']) || $data['post_approved'] === false || $data['topic_approved'] === false))
+ if ($mode == 'edit' && (!isset($data['post_visibility']) || !isset($data['topic_visibility']) || $data['post_visibility'] === false || $data['topic_visibility'] === false))
{
- $sql = 'SELECT p.post_approved, t.topic_type, t.topic_replies, t.topic_replies_real, t.topic_approved
+ $sql = 'SELECT p.post_visibility, t.topic_type, t.topic_replies, t.topic_replies_real, t.topic_visibility
FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p
WHERE t.topic_id = p.topic_id
AND p.post_id = ' . $data['post_id'];
@@ -1684,8 +1684,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$topic_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $data['topic_approved'] = $topic_row['topic_approved'];
- $data['post_approved'] = $topic_row['post_approved'];
+ $data['topic_visibility'] = $topic_row['topic_visibility'];
+ $data['post_visibility'] = $topic_row['post_visibility'];
}
// This variable indicates if the user is able to post or put into the queue - it is used later for all code decisions regarding approval
@@ -1719,7 +1719,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
'icon_id' => $data['icon_id'],
'poster_ip' => $user->ip,
'post_time' => $current_time,
- 'post_approved' => $post_approval,
+ 'post_visibility' => $post_approval,
'enable_bbcode' => $data['enable_bbcode'],
'enable_smilies' => $data['enable_smilies'],
'enable_magic_url' => $data['enable_urls'],
@@ -1785,7 +1785,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
'forum_id' => $data['forum_id'],
'poster_id' => $data['poster_id'],
'icon_id' => $data['icon_id'],
- 'post_approved' => (!$post_approval) ? 0 : $data['post_approved'],
+ 'post_visibility' => (!$post_approval) ? 0 : $data['post_visibility'],
'enable_bbcode' => $data['enable_bbcode'],
'enable_smilies' => $data['enable_smilies'],
'enable_magic_url' => $data['enable_urls'],
@@ -1807,7 +1807,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
break;
}
- $post_approved = $sql_data[POSTS_TABLE]['sql']['post_approved'];
+ $post_approved = $sql_data[POSTS_TABLE]['sql']['post_visibility'];
$topic_row = array();
// And the topic ladies and gentlemen
@@ -1820,7 +1820,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
'topic_last_view_time' => $current_time,
'forum_id' => $data['forum_id'],
'icon_id' => $data['icon_id'],
- 'topic_approved' => $post_approval,
+ 'topic_visibility' => $post_approval,
'topic_title' => $subject,
'topic_first_poster_name' => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''),
'topic_first_poster_colour' => $user->data['user_colour'],
@@ -1897,7 +1897,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$sql_data[TOPICS_TABLE]['sql'] = array(
'forum_id' => $data['forum_id'],
'icon_id' => $data['icon_id'],
- 'topic_approved' => (!$post_approval) ? 0 : $data['topic_approved'],
+ 'topic_visibility' => (!$post_approval) ? 0 : $data['topic_visibility'],
'topic_title' => $subject,
'topic_first_poster_name' => $username,
'topic_type' => $topic_type,
@@ -1913,12 +1913,12 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
);
// Correctly set back the topic replies and forum posts... only if the topic was approved before and now gets disapproved
- if (!$post_approval && $data['topic_approved'])
+ if (!$post_approval && $data['topic_visibility'] == ITEM_APPROVED)
{
// Do we need to grab some topic informations?
if (!sizeof($topic_row))
{
- $sql = 'SELECT topic_type, topic_replies, topic_replies_real, topic_approved
+ $sql = 'SELECT topic_type, topic_replies, topic_replies_real, topic_visibility
FROM ' . TOPICS_TABLE . '
WHERE topic_id = ' . $data['topic_id'];
$result = $db->sql_query($sql);
@@ -1949,7 +1949,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
case 'edit_last_post':
// Correctly set back the topic replies and forum posts... but only if the post was approved before.
- if (!$post_approval && $data['post_approved'])
+ if (!$post_approval && $data['post_visibility'] == ITEM_APPROVED)
{
$sql_data[TOPICS_TABLE]['stat'][] = 'topic_replies = topic_replies - 1, topic_last_view_time = ' . $current_time;
$sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts - 1';
@@ -2173,7 +2173,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
// we need to update the last forum information
// only applicable if the topic is approved
- if ($post_approved || !$data['post_approved'])
+ if ($post_approved || $data['post_visibility'] != ITEM_APPROVED)
{
// the last post makes us update the forum table. This can happen if...
// We make a new topic
@@ -2219,13 +2219,13 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape($username) . "'";
}
}
- else if ($data['post_approved'] !== $post_approved)
+ else if ($data['post_visibility'] !== $post_approved)
{
// we need a fresh change of socks, everything has become invalidated
$sql = 'SELECT MAX(topic_last_post_id) as last_post_id
FROM ' . TOPICS_TABLE . '
WHERE forum_id = ' . (int) $data['forum_id'] . '
- AND topic_approved = 1';
+ AND topic_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -2290,13 +2290,13 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
}
}
}
- else if (!$data['post_approved'] && ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies'])))
+ else if (!$data['post_visibility'] == ITEM_APPROVED && ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies'])))
{
// like having the rug pulled from under us
$sql = 'SELECT MAX(post_id) as last_post_id
FROM ' . POSTS_TABLE . '
WHERE topic_id = ' . (int) $data['topic_id'] . '
- AND post_approved = 1';
+ AND post_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index 7b3bc82093..48b9c7c2d3 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -154,7 +154,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$sql = 'SELECT t.topic_id
FROM ' . TOPICS_TABLE . ' t
WHERE t.forum_id = ' . $forum_id . '
- ' . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1') . "
+ ' . topic_visibility::get_visibility_sql('topic', $forum_id, 't.') . "
$limit_time_sql
ORDER BY t.topic_type DESC, $sort_order_sql";
$result = $db->sql_query_limit($sql, $topics_per_page, $start);
@@ -220,9 +220,10 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$topic_title = censor_text($row['topic_title']);
- $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
- $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
+ $topic_unapproved = ($row['topic_visibility'] == ITEM_UNAPPROVED && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
+ $posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? $url . '&amp;i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . '&amp;t=' . $row['topic_id'] : '';
+ $topic_deleted = ($row['topic_visibility'] == ITEM_DELETED) ? true : false;
$topic_row = array(
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
@@ -232,6 +233,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
+ 'DELETED_IMG' => ($topic_deleted) ? $user->img(/*TODO*/) : '',
'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
@@ -254,7 +256,9 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && empty($row['topic_moved_id']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false,
'S_TOPIC_UNAPPROVED' => $topic_unapproved,
'S_POSTS_UNAPPROVED' => $posts_unapproved,
+ 'S_TOPIC_DELETED' => $topic_deleted,
'S_UNREAD_TOPIC' => $unread_topic,
+
);
if ($row['topic_status'] == ITEM_MOVED)
diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php
index 13398e62bc..1b9521674d 100644
--- a/phpBB/includes/mcp/mcp_front.php
+++ b/phpBB/includes/mcp/mcp_front.php
@@ -39,7 +39,7 @@ function mcp_front_view($id, $mode, $action)
$sql = 'SELECT COUNT(post_id) AS total
FROM ' . POSTS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '
- AND post_approved = 0';
+ AND post_visibility = ' . ITEM_UNAPPROVED;
$result = $db->sql_query($sql);
$total = (int) $db->sql_fetchfield('total');
$db->sql_freeresult($result);
@@ -60,7 +60,7 @@ function mcp_front_view($id, $mode, $action)
$sql = 'SELECT post_id
FROM ' . POSTS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '
- AND post_approved = 0
+ AND post_visibility = ' . ITEM_UNAPPROVED . '
ORDER BY post_time DESC';
$result = $db->sql_query_limit($sql, 5);
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 95ca7c2e1b..db9872e04e 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -475,7 +475,7 @@ function mcp_move_topic($topic_ids)
foreach ($topic_data as $topic_id => $topic_info)
{
- if ($topic_info['topic_approved'])
+ if ($topic_info['topic_visibility'] == ITEM_APPROVED)
{
$topics_authed_moved++;
$topic_posts_added++;
@@ -486,7 +486,7 @@ function mcp_move_topic($topic_ids)
$topics_removed++;
$topic_posts_removed += $topic_info['topic_replies'];
- if ($topic_info['topic_approved'])
+ if ($topic_info['topic_visibility'] == ITEM_APPROVED)
{
$topics_authed_removed++;
$topic_posts_removed++;
@@ -528,13 +528,13 @@ function mcp_move_topic($topic_ids)
add_log('mod', $to_forum_id, $topic_id, 'LOG_MOVE', $row['forum_name'], $forum_data['forum_name']);
// Leave a redirection if required and only if the topic is visible to users
- if ($leave_shadow && $row['topic_approved'] && $row['topic_type'] != POST_GLOBAL)
+ if ($leave_shadow && $row['topic_visibility'] == ITEM_APPROVED && $row['topic_type'] != POST_GLOBAL)
{
$shadow = array(
'forum_id' => (int) $row['forum_id'],
'icon_id' => (int) $row['icon_id'],
'topic_attachment' => (int) $row['topic_attachment'],
- 'topic_approved' => 1, // a shadow topic is always approved
+ 'topic_visibliity' => ITEM_APPROVED, // a shadow topic is always approved
'topic_reported' => 0, // a shadow topic is never reported
'topic_title' => (string) $row['topic_title'],
'topic_poster' => (int) $row['topic_poster'],
@@ -932,7 +932,7 @@ function mcp_fork_topic($topic_ids)
'forum_id' => (int) $to_forum_id,
'icon_id' => (int) $topic_row['icon_id'],
'topic_attachment' => (int) $topic_row['topic_attachment'],
- 'topic_approved' => 1,
+ 'topic_visibility' => ITEM_APPROVED,
'topic_reported' => 0,
'topic_title' => (string) $topic_row['topic_title'],
'topic_poster' => (int) $topic_row['topic_poster'],
@@ -1009,7 +1009,7 @@ function mcp_fork_topic($topic_ids)
'icon_id' => (int) $row['icon_id'],
'poster_ip' => (string) $row['poster_ip'],
'post_time' => (int) $row['post_time'],
- 'post_approved' => 1,
+ 'post_visibility' => ITEM_APPROVED,
'post_reported' => 0,
'enable_bbcode' => (int) $row['enable_bbcode'],
'enable_smilies' => (int) $row['enable_smilies'],
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index 520c964228..90ce18de4e 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -185,7 +185,7 @@ function mcp_post_details($id, $mode, $action)
'S_CAN_DELETE_POST' => $auth->acl_get('m_delete', $post_info['forum_id']),
'S_POST_REPORTED' => ($post_info['post_reported']) ? true : false,
- 'S_POST_UNAPPROVED' => (!$post_info['post_approved']) ? true : false,
+ 'S_POST_UNAPPROVED' => ($post_info['post_visibility'] == ITEM_UNAPPROVED) ? true : false,
'S_POST_LOCKED' => ($post_info['post_edit_locked']) ? true : false,
'S_USER_NOTES' => true,
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
@@ -415,7 +415,7 @@ function change_poster(&$post_info, $userdata)
}
// Adjust post counts... only if the post is approved (else, it was not added the users post count anyway)
- if ($post_info['post_postcount'] && $post_info['post_approved'])
+ if ($post_info['post_postcount'] && $post_info['post_visibility'] == ITEM_APPROVED)
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_posts = user_posts - 1
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index b44685b8a3..833f924efc 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -183,7 +183,7 @@ class mcp_queue
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;p=$post_id&amp;f=$forum_id"),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
- 'S_POST_UNAPPROVED' => !$post_info['post_approved'],
+ 'S_POST_UNAPPROVED' => ($post_info['post_visibility'] == ITEM_UNAPPROVED) ,
'S_POST_LOCKED' => $post_info['post_edit_locked'],
'S_USER_NOTES' => true,
@@ -309,7 +309,7 @@ class mcp_queue
$sql = 'SELECT p.post_id
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . '
WHERE ' . $db->sql_in_set('p.forum_id', $forum_list) . '
- AND p.post_approved = 0
+ AND p.post_visibility = ' . ITEM_UNAPPROVED . '
' . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . '
' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . "
AND t.topic_id = p.topic_id
@@ -361,7 +361,7 @@ class mcp_queue
$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_title AS post_subject, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_attachment AS post_attachment, t.topic_first_poster_name AS username, t.topic_first_poster_colour AS user_colour
FROM ' . TOPICS_TABLE . " t
WHERE " . $db->sql_in_set('forum_id', $forum_list) . "
- AND topic_approved = 0
+ AND topic_visibility = " . ITEM_UNAPPROVED . "
$limit_time_sql
ORDER BY $sort_order_sql";
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
@@ -484,7 +484,7 @@ function approve_post($post_id_list, $id, $mode)
foreach ($post_info as $post_id => $post_data)
{
- if ($post_data['post_approved'])
+ if ($post_data['post_visibility'] == ITEM_APPROVED)
{
$post_approved_list[] = $post_id;
continue;
@@ -544,7 +544,7 @@ function approve_post($post_id_list, $id, $mode)
if (sizeof($topic_approve_sql))
{
$sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_approved = 1
+ SET topic_visibility = ' . ITEM_APPROVED . '
WHERE ' . $db->sql_in_set('topic_id', $topic_approve_sql);
$db->sql_query($sql);
}
@@ -552,7 +552,7 @@ function approve_post($post_id_list, $id, $mode)
if (sizeof($post_approve_sql))
{
$sql = 'UPDATE ' . POSTS_TABLE . '
- SET post_approved = 1
+ SET post_visibility = ' . ITEM_APPROVED . '
WHERE ' . $db->sql_in_set('post_id', $post_approve_sql);
$db->sql_query($sql);
}
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index 2890cd56e2..dc917a25e0 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -190,7 +190,7 @@ class mcp_reports
'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
- 'S_POST_UNAPPROVED' => !$post_info['post_approved'],
+ 'S_POST_UNAPPROVED' => ($post_info['post_visibility'] == POST_UNAPPROVED),
'S_POST_LOCKED' => $post_info['post_edit_locked'],
'S_USER_NOTES' => true,
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index e39e553ab6..f6fd12f0c4 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -145,8 +145,8 @@ function mcp_topic_view($id, $mode, $action)
$sql = 'SELECT u.username, u.username_clean, u.user_colour, p.*
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
WHERE ' . (($action == 'reports') ? 'p.post_reported = 1 AND ' : '') . '
- p.topic_id = ' . $topic_id . ' ' .
- ((!$auth->acl_get('m_approve', $topic_info['forum_id'])) ? ' AND p.post_approved = 1 ' : '') . '
+ p.topic_id = ' . $topic_id . '
+ AND ' . topic_visibility::get_visibility_sql('post', $topic_info['forum_id'], 'p.') . '
AND p.poster_id = u.user_id ' .
$limit_time_sql . '
ORDER BY ' . $sort_order_sql;
@@ -227,7 +227,7 @@ function mcp_topic_view($id, $mode, $action)
parse_attachments($topic_info['forum_id'], $message, $attachments[$row['post_id']], $update_count);
}
- if (!$row['post_approved'])
+ if ($row['post_visibility'] == ITEM_UNAPPROVED)
{
$has_unapproved_posts = true;
}
@@ -249,7 +249,7 @@ function mcp_topic_view($id, $mode, $action)
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $topic_info['forum_id'])),
- 'S_POST_UNAPPROVED' => (!$row['post_approved'] && $auth->acl_get('m_approve', $topic_info['forum_id'])),
+ 'S_POST_UNAPPROVED' => ($row['post_visibility'] != ITEM_APPROVED && $auth->acl_get('m_approve', $topic_info['forum_id'])),
'S_CHECKED' => (($submitted_id_list && !in_array(intval($row['post_id']), $submitted_id_list)) || in_array(intval($row['post_id']), $checked_ids)) ? true : false,
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
@@ -448,7 +448,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
if ($sort_order_sql[0] == 'u')
{
- $sql = 'SELECT p.post_id, p.forum_id, p.post_approved
+ $sql = 'SELECT p.post_id, p.forum_id, p.post_visibility
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
WHERE p.topic_id = $topic_id
AND p.poster_id = u.user_id
@@ -457,7 +457,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
}
else
{
- $sql = 'SELECT p.post_id, p.forum_id, p.post_approved
+ $sql = 'SELECT p.post_id, p.forum_id, p.post_visibility
FROM ' . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
$limit_time_sql
@@ -470,7 +470,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
while ($row = $db->sql_fetchrow($result))
{
// If split from selected post (split_beyond), we split the unapproved items too.
- if (!$row['post_approved'] && !$auth->acl_get('m_approve', $row['forum_id']))
+ if ($row['post_visibility'] == ITEM_UNAPPROVED && !$auth->acl_get('m_approve', $row['forum_id']))
{
// continue;
}
@@ -497,10 +497,10 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
$icon_id = request_var('icon', 0);
$sql_ary = array(
- 'forum_id' => $to_forum_id,
- 'topic_title' => $subject,
- 'icon_id' => $icon_id,
- 'topic_approved'=> 1
+ 'forum_id' => $to_forum_id,
+ 'topic_title' => $subject,
+ 'icon_id' => $icon_id,
+ 'topic_visibility' => 1
);
$sql = 'INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php
index cf89ab1c24..73bf5c52f2 100644
--- a/phpBB/includes/search/fulltext_mysql.php
+++ b/phpBB/includes/search/fulltext_mysql.php
@@ -265,7 +265,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
* @param string $sort_dir is either a or d representing ASC and DESC
* @param string $sort_days specifies the maximum amount of days a post may be old
* @param array $ex_fid_ary specifies an array of forum ids which should not be searched
- * @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
+ * @param array $m_approve_fid_sql specifies which types of posts a user may view, based on permissions
* @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
* @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty
* @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
@@ -292,7 +292,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
$sort_key,
$topic_id,
implode(',', $ex_fid_ary),
- implode(',', $m_approve_fid_ary),
+// @TODO implode(',', $m_approve_fid_ary),
implode(',', $author_ary)
)));
@@ -354,7 +354,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
break;
}
- if (!sizeof($m_approve_fid_ary))
+/* if (!sizeof($m_approve_fid_ary))
{
$m_approve_fid_sql = ' AND p.post_approved = 1';
}
@@ -366,6 +366,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
{
$m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
}
+*/
$sql_select = (!$result_count) ? 'SQL_CALC_FOUND_ROWS ' : '';
$sql_select = ($type == 'posts') ? $sql_select . 'p.post_id' : 'DISTINCT ' . $sql_select . 't.topic_id';
@@ -445,7 +446,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
* @param string $sort_dir is either a or d representing ASC and DESC
* @param string $sort_days specifies the maximum amount of days a post may be old
* @param array $ex_fid_ary specifies an array of forum ids which should not be searched
- * @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
+ * @param array $m_approve_fid_sql specifies which types of posts a user may view, based on permissions
* @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
* @param array $author_ary an array of author ids
* @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
@@ -473,7 +474,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
$sort_key,
$topic_id,
implode(',', $ex_fid_ary),
- implode(',', $m_approve_fid_ary),
+// @TODO implode(',', $m_approve_fid_ary),
implode(',', $author_ary),
$author_name,
)));
@@ -523,7 +524,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
break;
}
- if (!sizeof($m_approve_fid_ary))
+/* if (!sizeof($m_approve_fid_ary))
{
$m_approve_fid_sql = ' AND p.post_approved = 1';
}
@@ -535,6 +536,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
{
$m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
}
+*/
// If the cache was completely empty count the results
$calc_results = ($result_count) ? '' : 'SQL_CALC_FOUND_ROWS ';
diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php
index 96b3f02ec6..c7e7a451e4 100644
--- a/phpBB/includes/search/fulltext_native.php
+++ b/phpBB/includes/search/fulltext_native.php
@@ -414,7 +414,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
* @param string $sort_dir is either a or d representing ASC and DESC
* @param string $sort_days specifies the maximum amount of days a post may be old
* @param array $ex_fid_ary specifies an array of forum ids which should not be searched
- * @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
+ * @param array $m_approve_fid_sql specifies which types of posts the user can view
* @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
* @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty
* @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
@@ -451,7 +451,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
$sort_key,
$topic_id,
implode(',', $ex_fid_ary),
- implode(',', $m_approve_fid_ary),
+// @TODO implode(',', $m_approve_fid_ary),
implode(',', $author_ary),
$author_name,
)));
@@ -628,7 +628,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
$sql_where[] = '(' . implode(' OR ', $is_null_joins) . ')';
}
- if (!sizeof($m_approve_fid_ary))
+/* if (!sizeof($m_approve_fid_ary))
{
$sql_where[] = 'p.post_approved = 1';
}
@@ -636,6 +636,8 @@ class phpbb_search_fulltext_native extends phpbb_search_base
{
$sql_where[] = '(p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
}
+*/
+ $sql_where[] = $m_approve_fid_sql;
if ($topic_id)
{
@@ -808,7 +810,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
* @param string $sort_dir is either a or d representing ASC and DESC
* @param string $sort_days specifies the maximum amount of days a post may be old
* @param array $ex_fid_ary specifies an array of forum ids which should not be searched
- * @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
+ * @param array $m_approve_fid_sql specifies which posts a user can view, based on permissions
* @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
* @param array $author_ary an array of author ids
* @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
@@ -836,7 +838,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
$sort_key,
$topic_id,
implode(',', $ex_fid_ary),
- implode(',', $m_approve_fid_ary),
+// @TODO implode(',', $m_approve_fid_ary),
implode(',', $author_ary),
$author_name,
)));
@@ -886,7 +888,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
break;
}
- if (!sizeof($m_approve_fid_ary))
+/* if (!sizeof($m_approve_fid_ary))
{
$m_approve_fid_sql = ' AND p.post_approved = 1';
}
@@ -898,6 +900,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
{
$m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
}
+*/
$select = ($type == 'posts') ? 'p.post_id' : 't.topic_id';
$is_mysql = false;
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index b8045cb98b..60606d74ab 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -1465,7 +1465,7 @@ class install_convert extends module
$end = ($sync_batch + $batch_size - 1);
// Sync all topics in batch mode...
- sync('topic_approved', 'range', 'topic_id BETWEEN ' . $sync_batch . ' AND ' . $end, true, false);
+ sync('topic_visibility', 'range', 'topic_id BETWEEN ' . $sync_batch . ' AND ' . $end, true, false);
sync('topic', 'range', 'topic_id BETWEEN ' . $sync_batch . ' AND ' . $end, true, true);
$template->assign_block_vars('checks', array(
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index 588557b92a..d83fe4c2da 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -1,1367 +1,1365 @@
-# DO NOT EDIT THIS FILE, IT IS GENERATED
-#
-# To change the contents of this file, edit
-# phpBB/develop/create_schema_files.php and
-# run it.
-
-# Table: 'phpbb_attachments'
-CREATE TABLE phpbb_attachments (
- attach_id INTEGER NOT NULL,
- post_msg_id INTEGER DEFAULT 0 NOT NULL,
- topic_id INTEGER DEFAULT 0 NOT NULL,
- in_message INTEGER DEFAULT 0 NOT NULL,
- poster_id INTEGER DEFAULT 0 NOT NULL,
- is_orphan INTEGER DEFAULT 1 NOT NULL,
- physical_filename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- real_filename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- download_count INTEGER DEFAULT 0 NOT NULL,
- attach_comment BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- extension VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
- mimetype VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
- filesize INTEGER DEFAULT 0 NOT NULL,
- filetime INTEGER DEFAULT 0 NOT NULL,
- thumbnail INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_attachments ADD PRIMARY KEY (attach_id);;
-
-CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments(filetime);;
-CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments(post_msg_id);;
-CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments(topic_id);;
-CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments(poster_id);;
-CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments(is_orphan);;
-
-CREATE GENERATOR phpbb_attachments_gen;;
-SET GENERATOR phpbb_attachments_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_attachments FOR phpbb_attachments
-BEFORE INSERT
-AS
-BEGIN
- NEW.attach_id = GEN_ID(phpbb_attachments_gen, 1);
-END;;
-
-
-# Table: 'phpbb_acl_groups'
-CREATE TABLE phpbb_acl_groups (
- group_id INTEGER DEFAULT 0 NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- auth_option_id INTEGER DEFAULT 0 NOT NULL,
- auth_role_id INTEGER DEFAULT 0 NOT NULL,
- auth_setting INTEGER DEFAULT 0 NOT NULL
-);;
-
-CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups(group_id);;
-CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups(auth_option_id);;
-CREATE INDEX phpbb_acl_groups_auth_role_id ON phpbb_acl_groups(auth_role_id);;
-
-# Table: 'phpbb_acl_options'
-CREATE TABLE phpbb_acl_options (
- auth_option_id INTEGER NOT NULL,
- auth_option VARCHAR(50) CHARACTER SET NONE DEFAULT '' NOT NULL,
- is_global INTEGER DEFAULT 0 NOT NULL,
- is_local INTEGER DEFAULT 0 NOT NULL,
- founder_only INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_acl_options ADD PRIMARY KEY (auth_option_id);;
-
-CREATE UNIQUE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options(auth_option);;
-
-CREATE GENERATOR phpbb_acl_options_gen;;
-SET GENERATOR phpbb_acl_options_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_acl_options FOR phpbb_acl_options
-BEFORE INSERT
-AS
-BEGIN
- NEW.auth_option_id = GEN_ID(phpbb_acl_options_gen, 1);
-END;;
-
-
-# Table: 'phpbb_acl_roles'
-CREATE TABLE phpbb_acl_roles (
- role_id INTEGER NOT NULL,
- role_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- role_description BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- role_type VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
- role_order INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_acl_roles ADD PRIMARY KEY (role_id);;
-
-CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles(role_type);;
-CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles(role_order);;
-
-CREATE GENERATOR phpbb_acl_roles_gen;;
-SET GENERATOR phpbb_acl_roles_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_acl_roles FOR phpbb_acl_roles
-BEFORE INSERT
-AS
-BEGIN
- NEW.role_id = GEN_ID(phpbb_acl_roles_gen, 1);
-END;;
-
-
-# Table: 'phpbb_acl_roles_data'
-CREATE TABLE phpbb_acl_roles_data (
- role_id INTEGER DEFAULT 0 NOT NULL,
- auth_option_id INTEGER DEFAULT 0 NOT NULL,
- auth_setting INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_acl_roles_data ADD PRIMARY KEY (role_id, auth_option_id);;
-
-CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data(auth_option_id);;
-
-# Table: 'phpbb_acl_users'
-CREATE TABLE phpbb_acl_users (
- user_id INTEGER DEFAULT 0 NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- auth_option_id INTEGER DEFAULT 0 NOT NULL,
- auth_role_id INTEGER DEFAULT 0 NOT NULL,
- auth_setting INTEGER DEFAULT 0 NOT NULL
-);;
-
-CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users(user_id);;
-CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users(auth_option_id);;
-CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users(auth_role_id);;
-
-# Table: 'phpbb_banlist'
-CREATE TABLE phpbb_banlist (
- ban_id INTEGER NOT NULL,
- ban_userid INTEGER DEFAULT 0 NOT NULL,
- ban_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- ban_email VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- ban_start INTEGER DEFAULT 0 NOT NULL,
- ban_end INTEGER DEFAULT 0 NOT NULL,
- ban_exclude INTEGER DEFAULT 0 NOT NULL,
- ban_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- ban_give_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
-);;
-
-ALTER TABLE phpbb_banlist ADD PRIMARY KEY (ban_id);;
-
-CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist(ban_end);;
-CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist(ban_userid, ban_exclude);;
-CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist(ban_email, ban_exclude);;
-CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist(ban_ip, ban_exclude);;
-
-CREATE GENERATOR phpbb_banlist_gen;;
-SET GENERATOR phpbb_banlist_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_banlist FOR phpbb_banlist
-BEFORE INSERT
-AS
-BEGIN
- NEW.ban_id = GEN_ID(phpbb_banlist_gen, 1);
-END;;
-
-
-# Table: 'phpbb_bbcodes'
-CREATE TABLE phpbb_bbcodes (
- bbcode_id INTEGER DEFAULT 0 NOT NULL,
- bbcode_tag VARCHAR(16) CHARACTER SET NONE DEFAULT '' NOT NULL,
- bbcode_helpline VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- display_on_posting INTEGER DEFAULT 0 NOT NULL,
- bbcode_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- bbcode_tpl BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- first_pass_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- first_pass_replace BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- second_pass_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- second_pass_replace BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_bbcodes ADD PRIMARY KEY (bbcode_id);;
-
-CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes(display_on_posting);;
-
-# Table: 'phpbb_bookmarks'
-CREATE TABLE phpbb_bookmarks (
- topic_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_bookmarks ADD PRIMARY KEY (topic_id, user_id);;
-
-
-# Table: 'phpbb_bots'
-CREATE TABLE phpbb_bots (
- bot_id INTEGER NOT NULL,
- bot_active INTEGER DEFAULT 1 NOT NULL,
- bot_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_id INTEGER DEFAULT 0 NOT NULL,
- bot_agent VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- bot_ip VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_bots ADD PRIMARY KEY (bot_id);;
-
-CREATE INDEX phpbb_bots_bot_active ON phpbb_bots(bot_active);;
-
-CREATE GENERATOR phpbb_bots_gen;;
-SET GENERATOR phpbb_bots_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_bots FOR phpbb_bots
-BEFORE INSERT
-AS
-BEGIN
- NEW.bot_id = GEN_ID(phpbb_bots_gen, 1);
-END;;
-
-
-# Table: 'phpbb_config'
-CREATE TABLE phpbb_config (
- config_name VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- config_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- is_dynamic INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_config ADD PRIMARY KEY (config_name);;
-
-CREATE INDEX phpbb_config_is_dynamic ON phpbb_config(is_dynamic);;
-
-# Table: 'phpbb_confirm'
-CREATE TABLE phpbb_confirm (
- confirm_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
- session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
- confirm_type INTEGER DEFAULT 0 NOT NULL,
- code VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
- seed INTEGER DEFAULT 0 NOT NULL,
- attempts INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_confirm ADD PRIMARY KEY (session_id, confirm_id);;
-
-CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm(confirm_type);;
-
-# Table: 'phpbb_disallow'
-CREATE TABLE phpbb_disallow (
- disallow_id INTEGER NOT NULL,
- disallow_username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
-);;
-
-ALTER TABLE phpbb_disallow ADD PRIMARY KEY (disallow_id);;
-
-
-CREATE GENERATOR phpbb_disallow_gen;;
-SET GENERATOR phpbb_disallow_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_disallow FOR phpbb_disallow
-BEFORE INSERT
-AS
-BEGIN
- NEW.disallow_id = GEN_ID(phpbb_disallow_gen, 1);
-END;;
-
-
-# Table: 'phpbb_drafts'
-CREATE TABLE phpbb_drafts (
- draft_id INTEGER NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- topic_id INTEGER DEFAULT 0 NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- save_time INTEGER DEFAULT 0 NOT NULL,
- draft_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- draft_message BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_drafts ADD PRIMARY KEY (draft_id);;
-
-CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts(save_time);;
-
-CREATE GENERATOR phpbb_drafts_gen;;
-SET GENERATOR phpbb_drafts_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_drafts FOR phpbb_drafts
-BEFORE INSERT
-AS
-BEGIN
- NEW.draft_id = GEN_ID(phpbb_drafts_gen, 1);
-END;;
-
-
-# Table: 'phpbb_ext'
-CREATE TABLE phpbb_ext (
- ext_name VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- ext_active INTEGER DEFAULT 0 NOT NULL,
- ext_state BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-CREATE UNIQUE INDEX phpbb_ext_ext_name ON phpbb_ext(ext_name);;
-
-# Table: 'phpbb_extensions'
-CREATE TABLE phpbb_extensions (
- extension_id INTEGER NOT NULL,
- group_id INTEGER DEFAULT 0 NOT NULL,
- extension VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_extensions ADD PRIMARY KEY (extension_id);;
-
-
-CREATE GENERATOR phpbb_extensions_gen;;
-SET GENERATOR phpbb_extensions_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_extensions FOR phpbb_extensions
-BEFORE INSERT
-AS
-BEGIN
- NEW.extension_id = GEN_ID(phpbb_extensions_gen, 1);
-END;;
-
-
-# Table: 'phpbb_extension_groups'
-CREATE TABLE phpbb_extension_groups (
- group_id INTEGER NOT NULL,
- group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- cat_id INTEGER DEFAULT 0 NOT NULL,
- allow_group INTEGER DEFAULT 0 NOT NULL,
- download_mode INTEGER DEFAULT 1 NOT NULL,
- upload_icon VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- max_filesize INTEGER DEFAULT 0 NOT NULL,
- allowed_forums BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL,
- allow_in_pm INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_extension_groups ADD PRIMARY KEY (group_id);;
-
-
-CREATE GENERATOR phpbb_extension_groups_gen;;
-SET GENERATOR phpbb_extension_groups_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_extension_groups FOR phpbb_extension_groups
-BEFORE INSERT
-AS
-BEGIN
- NEW.group_id = GEN_ID(phpbb_extension_groups_gen, 1);
-END;;
-
-
-# Table: 'phpbb_forums'
-CREATE TABLE phpbb_forums (
- forum_id INTEGER NOT NULL,
- parent_id INTEGER DEFAULT 0 NOT NULL,
- left_id INTEGER DEFAULT 0 NOT NULL,
- right_id INTEGER DEFAULT 0 NOT NULL,
- forum_parents BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL,
- forum_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- forum_desc BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- forum_desc_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- forum_desc_options INTEGER DEFAULT 7 NOT NULL,
- forum_desc_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
- forum_link VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- forum_password VARCHAR(40) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- forum_style INTEGER DEFAULT 0 NOT NULL,
- forum_image VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- forum_rules BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- forum_rules_link VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- forum_rules_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- forum_rules_options INTEGER DEFAULT 7 NOT NULL,
- forum_rules_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
- forum_topics_per_page INTEGER DEFAULT 0 NOT NULL,
- forum_type INTEGER DEFAULT 0 NOT NULL,
- forum_status INTEGER DEFAULT 0 NOT NULL,
- forum_posts INTEGER DEFAULT 0 NOT NULL,
- forum_topics INTEGER DEFAULT 0 NOT NULL,
- forum_topics_real INTEGER DEFAULT 0 NOT NULL,
- forum_last_post_id INTEGER DEFAULT 0 NOT NULL,
- forum_last_poster_id INTEGER DEFAULT 0 NOT NULL,
- forum_last_post_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- forum_last_post_time INTEGER DEFAULT 0 NOT NULL,
- forum_last_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- forum_last_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
- forum_flags INTEGER DEFAULT 32 NOT NULL,
- forum_options INTEGER DEFAULT 0 NOT NULL,
- display_subforum_list INTEGER DEFAULT 1 NOT NULL,
- display_on_index INTEGER DEFAULT 1 NOT NULL,
- enable_indexing INTEGER DEFAULT 1 NOT NULL,
- enable_icons INTEGER DEFAULT 1 NOT NULL,
- enable_prune INTEGER DEFAULT 0 NOT NULL,
- prune_next INTEGER DEFAULT 0 NOT NULL,
- prune_days INTEGER DEFAULT 0 NOT NULL,
- prune_viewed INTEGER DEFAULT 0 NOT NULL,
- prune_freq INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_forums ADD PRIMARY KEY (forum_id);;
-
-CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums(left_id, right_id);;
-CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums(forum_last_post_id);;
-
-CREATE GENERATOR phpbb_forums_gen;;
-SET GENERATOR phpbb_forums_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_forums FOR phpbb_forums
-BEFORE INSERT
-AS
-BEGIN
- NEW.forum_id = GEN_ID(phpbb_forums_gen, 1);
-END;;
-
-
-# Table: 'phpbb_forums_access'
-CREATE TABLE phpbb_forums_access (
- forum_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_forums_access ADD PRIMARY KEY (forum_id, user_id, session_id);;
-
-
-# Table: 'phpbb_forums_track'
-CREATE TABLE phpbb_forums_track (
- user_id INTEGER DEFAULT 0 NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- mark_time INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_forums_track ADD PRIMARY KEY (user_id, forum_id);;
-
-
-# Table: 'phpbb_forums_watch'
-CREATE TABLE phpbb_forums_watch (
- forum_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- notify_status INTEGER DEFAULT 0 NOT NULL
-);;
-
-CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch(forum_id);;
-CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch(user_id);;
-CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch(notify_status);;
-
-# Table: 'phpbb_groups'
-CREATE TABLE phpbb_groups (
- group_id INTEGER NOT NULL,
- group_type INTEGER DEFAULT 1 NOT NULL,
- group_founder_manage INTEGER DEFAULT 0 NOT NULL,
- group_skip_auth INTEGER DEFAULT 0 NOT NULL,
- group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- group_desc BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- group_desc_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- group_desc_options INTEGER DEFAULT 7 NOT NULL,
- group_desc_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
- group_display INTEGER DEFAULT 0 NOT NULL,
- group_avatar VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- group_avatar_type INTEGER DEFAULT 0 NOT NULL,
- group_avatar_width INTEGER DEFAULT 0 NOT NULL,
- group_avatar_height INTEGER DEFAULT 0 NOT NULL,
- group_rank INTEGER DEFAULT 0 NOT NULL,
- group_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
- group_sig_chars INTEGER DEFAULT 0 NOT NULL,
- group_receive_pm INTEGER DEFAULT 0 NOT NULL,
- group_message_limit INTEGER DEFAULT 0 NOT NULL,
- group_max_recipients INTEGER DEFAULT 0 NOT NULL,
- group_legend INTEGER DEFAULT 0 NOT NULL,
- group_teampage INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_groups ADD PRIMARY KEY (group_id);;
-
-CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups(group_legend, group_name);;
-
-CREATE GENERATOR phpbb_groups_gen;;
-SET GENERATOR phpbb_groups_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_groups FOR phpbb_groups
-BEFORE INSERT
-AS
-BEGIN
- NEW.group_id = GEN_ID(phpbb_groups_gen, 1);
-END;;
-
-
-# Table: 'phpbb_icons'
-CREATE TABLE phpbb_icons (
- icons_id INTEGER NOT NULL,
- icons_url VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- icons_width INTEGER DEFAULT 0 NOT NULL,
- icons_height INTEGER DEFAULT 0 NOT NULL,
- icons_order INTEGER DEFAULT 0 NOT NULL,
- display_on_posting INTEGER DEFAULT 1 NOT NULL
-);;
-
-ALTER TABLE phpbb_icons ADD PRIMARY KEY (icons_id);;
-
-CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons(display_on_posting);;
-
-CREATE GENERATOR phpbb_icons_gen;;
-SET GENERATOR phpbb_icons_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_icons FOR phpbb_icons
-BEFORE INSERT
-AS
-BEGIN
- NEW.icons_id = GEN_ID(phpbb_icons_gen, 1);
-END;;
-
-
-# Table: 'phpbb_lang'
-CREATE TABLE phpbb_lang (
- lang_id INTEGER NOT NULL,
- lang_iso VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL,
- lang_dir VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL,
- lang_english_name VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- lang_local_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- lang_author VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
-);;
-
-ALTER TABLE phpbb_lang ADD PRIMARY KEY (lang_id);;
-
-CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang(lang_iso);;
-
-CREATE GENERATOR phpbb_lang_gen;;
-SET GENERATOR phpbb_lang_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_lang FOR phpbb_lang
-BEFORE INSERT
-AS
-BEGIN
- NEW.lang_id = GEN_ID(phpbb_lang_gen, 1);
-END;;
-
-
-# Table: 'phpbb_log'
-CREATE TABLE phpbb_log (
- log_id INTEGER NOT NULL,
- log_type INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- topic_id INTEGER DEFAULT 0 NOT NULL,
- reportee_id INTEGER DEFAULT 0 NOT NULL,
- log_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- log_time INTEGER DEFAULT 0 NOT NULL,
- log_operation BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- log_data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_log ADD PRIMARY KEY (log_id);;
-
-CREATE INDEX phpbb_log_log_type ON phpbb_log(log_type);;
-CREATE INDEX phpbb_log_log_time ON phpbb_log(log_time);;
-CREATE INDEX phpbb_log_forum_id ON phpbb_log(forum_id);;
-CREATE INDEX phpbb_log_topic_id ON phpbb_log(topic_id);;
-CREATE INDEX phpbb_log_reportee_id ON phpbb_log(reportee_id);;
-CREATE INDEX phpbb_log_user_id ON phpbb_log(user_id);;
-
-CREATE GENERATOR phpbb_log_gen;;
-SET GENERATOR phpbb_log_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_log FOR phpbb_log
-BEFORE INSERT
-AS
-BEGIN
- NEW.log_id = GEN_ID(phpbb_log_gen, 1);
-END;;
-
-
-# Table: 'phpbb_login_attempts'
-CREATE TABLE phpbb_login_attempts (
- attempt_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- attempt_browser VARCHAR(150) CHARACTER SET NONE DEFAULT '' NOT NULL,
- attempt_forwarded_for VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- attempt_time INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- username VARCHAR(255) CHARACTER SET UTF8 DEFAULT 0 NOT NULL COLLATE UNICODE,
- username_clean VARCHAR(255) CHARACTER SET UTF8 DEFAULT 0 NOT NULL COLLATE UNICODE
-);;
-
-CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts(attempt_ip, attempt_time);;
-CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts(attempt_forwarded_for, attempt_time);;
-CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts(attempt_time);;
-CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts(user_id);;
-
-# Table: 'phpbb_moderator_cache'
-CREATE TABLE phpbb_moderator_cache (
- forum_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- group_id INTEGER DEFAULT 0 NOT NULL,
- group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- display_on_index INTEGER DEFAULT 1 NOT NULL
-);;
-
-CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache(display_on_index);;
-CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache(forum_id);;
-
-# Table: 'phpbb_modules'
-CREATE TABLE phpbb_modules (
- module_id INTEGER NOT NULL,
- module_enabled INTEGER DEFAULT 1 NOT NULL,
- module_display INTEGER DEFAULT 1 NOT NULL,
- module_basename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- module_class VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
- parent_id INTEGER DEFAULT 0 NOT NULL,
- left_id INTEGER DEFAULT 0 NOT NULL,
- right_id INTEGER DEFAULT 0 NOT NULL,
- module_langname VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- module_mode VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- module_auth VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_modules ADD PRIMARY KEY (module_id);;
-
-CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules(left_id, right_id);;
-CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules(module_enabled);;
-CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules(module_class, left_id);;
-
-CREATE GENERATOR phpbb_modules_gen;;
-SET GENERATOR phpbb_modules_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_modules FOR phpbb_modules
-BEFORE INSERT
-AS
-BEGIN
- NEW.module_id = GEN_ID(phpbb_modules_gen, 1);
-END;;
-
-
-# Table: 'phpbb_poll_options'
-CREATE TABLE phpbb_poll_options (
- poll_option_id INTEGER DEFAULT 0 NOT NULL,
- topic_id INTEGER DEFAULT 0 NOT NULL,
- poll_option_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- poll_option_total INTEGER DEFAULT 0 NOT NULL
-);;
-
-CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options(poll_option_id);;
-CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options(topic_id);;
-
-# Table: 'phpbb_poll_votes'
-CREATE TABLE phpbb_poll_votes (
- topic_id INTEGER DEFAULT 0 NOT NULL,
- poll_option_id INTEGER DEFAULT 0 NOT NULL,
- vote_user_id INTEGER DEFAULT 0 NOT NULL,
- vote_user_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes(topic_id);;
-CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes(vote_user_id);;
-CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes(vote_user_ip);;
-
-# Table: 'phpbb_posts'
-CREATE TABLE phpbb_posts (
- post_id INTEGER NOT NULL,
- topic_id INTEGER DEFAULT 0 NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- poster_id INTEGER DEFAULT 0 NOT NULL,
- icon_id INTEGER DEFAULT 0 NOT NULL,
- poster_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- post_time INTEGER DEFAULT 0 NOT NULL,
- post_approved INTEGER DEFAULT 1 NOT NULL,
- post_reported INTEGER DEFAULT 0 NOT NULL,
- enable_bbcode INTEGER DEFAULT 1 NOT NULL,
- enable_smilies INTEGER DEFAULT 1 NOT NULL,
- enable_magic_url INTEGER DEFAULT 1 NOT NULL,
- enable_sig INTEGER DEFAULT 1 NOT NULL,
- post_username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- post_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- post_checksum VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
- post_attachment INTEGER DEFAULT 0 NOT NULL,
- bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
- post_postcount INTEGER DEFAULT 1 NOT NULL,
- post_edit_time INTEGER DEFAULT 0 NOT NULL,
- post_edit_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- post_edit_user INTEGER DEFAULT 0 NOT NULL,
- post_edit_count INTEGER DEFAULT 0 NOT NULL,
- post_edit_locked INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_posts ADD PRIMARY KEY (post_id);;
-
-CREATE INDEX phpbb_posts_forum_id ON phpbb_posts(forum_id);;
-CREATE INDEX phpbb_posts_topic_id ON phpbb_posts(topic_id);;
-CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts(poster_ip);;
-CREATE INDEX phpbb_posts_poster_id ON phpbb_posts(poster_id);;
-CREATE INDEX phpbb_posts_post_approved ON phpbb_posts(post_approved);;
-CREATE INDEX phpbb_posts_post_username ON phpbb_posts(post_username);;
-CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts(topic_id, post_time);;
-
-CREATE GENERATOR phpbb_posts_gen;;
-SET GENERATOR phpbb_posts_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_posts FOR phpbb_posts
-BEFORE INSERT
-AS
-BEGIN
- NEW.post_id = GEN_ID(phpbb_posts_gen, 1);
-END;;
-
-
-# Table: 'phpbb_privmsgs'
-CREATE TABLE phpbb_privmsgs (
- msg_id INTEGER NOT NULL,
- root_level INTEGER DEFAULT 0 NOT NULL,
- author_id INTEGER DEFAULT 0 NOT NULL,
- icon_id INTEGER DEFAULT 0 NOT NULL,
- author_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- message_time INTEGER DEFAULT 0 NOT NULL,
- enable_bbcode INTEGER DEFAULT 1 NOT NULL,
- enable_smilies INTEGER DEFAULT 1 NOT NULL,
- enable_magic_url INTEGER DEFAULT 1 NOT NULL,
- enable_sig INTEGER DEFAULT 1 NOT NULL,
- message_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- message_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- message_edit_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- message_edit_user INTEGER DEFAULT 0 NOT NULL,
- message_attachment INTEGER DEFAULT 0 NOT NULL,
- bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
- message_edit_time INTEGER DEFAULT 0 NOT NULL,
- message_edit_count INTEGER DEFAULT 0 NOT NULL,
- to_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- bcc_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- message_reported INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_privmsgs ADD PRIMARY KEY (msg_id);;
-
-CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs(author_ip);;
-CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs(message_time);;
-CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs(author_id);;
-CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs(root_level);;
-
-CREATE GENERATOR phpbb_privmsgs_gen;;
-SET GENERATOR phpbb_privmsgs_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_privmsgs FOR phpbb_privmsgs
-BEFORE INSERT
-AS
-BEGIN
- NEW.msg_id = GEN_ID(phpbb_privmsgs_gen, 1);
-END;;
-
-
-# Table: 'phpbb_privmsgs_folder'
-CREATE TABLE phpbb_privmsgs_folder (
- folder_id INTEGER NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- folder_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- pm_count INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_privmsgs_folder ADD PRIMARY KEY (folder_id);;
-
-CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder(user_id);;
-
-CREATE GENERATOR phpbb_privmsgs_folder_gen;;
-SET GENERATOR phpbb_privmsgs_folder_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_privmsgs_folder FOR phpbb_privmsgs_folder
-BEFORE INSERT
-AS
-BEGIN
- NEW.folder_id = GEN_ID(phpbb_privmsgs_folder_gen, 1);
-END;;
-
-
-# Table: 'phpbb_privmsgs_rules'
-CREATE TABLE phpbb_privmsgs_rules (
- rule_id INTEGER NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- rule_check INTEGER DEFAULT 0 NOT NULL,
- rule_connection INTEGER DEFAULT 0 NOT NULL,
- rule_string VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- rule_user_id INTEGER DEFAULT 0 NOT NULL,
- rule_group_id INTEGER DEFAULT 0 NOT NULL,
- rule_action INTEGER DEFAULT 0 NOT NULL,
- rule_folder_id INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_privmsgs_rules ADD PRIMARY KEY (rule_id);;
-
-CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules(user_id);;
-
-CREATE GENERATOR phpbb_privmsgs_rules_gen;;
-SET GENERATOR phpbb_privmsgs_rules_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_privmsgs_rules FOR phpbb_privmsgs_rules
-BEFORE INSERT
-AS
-BEGIN
- NEW.rule_id = GEN_ID(phpbb_privmsgs_rules_gen, 1);
-END;;
-
-
-# Table: 'phpbb_privmsgs_to'
-CREATE TABLE phpbb_privmsgs_to (
- msg_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- author_id INTEGER DEFAULT 0 NOT NULL,
- pm_deleted INTEGER DEFAULT 0 NOT NULL,
- pm_new INTEGER DEFAULT 1 NOT NULL,
- pm_unread INTEGER DEFAULT 1 NOT NULL,
- pm_replied INTEGER DEFAULT 0 NOT NULL,
- pm_marked INTEGER DEFAULT 0 NOT NULL,
- pm_forwarded INTEGER DEFAULT 0 NOT NULL,
- folder_id INTEGER DEFAULT 0 NOT NULL
-);;
-
-CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to(msg_id);;
-CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to(author_id);;
-CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to(user_id, folder_id);;
-
-# Table: 'phpbb_profile_fields'
-CREATE TABLE phpbb_profile_fields (
- field_id INTEGER NOT NULL,
- field_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- field_type INTEGER DEFAULT 0 NOT NULL,
- field_ident VARCHAR(20) CHARACTER SET NONE DEFAULT '' NOT NULL,
- field_length VARCHAR(20) CHARACTER SET NONE DEFAULT '' NOT NULL,
- field_minlen VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- field_maxlen VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- field_novalue VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- field_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- field_validation VARCHAR(20) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- field_required INTEGER DEFAULT 0 NOT NULL,
- field_show_novalue INTEGER DEFAULT 0 NOT NULL,
- field_show_on_reg INTEGER DEFAULT 0 NOT NULL,
- field_show_on_pm INTEGER DEFAULT 0 NOT NULL,
- field_show_on_vt INTEGER DEFAULT 0 NOT NULL,
- field_show_profile INTEGER DEFAULT 0 NOT NULL,
- field_hide INTEGER DEFAULT 0 NOT NULL,
- field_no_view INTEGER DEFAULT 0 NOT NULL,
- field_active INTEGER DEFAULT 0 NOT NULL,
- field_order INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_profile_fields ADD PRIMARY KEY (field_id);;
-
-CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields(field_type);;
-CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields(field_order);;
-
-CREATE GENERATOR phpbb_profile_fields_gen;;
-SET GENERATOR phpbb_profile_fields_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_profile_fields FOR phpbb_profile_fields
-BEFORE INSERT
-AS
-BEGIN
- NEW.field_id = GEN_ID(phpbb_profile_fields_gen, 1);
-END;;
-
-
-# Table: 'phpbb_profile_fields_data'
-CREATE TABLE phpbb_profile_fields_data (
- user_id INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_profile_fields_data ADD PRIMARY KEY (user_id);;
-
-
-# Table: 'phpbb_profile_fields_lang'
-CREATE TABLE phpbb_profile_fields_lang (
- field_id INTEGER DEFAULT 0 NOT NULL,
- lang_id INTEGER DEFAULT 0 NOT NULL,
- option_id INTEGER DEFAULT 0 NOT NULL,
- field_type INTEGER DEFAULT 0 NOT NULL,
- lang_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
-);;
-
-ALTER TABLE phpbb_profile_fields_lang ADD PRIMARY KEY (field_id, lang_id, option_id);;
-
-
-# Table: 'phpbb_profile_lang'
-CREATE TABLE phpbb_profile_lang (
- field_id INTEGER DEFAULT 0 NOT NULL,
- lang_id INTEGER DEFAULT 0 NOT NULL,
- lang_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- lang_explain BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- lang_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
-);;
-
-ALTER TABLE phpbb_profile_lang ADD PRIMARY KEY (field_id, lang_id);;
-
-
-# Table: 'phpbb_ranks'
-CREATE TABLE phpbb_ranks (
- rank_id INTEGER NOT NULL,
- rank_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- rank_min INTEGER DEFAULT 0 NOT NULL,
- rank_special INTEGER DEFAULT 0 NOT NULL,
- rank_image VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_ranks ADD PRIMARY KEY (rank_id);;
-
-
-CREATE GENERATOR phpbb_ranks_gen;;
-SET GENERATOR phpbb_ranks_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_ranks FOR phpbb_ranks
-BEFORE INSERT
-AS
-BEGIN
- NEW.rank_id = GEN_ID(phpbb_ranks_gen, 1);
-END;;
-
-
-# Table: 'phpbb_reports'
-CREATE TABLE phpbb_reports (
- report_id INTEGER NOT NULL,
- reason_id INTEGER DEFAULT 0 NOT NULL,
- post_id INTEGER DEFAULT 0 NOT NULL,
- pm_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- user_notify INTEGER DEFAULT 0 NOT NULL,
- report_closed INTEGER DEFAULT 0 NOT NULL,
- report_time INTEGER DEFAULT 0 NOT NULL,
- report_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- reported_post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);;
-
-CREATE INDEX phpbb_reports_post_id ON phpbb_reports(post_id);;
-CREATE INDEX phpbb_reports_pm_id ON phpbb_reports(pm_id);;
-
-CREATE GENERATOR phpbb_reports_gen;;
-SET GENERATOR phpbb_reports_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_reports FOR phpbb_reports
-BEFORE INSERT
-AS
-BEGIN
- NEW.report_id = GEN_ID(phpbb_reports_gen, 1);
-END;;
-
-
-# Table: 'phpbb_reports_reasons'
-CREATE TABLE phpbb_reports_reasons (
- reason_id INTEGER NOT NULL,
- reason_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- reason_description BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- reason_order INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_reports_reasons ADD PRIMARY KEY (reason_id);;
-
-
-CREATE GENERATOR phpbb_reports_reasons_gen;;
-SET GENERATOR phpbb_reports_reasons_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_reports_reasons FOR phpbb_reports_reasons
-BEFORE INSERT
-AS
-BEGIN
- NEW.reason_id = GEN_ID(phpbb_reports_reasons_gen, 1);
-END;;
-
-
-# Table: 'phpbb_search_results'
-CREATE TABLE phpbb_search_results (
- search_key VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
- search_time INTEGER DEFAULT 0 NOT NULL,
- search_keywords BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- search_authors BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_search_results ADD PRIMARY KEY (search_key);;
-
-
-# Table: 'phpbb_search_wordlist'
-CREATE TABLE phpbb_search_wordlist (
- word_id INTEGER NOT NULL,
- word_text VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- word_common INTEGER DEFAULT 0 NOT NULL,
- word_count INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_search_wordlist ADD PRIMARY KEY (word_id);;
-
-CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist(word_text);;
-CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist(word_count);;
-
-CREATE GENERATOR phpbb_search_wordlist_gen;;
-SET GENERATOR phpbb_search_wordlist_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_search_wordlist FOR phpbb_search_wordlist
-BEFORE INSERT
-AS
-BEGIN
- NEW.word_id = GEN_ID(phpbb_search_wordlist_gen, 1);
-END;;
-
-
-# Table: 'phpbb_search_wordmatch'
-CREATE TABLE phpbb_search_wordmatch (
- post_id INTEGER DEFAULT 0 NOT NULL,
- word_id INTEGER DEFAULT 0 NOT NULL,
- title_match INTEGER DEFAULT 0 NOT NULL
-);;
-
-CREATE UNIQUE INDEX phpbb_search_wordmatch_unq_mtch ON phpbb_search_wordmatch(word_id, post_id, title_match);;
-CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch(word_id);;
-CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch(post_id);;
-
-# Table: 'phpbb_sessions'
-CREATE TABLE phpbb_sessions (
- session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
- session_user_id INTEGER DEFAULT 0 NOT NULL,
- session_forum_id INTEGER DEFAULT 0 NOT NULL,
- session_last_visit INTEGER DEFAULT 0 NOT NULL,
- session_start INTEGER DEFAULT 0 NOT NULL,
- session_time INTEGER DEFAULT 0 NOT NULL,
- session_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- session_browser VARCHAR(150) CHARACTER SET NONE DEFAULT '' NOT NULL,
- session_forwarded_for VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- session_page VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- session_viewonline INTEGER DEFAULT 1 NOT NULL,
- session_autologin INTEGER DEFAULT 0 NOT NULL,
- session_admin INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_sessions ADD PRIMARY KEY (session_id);;
-
-CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions(session_time);;
-CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions(session_user_id);;
-CREATE INDEX phpbb_sessions_session_fid ON phpbb_sessions(session_forum_id);;
-
-# Table: 'phpbb_sessions_keys'
-CREATE TABLE phpbb_sessions_keys (
- key_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- last_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- last_login INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_sessions_keys ADD PRIMARY KEY (key_id, user_id);;
-
-CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys(last_login);;
-
-# Table: 'phpbb_sitelist'
-CREATE TABLE phpbb_sitelist (
- site_id INTEGER NOT NULL,
- site_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- site_hostname VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- ip_exclude INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_sitelist ADD PRIMARY KEY (site_id);;
-
-
-CREATE GENERATOR phpbb_sitelist_gen;;
-SET GENERATOR phpbb_sitelist_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_sitelist FOR phpbb_sitelist
-BEFORE INSERT
-AS
-BEGIN
- NEW.site_id = GEN_ID(phpbb_sitelist_gen, 1);
-END;;
-
-
-# Table: 'phpbb_smilies'
-CREATE TABLE phpbb_smilies (
- smiley_id INTEGER NOT NULL,
- code VARCHAR(50) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- emotion VARCHAR(50) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- smiley_url VARCHAR(50) CHARACTER SET NONE DEFAULT '' NOT NULL,
- smiley_width INTEGER DEFAULT 0 NOT NULL,
- smiley_height INTEGER DEFAULT 0 NOT NULL,
- smiley_order INTEGER DEFAULT 0 NOT NULL,
- display_on_posting INTEGER DEFAULT 1 NOT NULL
-);;
-
-ALTER TABLE phpbb_smilies ADD PRIMARY KEY (smiley_id);;
-
-CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies(display_on_posting);;
-
-CREATE GENERATOR phpbb_smilies_gen;;
-SET GENERATOR phpbb_smilies_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_smilies FOR phpbb_smilies
-BEFORE INSERT
-AS
-BEGIN
- NEW.smiley_id = GEN_ID(phpbb_smilies_gen, 1);
-END;;
-
-
-# Table: 'phpbb_styles'
-CREATE TABLE phpbb_styles (
- style_id INTEGER NOT NULL,
- style_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- style_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- style_active INTEGER DEFAULT 1 NOT NULL,
- style_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
- bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT 'kNg=' NOT NULL,
- style_parent_id INTEGER DEFAULT 0 NOT NULL,
- style_parent_tree BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL
-);;
-
-ALTER TABLE phpbb_styles ADD PRIMARY KEY (style_id);;
-
-CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles(style_name);;
-
-CREATE GENERATOR phpbb_styles_gen;;
-SET GENERATOR phpbb_styles_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_styles FOR phpbb_styles
-BEFORE INSERT
-AS
-BEGIN
- NEW.style_id = GEN_ID(phpbb_styles_gen, 1);
-END;;
-
-
-# Table: 'phpbb_topics'
-CREATE TABLE phpbb_topics (
- topic_id INTEGER NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- icon_id INTEGER DEFAULT 0 NOT NULL,
- topic_attachment INTEGER DEFAULT 0 NOT NULL,
- topic_approved INTEGER DEFAULT 1 NOT NULL,
- topic_reported INTEGER DEFAULT 0 NOT NULL,
- topic_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- topic_poster INTEGER DEFAULT 0 NOT NULL,
- topic_time INTEGER DEFAULT 0 NOT NULL,
- topic_time_limit INTEGER DEFAULT 0 NOT NULL,
- topic_views INTEGER DEFAULT 0 NOT NULL,
- topic_replies INTEGER DEFAULT 0 NOT NULL,
- topic_replies_real INTEGER DEFAULT 0 NOT NULL,
- topic_status INTEGER DEFAULT 0 NOT NULL,
- topic_type INTEGER DEFAULT 0 NOT NULL,
- topic_first_post_id INTEGER DEFAULT 0 NOT NULL,
- topic_first_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- topic_first_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
- topic_last_post_id INTEGER DEFAULT 0 NOT NULL,
- topic_last_poster_id INTEGER DEFAULT 0 NOT NULL,
- topic_last_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- topic_last_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
- topic_last_post_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- topic_last_post_time INTEGER DEFAULT 0 NOT NULL,
- topic_last_view_time INTEGER DEFAULT 0 NOT NULL,
- topic_moved_id INTEGER DEFAULT 0 NOT NULL,
- topic_bumped INTEGER DEFAULT 0 NOT NULL,
- topic_bumper INTEGER DEFAULT 0 NOT NULL,
- poll_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- poll_start INTEGER DEFAULT 0 NOT NULL,
- poll_length INTEGER DEFAULT 0 NOT NULL,
- poll_max_options INTEGER DEFAULT 1 NOT NULL,
- poll_last_vote INTEGER DEFAULT 0 NOT NULL,
- poll_vote_change INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_topics ADD PRIMARY KEY (topic_id);;
-
-CREATE INDEX phpbb_topics_forum_id ON phpbb_topics(forum_id);;
-CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics(forum_id, topic_type);;
-CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics(topic_last_post_time);;
-CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics(topic_approved);;
-CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics(forum_id, topic_approved, topic_last_post_id);;
-CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics(forum_id, topic_last_post_time, topic_moved_id);;
-
-CREATE GENERATOR phpbb_topics_gen;;
-SET GENERATOR phpbb_topics_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_topics FOR phpbb_topics
-BEFORE INSERT
-AS
-BEGIN
- NEW.topic_id = GEN_ID(phpbb_topics_gen, 1);
-END;;
-
-
-# Table: 'phpbb_topics_track'
-CREATE TABLE phpbb_topics_track (
- user_id INTEGER DEFAULT 0 NOT NULL,
- topic_id INTEGER DEFAULT 0 NOT NULL,
- forum_id INTEGER DEFAULT 0 NOT NULL,
- mark_time INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_topics_track ADD PRIMARY KEY (user_id, topic_id);;
-
-CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track(topic_id);;
-CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track(forum_id);;
-
-# Table: 'phpbb_topics_posted'
-CREATE TABLE phpbb_topics_posted (
- user_id INTEGER DEFAULT 0 NOT NULL,
- topic_id INTEGER DEFAULT 0 NOT NULL,
- topic_posted INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_topics_posted ADD PRIMARY KEY (user_id, topic_id);;
-
-
-# Table: 'phpbb_topics_watch'
-CREATE TABLE phpbb_topics_watch (
- topic_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- notify_status INTEGER DEFAULT 0 NOT NULL
-);;
-
-CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch(topic_id);;
-CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch(user_id);;
-CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch(notify_status);;
-
-# Table: 'phpbb_user_group'
-CREATE TABLE phpbb_user_group (
- group_id INTEGER DEFAULT 0 NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- group_leader INTEGER DEFAULT 0 NOT NULL,
- user_pending INTEGER DEFAULT 1 NOT NULL
-);;
-
-CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group(group_id);;
-CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group(user_id);;
-CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group(group_leader);;
-
-# Table: 'phpbb_users'
-CREATE TABLE phpbb_users (
- user_id INTEGER NOT NULL,
- user_type INTEGER DEFAULT 0 NOT NULL,
- group_id INTEGER DEFAULT 3 NOT NULL,
- user_permissions BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_perm_from INTEGER DEFAULT 0 NOT NULL,
- user_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_regdate INTEGER DEFAULT 0 NOT NULL,
- username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- username_clean VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_password VARCHAR(40) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_passchg INTEGER DEFAULT 0 NOT NULL,
- user_pass_convert INTEGER DEFAULT 0 NOT NULL,
- user_email VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_email_hash DOUBLE PRECISION DEFAULT 0 NOT NULL,
- user_birthday VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_lastvisit INTEGER DEFAULT 0 NOT NULL,
- user_lastmark INTEGER DEFAULT 0 NOT NULL,
- user_lastpost_time INTEGER DEFAULT 0 NOT NULL,
- user_lastpage VARCHAR(200) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_last_confirm_key VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_last_search INTEGER DEFAULT 0 NOT NULL,
- user_warnings INTEGER DEFAULT 0 NOT NULL,
- user_last_warning INTEGER DEFAULT 0 NOT NULL,
- user_login_attempts INTEGER DEFAULT 0 NOT NULL,
- user_inactive_reason INTEGER DEFAULT 0 NOT NULL,
- user_inactive_time INTEGER DEFAULT 0 NOT NULL,
- user_posts INTEGER DEFAULT 0 NOT NULL,
- user_lang VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_timezone VARCHAR(100) CHARACTER SET NONE DEFAULT 'UTC' NOT NULL,
- user_dateformat VARCHAR(30) CHARACTER SET UTF8 DEFAULT 'd M Y H:i' NOT NULL COLLATE UNICODE,
- user_style INTEGER DEFAULT 0 NOT NULL,
- user_rank INTEGER DEFAULT 0 NOT NULL,
- user_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_new_privmsg INTEGER DEFAULT 0 NOT NULL,
- user_unread_privmsg INTEGER DEFAULT 0 NOT NULL,
- user_last_privmsg INTEGER DEFAULT 0 NOT NULL,
- user_message_rules INTEGER DEFAULT 0 NOT NULL,
- user_full_folder INTEGER DEFAULT -3 NOT NULL,
- user_emailtime INTEGER DEFAULT 0 NOT NULL,
- user_topic_show_days INTEGER DEFAULT 0 NOT NULL,
- user_topic_sortby_type VARCHAR(1) CHARACTER SET NONE DEFAULT 't' NOT NULL,
- user_topic_sortby_dir VARCHAR(1) CHARACTER SET NONE DEFAULT 'd' NOT NULL,
- user_post_show_days INTEGER DEFAULT 0 NOT NULL,
- user_post_sortby_type VARCHAR(1) CHARACTER SET NONE DEFAULT 't' NOT NULL,
- user_post_sortby_dir VARCHAR(1) CHARACTER SET NONE DEFAULT 'a' NOT NULL,
- user_notify INTEGER DEFAULT 0 NOT NULL,
- user_notify_pm INTEGER DEFAULT 1 NOT NULL,
- user_notify_type INTEGER DEFAULT 0 NOT NULL,
- user_allow_pm INTEGER DEFAULT 1 NOT NULL,
- user_allow_viewonline INTEGER DEFAULT 1 NOT NULL,
- user_allow_viewemail INTEGER DEFAULT 1 NOT NULL,
- user_allow_massemail INTEGER DEFAULT 1 NOT NULL,
- user_options INTEGER DEFAULT 230271 NOT NULL,
- user_avatar VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_avatar_type 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 CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- user_sig_bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_sig_bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_from VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_icq VARCHAR(15) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_aim VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_yim VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_msnm VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_jabber VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_website VARCHAR(200) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_occ BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- user_interests BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
- user_actkey VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
- user_newpasswd VARCHAR(40) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_form_salt VARCHAR(32) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_new INTEGER DEFAULT 1 NOT NULL,
- user_reminded INTEGER DEFAULT 0 NOT NULL,
- user_reminded_time INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_users ADD PRIMARY KEY (user_id);;
-
-CREATE INDEX phpbb_users_user_birthday ON phpbb_users(user_birthday);;
-CREATE INDEX phpbb_users_user_email_hash ON phpbb_users(user_email_hash);;
-CREATE INDEX phpbb_users_user_type ON phpbb_users(user_type);;
-CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users(username_clean);;
-
-CREATE GENERATOR phpbb_users_gen;;
-SET GENERATOR phpbb_users_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_users FOR phpbb_users
-BEFORE INSERT
-AS
-BEGIN
- NEW.user_id = GEN_ID(phpbb_users_gen, 1);
-END;;
-
-
-# Table: 'phpbb_warnings'
-CREATE TABLE phpbb_warnings (
- warning_id INTEGER NOT NULL,
- user_id INTEGER DEFAULT 0 NOT NULL,
- post_id INTEGER DEFAULT 0 NOT NULL,
- log_id INTEGER DEFAULT 0 NOT NULL,
- warning_time INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_warnings ADD PRIMARY KEY (warning_id);;
-
-
-CREATE GENERATOR phpbb_warnings_gen;;
-SET GENERATOR phpbb_warnings_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_warnings FOR phpbb_warnings
-BEFORE INSERT
-AS
-BEGIN
- NEW.warning_id = GEN_ID(phpbb_warnings_gen, 1);
-END;;
-
-
-# Table: 'phpbb_words'
-CREATE TABLE phpbb_words (
- word_id INTEGER NOT NULL,
- word VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- replacement VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
-);;
-
-ALTER TABLE phpbb_words ADD PRIMARY KEY (word_id);;
-
-
-CREATE GENERATOR phpbb_words_gen;;
-SET GENERATOR phpbb_words_gen TO 0;;
-
-CREATE TRIGGER t_phpbb_words FOR phpbb_words
-BEFORE INSERT
-AS
-BEGIN
- NEW.word_id = GEN_ID(phpbb_words_gen, 1);
-END;;
-
-
-# Table: 'phpbb_zebra'
-CREATE TABLE phpbb_zebra (
- user_id INTEGER DEFAULT 0 NOT NULL,
- zebra_id INTEGER DEFAULT 0 NOT NULL,
- friend INTEGER DEFAULT 0 NOT NULL,
- foe INTEGER DEFAULT 0 NOT NULL
-);;
-
-ALTER TABLE phpbb_zebra ADD PRIMARY KEY (user_id, zebra_id);;
-
-
+# DO NOT EDIT THIS FILE, IT IS GENERATED
+#
+# To change the contents of this file, edit
+# phpBB/develop/create_schema_files.php and
+# run it.
+
+# Table: 'phpbb_attachments'
+CREATE TABLE phpbb_attachments (
+ attach_id INTEGER NOT NULL,
+ post_msg_id INTEGER DEFAULT 0 NOT NULL,
+ topic_id INTEGER DEFAULT 0 NOT NULL,
+ in_message INTEGER DEFAULT 0 NOT NULL,
+ poster_id INTEGER DEFAULT 0 NOT NULL,
+ is_orphan INTEGER DEFAULT 1 NOT NULL,
+ physical_filename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ real_filename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ download_count INTEGER DEFAULT 0 NOT NULL,
+ attach_comment BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ extension VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ mimetype VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ filesize INTEGER DEFAULT 0 NOT NULL,
+ filetime INTEGER DEFAULT 0 NOT NULL,
+ thumbnail INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_attachments ADD PRIMARY KEY (attach_id);;
+
+CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments(filetime);;
+CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments(post_msg_id);;
+CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments(topic_id);;
+CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments(poster_id);;
+CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments(is_orphan);;
+
+CREATE GENERATOR phpbb_attachments_gen;;
+SET GENERATOR phpbb_attachments_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_attachments FOR phpbb_attachments
+BEFORE INSERT
+AS
+BEGIN
+ NEW.attach_id = GEN_ID(phpbb_attachments_gen, 1);
+END;;
+
+
+# Table: 'phpbb_acl_groups'
+CREATE TABLE phpbb_acl_groups (
+ group_id INTEGER DEFAULT 0 NOT NULL,
+ forum_id INTEGER DEFAULT 0 NOT NULL,
+ auth_option_id INTEGER DEFAULT 0 NOT NULL,
+ auth_role_id INTEGER DEFAULT 0 NOT NULL,
+ auth_setting INTEGER DEFAULT 0 NOT NULL
+);;
+
+CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups(group_id);;
+CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups(auth_option_id);;
+CREATE INDEX phpbb_acl_groups_auth_role_id ON phpbb_acl_groups(auth_role_id);;
+
+# Table: 'phpbb_acl_options'
+CREATE TABLE phpbb_acl_options (
+ auth_option_id INTEGER NOT NULL,
+ auth_option VARCHAR(50) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ is_global INTEGER DEFAULT 0 NOT NULL,
+ is_local INTEGER DEFAULT 0 NOT NULL,
+ founder_only INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_acl_options ADD PRIMARY KEY (auth_option_id);;
+
+CREATE UNIQUE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options(auth_option);;
+
+CREATE GENERATOR phpbb_acl_options_gen;;
+SET GENERATOR phpbb_acl_options_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_acl_options FOR phpbb_acl_options
+BEFORE INSERT
+AS
+BEGIN
+ NEW.auth_option_id = GEN_ID(phpbb_acl_options_gen, 1);
+END;;
+
+
+# Table: 'phpbb_acl_roles'
+CREATE TABLE phpbb_acl_roles (
+ role_id INTEGER NOT NULL,
+ role_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ role_description BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ role_type VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ role_order INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_acl_roles ADD PRIMARY KEY (role_id);;
+
+CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles(role_type);;
+CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles(role_order);;
+
+CREATE GENERATOR phpbb_acl_roles_gen;;
+SET GENERATOR phpbb_acl_roles_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_acl_roles FOR phpbb_acl_roles
+BEFORE INSERT
+AS
+BEGIN
+ NEW.role_id = GEN_ID(phpbb_acl_roles_gen, 1);
+END;;
+
+
+# Table: 'phpbb_acl_roles_data'
+CREATE TABLE phpbb_acl_roles_data (
+ role_id INTEGER DEFAULT 0 NOT NULL,
+ auth_option_id INTEGER DEFAULT 0 NOT NULL,
+ auth_setting INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_acl_roles_data ADD PRIMARY KEY (role_id, auth_option_id);;
+
+CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data(auth_option_id);;
+
+# Table: 'phpbb_acl_users'
+CREATE TABLE phpbb_acl_users (
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ forum_id INTEGER DEFAULT 0 NOT NULL,
+ auth_option_id INTEGER DEFAULT 0 NOT NULL,
+ auth_role_id INTEGER DEFAULT 0 NOT NULL,
+ auth_setting INTEGER DEFAULT 0 NOT NULL
+);;
+
+CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users(user_id);;
+CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users(auth_option_id);;
+CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users(auth_role_id);;
+
+# Table: 'phpbb_banlist'
+CREATE TABLE phpbb_banlist (
+ ban_id INTEGER NOT NULL,
+ ban_userid INTEGER DEFAULT 0 NOT NULL,
+ ban_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ ban_email VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ ban_start INTEGER DEFAULT 0 NOT NULL,
+ ban_end INTEGER DEFAULT 0 NOT NULL,
+ ban_exclude INTEGER DEFAULT 0 NOT NULL,
+ ban_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ ban_give_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
+);;
+
+ALTER TABLE phpbb_banlist ADD PRIMARY KEY (ban_id);;
+
+CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist(ban_end);;
+CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist(ban_userid, ban_exclude);;
+CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist(ban_email, ban_exclude);;
+CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist(ban_ip, ban_exclude);;
+
+CREATE GENERATOR phpbb_banlist_gen;;
+SET GENERATOR phpbb_banlist_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_banlist FOR phpbb_banlist
+BEFORE INSERT
+AS
+BEGIN
+ NEW.ban_id = GEN_ID(phpbb_banlist_gen, 1);
+END;;
+
+
+# Table: 'phpbb_bbcodes'
+CREATE TABLE phpbb_bbcodes (
+ bbcode_id INTEGER DEFAULT 0 NOT NULL,
+ bbcode_tag VARCHAR(16) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ bbcode_helpline VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ display_on_posting INTEGER DEFAULT 0 NOT NULL,
+ bbcode_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ bbcode_tpl BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ first_pass_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ first_pass_replace BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ second_pass_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ second_pass_replace BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
+);;
+
+ALTER TABLE phpbb_bbcodes ADD PRIMARY KEY (bbcode_id);;
+
+CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes(display_on_posting);;
+
+# Table: 'phpbb_bookmarks'
+CREATE TABLE phpbb_bookmarks (
+ topic_id INTEGER DEFAULT 0 NOT NULL,
+ user_id INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_bookmarks ADD PRIMARY KEY (topic_id, user_id);;
+
+
+# Table: 'phpbb_bots'
+CREATE TABLE phpbb_bots (
+ bot_id INTEGER NOT NULL,
+ bot_active INTEGER DEFAULT 1 NOT NULL,
+ bot_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ bot_agent VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ bot_ip VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
+);;
+
+ALTER TABLE phpbb_bots ADD PRIMARY KEY (bot_id);;
+
+CREATE INDEX phpbb_bots_bot_active ON phpbb_bots(bot_active);;
+
+CREATE GENERATOR phpbb_bots_gen;;
+SET GENERATOR phpbb_bots_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_bots FOR phpbb_bots
+BEFORE INSERT
+AS
+BEGIN
+ NEW.bot_id = GEN_ID(phpbb_bots_gen, 1);
+END;;
+
+
+# Table: 'phpbb_config'
+CREATE TABLE phpbb_config (
+ config_name VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ config_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ is_dynamic INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_config ADD PRIMARY KEY (config_name);;
+
+CREATE INDEX phpbb_config_is_dynamic ON phpbb_config(is_dynamic);;
+
+# Table: 'phpbb_confirm'
+CREATE TABLE phpbb_confirm (
+ confirm_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ confirm_type INTEGER DEFAULT 0 NOT NULL,
+ code VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ seed INTEGER DEFAULT 0 NOT NULL,
+ attempts INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_confirm ADD PRIMARY KEY (session_id, confirm_id);;
+
+CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm(confirm_type);;
+
+# Table: 'phpbb_disallow'
+CREATE TABLE phpbb_disallow (
+ disallow_id INTEGER NOT NULL,
+ disallow_username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
+);;
+
+ALTER TABLE phpbb_disallow ADD PRIMARY KEY (disallow_id);;
+
+
+CREATE GENERATOR phpbb_disallow_gen;;
+SET GENERATOR phpbb_disallow_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_disallow FOR phpbb_disallow
+BEFORE INSERT
+AS
+BEGIN
+ NEW.disallow_id = GEN_ID(phpbb_disallow_gen, 1);
+END;;
+
+
+# Table: 'phpbb_drafts'
+CREATE TABLE phpbb_drafts (
+ draft_id INTEGER NOT NULL,
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ topic_id INTEGER DEFAULT 0 NOT NULL,
+ forum_id INTEGER DEFAULT 0 NOT NULL,
+ save_time INTEGER DEFAULT 0 NOT NULL,
+ draft_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ draft_message BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
+);;
+
+ALTER TABLE phpbb_drafts ADD PRIMARY KEY (draft_id);;
+
+CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts(save_time);;
+
+CREATE GENERATOR phpbb_drafts_gen;;
+SET GENERATOR phpbb_drafts_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_drafts FOR phpbb_drafts
+BEFORE INSERT
+AS
+BEGIN
+ NEW.draft_id = GEN_ID(phpbb_drafts_gen, 1);
+END;;
+
+
+# Table: 'phpbb_ext'
+CREATE TABLE phpbb_ext (
+ ext_name VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ ext_active INTEGER DEFAULT 0 NOT NULL,
+ ext_state BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL
+);;
+
+CREATE UNIQUE INDEX phpbb_ext_ext_name ON phpbb_ext(ext_name);;
+
+# Table: 'phpbb_extensions'
+CREATE TABLE phpbb_extensions (
+ extension_id INTEGER NOT NULL,
+ group_id INTEGER DEFAULT 0 NOT NULL,
+ extension VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL
+);;
+
+ALTER TABLE phpbb_extensions ADD PRIMARY KEY (extension_id);;
+
+
+CREATE GENERATOR phpbb_extensions_gen;;
+SET GENERATOR phpbb_extensions_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_extensions FOR phpbb_extensions
+BEFORE INSERT
+AS
+BEGIN
+ NEW.extension_id = GEN_ID(phpbb_extensions_gen, 1);
+END;;
+
+
+# Table: 'phpbb_extension_groups'
+CREATE TABLE phpbb_extension_groups (
+ group_id INTEGER NOT NULL,
+ group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ cat_id INTEGER DEFAULT 0 NOT NULL,
+ allow_group INTEGER DEFAULT 0 NOT NULL,
+ download_mode INTEGER DEFAULT 1 NOT NULL,
+ upload_icon VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ max_filesize INTEGER DEFAULT 0 NOT NULL,
+ allowed_forums BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL,
+ allow_in_pm INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_extension_groups ADD PRIMARY KEY (group_id);;
+
+
+CREATE GENERATOR phpbb_extension_groups_gen;;
+SET GENERATOR phpbb_extension_groups_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_extension_groups FOR phpbb_extension_groups
+BEFORE INSERT
+AS
+BEGIN
+ NEW.group_id = GEN_ID(phpbb_extension_groups_gen, 1);
+END;;
+
+
+# Table: 'phpbb_forums'
+CREATE TABLE phpbb_forums (
+ forum_id INTEGER NOT NULL,
+ parent_id INTEGER DEFAULT 0 NOT NULL,
+ left_id INTEGER DEFAULT 0 NOT NULL,
+ right_id INTEGER DEFAULT 0 NOT NULL,
+ forum_parents BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL,
+ forum_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ forum_desc BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ forum_desc_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ forum_desc_options INTEGER DEFAULT 7 NOT NULL,
+ forum_desc_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ forum_link VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ forum_password VARCHAR(40) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ forum_style INTEGER DEFAULT 0 NOT NULL,
+ forum_image VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ forum_rules BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ forum_rules_link VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ forum_rules_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ forum_rules_options INTEGER DEFAULT 7 NOT NULL,
+ forum_rules_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ forum_topics_per_page INTEGER DEFAULT 0 NOT NULL,
+ forum_type INTEGER DEFAULT 0 NOT NULL,
+ forum_status INTEGER DEFAULT 0 NOT NULL,
+ forum_posts INTEGER DEFAULT 0 NOT NULL,
+ forum_topics INTEGER DEFAULT 0 NOT NULL,
+ forum_topics_real INTEGER DEFAULT 0 NOT NULL,
+ forum_last_post_id INTEGER DEFAULT 0 NOT NULL,
+ forum_last_poster_id INTEGER DEFAULT 0 NOT NULL,
+ forum_last_post_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ forum_last_post_time INTEGER DEFAULT 0 NOT NULL,
+ forum_last_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ forum_last_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ forum_flags INTEGER DEFAULT 32 NOT NULL,
+ forum_options INTEGER DEFAULT 0 NOT NULL,
+ display_subforum_list INTEGER DEFAULT 1 NOT NULL,
+ display_on_index INTEGER DEFAULT 1 NOT NULL,
+ enable_indexing INTEGER DEFAULT 1 NOT NULL,
+ enable_icons INTEGER DEFAULT 1 NOT NULL,
+ enable_prune INTEGER DEFAULT 0 NOT NULL,
+ prune_next INTEGER DEFAULT 0 NOT NULL,
+ prune_days INTEGER DEFAULT 0 NOT NULL,
+ prune_viewed INTEGER DEFAULT 0 NOT NULL,
+ prune_freq INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_forums ADD PRIMARY KEY (forum_id);;
+
+CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums(left_id, right_id);;
+CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums(forum_last_post_id);;
+
+CREATE GENERATOR phpbb_forums_gen;;
+SET GENERATOR phpbb_forums_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_forums FOR phpbb_forums
+BEFORE INSERT
+AS
+BEGIN
+ NEW.forum_id = GEN_ID(phpbb_forums_gen, 1);
+END;;
+
+
+# Table: 'phpbb_forums_access'
+CREATE TABLE phpbb_forums_access (
+ forum_id INTEGER DEFAULT 0 NOT NULL,
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL
+);;
+
+ALTER TABLE phpbb_forums_access ADD PRIMARY KEY (forum_id, user_id, session_id);;
+
+
+# Table: 'phpbb_forums_track'
+CREATE TABLE phpbb_forums_track (
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ forum_id INTEGER DEFAULT 0 NOT NULL,
+ mark_time INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_forums_track ADD PRIMARY KEY (user_id, forum_id);;
+
+
+# Table: 'phpbb_forums_watch'
+CREATE TABLE phpbb_forums_watch (
+ forum_id INTEGER DEFAULT 0 NOT NULL,
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ notify_status INTEGER DEFAULT 0 NOT NULL
+);;
+
+CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch(forum_id);;
+CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch(user_id);;
+CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch(notify_status);;
+
+# Table: 'phpbb_groups'
+CREATE TABLE phpbb_groups (
+ group_id INTEGER NOT NULL,
+ group_type INTEGER DEFAULT 1 NOT NULL,
+ group_founder_manage INTEGER DEFAULT 0 NOT NULL,
+ group_skip_auth INTEGER DEFAULT 0 NOT NULL,
+ group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ group_desc BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ group_desc_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ group_desc_options INTEGER DEFAULT 7 NOT NULL,
+ group_desc_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ group_display INTEGER DEFAULT 0 NOT NULL,
+ group_avatar VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ group_avatar_type INTEGER DEFAULT 0 NOT NULL,
+ group_avatar_width INTEGER DEFAULT 0 NOT NULL,
+ group_avatar_height INTEGER DEFAULT 0 NOT NULL,
+ group_rank INTEGER DEFAULT 0 NOT NULL,
+ group_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ group_sig_chars INTEGER DEFAULT 0 NOT NULL,
+ group_receive_pm INTEGER DEFAULT 0 NOT NULL,
+ group_message_limit INTEGER DEFAULT 0 NOT NULL,
+ group_max_recipients INTEGER DEFAULT 0 NOT NULL,
+ group_legend INTEGER DEFAULT 0 NOT NULL,
+ group_teampage INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_groups ADD PRIMARY KEY (group_id);;
+
+CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups(group_legend, group_name);;
+
+CREATE GENERATOR phpbb_groups_gen;;
+SET GENERATOR phpbb_groups_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_groups FOR phpbb_groups
+BEFORE INSERT
+AS
+BEGIN
+ NEW.group_id = GEN_ID(phpbb_groups_gen, 1);
+END;;
+
+
+# Table: 'phpbb_icons'
+CREATE TABLE phpbb_icons (
+ icons_id INTEGER NOT NULL,
+ icons_url VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ icons_width INTEGER DEFAULT 0 NOT NULL,
+ icons_height INTEGER DEFAULT 0 NOT NULL,
+ icons_order INTEGER DEFAULT 0 NOT NULL,
+ display_on_posting INTEGER DEFAULT 1 NOT NULL
+);;
+
+ALTER TABLE phpbb_icons ADD PRIMARY KEY (icons_id);;
+
+CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons(display_on_posting);;
+
+CREATE GENERATOR phpbb_icons_gen;;
+SET GENERATOR phpbb_icons_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_icons FOR phpbb_icons
+BEFORE INSERT
+AS
+BEGIN
+ NEW.icons_id = GEN_ID(phpbb_icons_gen, 1);
+END;;
+
+
+# Table: 'phpbb_lang'
+CREATE TABLE phpbb_lang (
+ lang_id INTEGER NOT NULL,
+ lang_iso VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ lang_dir VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ lang_english_name VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ lang_local_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ lang_author VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
+);;
+
+ALTER TABLE phpbb_lang ADD PRIMARY KEY (lang_id);;
+
+CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang(lang_iso);;
+
+CREATE GENERATOR phpbb_lang_gen;;
+SET GENERATOR phpbb_lang_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_lang FOR phpbb_lang
+BEFORE INSERT
+AS
+BEGIN
+ NEW.lang_id = GEN_ID(phpbb_lang_gen, 1);
+END;;
+
+
+# Table: 'phpbb_log'
+CREATE TABLE phpbb_log (
+ log_id INTEGER NOT NULL,
+ log_type INTEGER DEFAULT 0 NOT NULL,
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ forum_id INTEGER DEFAULT 0 NOT NULL,
+ topic_id INTEGER DEFAULT 0 NOT NULL,
+ reportee_id INTEGER DEFAULT 0 NOT NULL,
+ log_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ log_time INTEGER DEFAULT 0 NOT NULL,
+ log_operation BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ log_data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
+);;
+
+ALTER TABLE phpbb_log ADD PRIMARY KEY (log_id);;
+
+CREATE INDEX phpbb_log_log_type ON phpbb_log(log_type);;
+CREATE INDEX phpbb_log_log_time ON phpbb_log(log_time);;
+CREATE INDEX phpbb_log_forum_id ON phpbb_log(forum_id);;
+CREATE INDEX phpbb_log_topic_id ON phpbb_log(topic_id);;
+CREATE INDEX phpbb_log_reportee_id ON phpbb_log(reportee_id);;
+CREATE INDEX phpbb_log_user_id ON phpbb_log(user_id);;
+
+CREATE GENERATOR phpbb_log_gen;;
+SET GENERATOR phpbb_log_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_log FOR phpbb_log
+BEFORE INSERT
+AS
+BEGIN
+ NEW.log_id = GEN_ID(phpbb_log_gen, 1);
+END;;
+
+
+# Table: 'phpbb_login_attempts'
+CREATE TABLE phpbb_login_attempts (
+ attempt_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ attempt_browser VARCHAR(150) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ attempt_forwarded_for VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ attempt_time INTEGER DEFAULT 0 NOT NULL,
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ username VARCHAR(255) CHARACTER SET UTF8 DEFAULT 0 NOT NULL COLLATE UNICODE,
+ username_clean VARCHAR(255) CHARACTER SET UTF8 DEFAULT 0 NOT NULL COLLATE UNICODE
+);;
+
+CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts(attempt_ip, attempt_time);;
+CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts(attempt_forwarded_for, attempt_time);;
+CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts(attempt_time);;
+CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts(user_id);;
+
+# Table: 'phpbb_moderator_cache'
+CREATE TABLE phpbb_moderator_cache (
+ forum_id INTEGER DEFAULT 0 NOT NULL,
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ group_id INTEGER DEFAULT 0 NOT NULL,
+ group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ display_on_index INTEGER DEFAULT 1 NOT NULL
+);;
+
+CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache(display_on_index);;
+CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache(forum_id);;
+
+# Table: 'phpbb_modules'
+CREATE TABLE phpbb_modules (
+ module_id INTEGER NOT NULL,
+ module_enabled INTEGER DEFAULT 1 NOT NULL,
+ module_display INTEGER DEFAULT 1 NOT NULL,
+ module_basename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ module_class VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ parent_id INTEGER DEFAULT 0 NOT NULL,
+ left_id INTEGER DEFAULT 0 NOT NULL,
+ right_id INTEGER DEFAULT 0 NOT NULL,
+ module_langname VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ module_mode VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ module_auth VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
+);;
+
+ALTER TABLE phpbb_modules ADD PRIMARY KEY (module_id);;
+
+CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules(left_id, right_id);;
+CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules(module_enabled);;
+CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules(module_class, left_id);;
+
+CREATE GENERATOR phpbb_modules_gen;;
+SET GENERATOR phpbb_modules_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_modules FOR phpbb_modules
+BEFORE INSERT
+AS
+BEGIN
+ NEW.module_id = GEN_ID(phpbb_modules_gen, 1);
+END;;
+
+
+# Table: 'phpbb_poll_options'
+CREATE TABLE phpbb_poll_options (
+ poll_option_id INTEGER DEFAULT 0 NOT NULL,
+ topic_id INTEGER DEFAULT 0 NOT NULL,
+ poll_option_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ poll_option_total INTEGER DEFAULT 0 NOT NULL
+);;
+
+CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options(poll_option_id);;
+CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options(topic_id);;
+
+# Table: 'phpbb_poll_votes'
+CREATE TABLE phpbb_poll_votes (
+ topic_id INTEGER DEFAULT 0 NOT NULL,
+ poll_option_id INTEGER DEFAULT 0 NOT NULL,
+ vote_user_id INTEGER DEFAULT 0 NOT NULL,
+ vote_user_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL
+);;
+
+CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes(topic_id);;
+CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes(vote_user_id);;
+CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes(vote_user_ip);;
+
+# Table: 'phpbb_posts'
+CREATE TABLE phpbb_posts (
+ post_id INTEGER NOT NULL,
+ topic_id INTEGER DEFAULT 0 NOT NULL,
+ forum_id INTEGER DEFAULT 0 NOT NULL,
+ poster_id INTEGER DEFAULT 0 NOT NULL,
+ icon_id INTEGER DEFAULT 0 NOT NULL,
+ poster_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ post_time INTEGER DEFAULT 0 NOT NULL,
+ post_approved INTEGER DEFAULT 1 NOT NULL,
+ post_reported INTEGER DEFAULT 0 NOT NULL,
+ enable_bbcode INTEGER DEFAULT 1 NOT NULL,
+ enable_smilies INTEGER DEFAULT 1 NOT NULL,
+ enable_magic_url INTEGER DEFAULT 1 NOT NULL,
+ enable_sig INTEGER DEFAULT 1 NOT NULL,
+ post_username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ post_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ post_checksum VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ post_attachment INTEGER DEFAULT 0 NOT NULL,
+ bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ post_postcount INTEGER DEFAULT 1 NOT NULL,
+ post_edit_time INTEGER DEFAULT 0 NOT NULL,
+ post_edit_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ post_edit_user INTEGER DEFAULT 0 NOT NULL,
+ post_edit_count INTEGER DEFAULT 0 NOT NULL,
+ post_edit_locked INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_posts ADD PRIMARY KEY (post_id);;
+
+CREATE INDEX phpbb_posts_forum_id ON phpbb_posts(forum_id);;
+CREATE INDEX phpbb_posts_topic_id ON phpbb_posts(topic_id);;
+CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts(poster_ip);;
+CREATE INDEX phpbb_posts_poster_id ON phpbb_posts(poster_id);;
+CREATE INDEX phpbb_posts_post_approved ON phpbb_posts(post_approved);;
+CREATE INDEX phpbb_posts_post_username ON phpbb_posts(post_username);;
+CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts(topic_id, post_time);;
+
+CREATE GENERATOR phpbb_posts_gen;;
+SET GENERATOR phpbb_posts_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_posts FOR phpbb_posts
+BEFORE INSERT
+AS
+BEGIN
+ NEW.post_id = GEN_ID(phpbb_posts_gen, 1);
+END;;
+
+
+# Table: 'phpbb_privmsgs'
+CREATE TABLE phpbb_privmsgs (
+ msg_id INTEGER NOT NULL,
+ root_level INTEGER DEFAULT 0 NOT NULL,
+ author_id INTEGER DEFAULT 0 NOT NULL,
+ icon_id INTEGER DEFAULT 0 NOT NULL,
+ author_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ message_time INTEGER DEFAULT 0 NOT NULL,
+ enable_bbcode INTEGER DEFAULT 1 NOT NULL,
+ enable_smilies INTEGER DEFAULT 1 NOT NULL,
+ enable_magic_url INTEGER DEFAULT 1 NOT NULL,
+ enable_sig INTEGER DEFAULT 1 NOT NULL,
+ message_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ message_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ message_edit_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ message_edit_user INTEGER DEFAULT 0 NOT NULL,
+ message_attachment INTEGER DEFAULT 0 NOT NULL,
+ bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ message_edit_time INTEGER DEFAULT 0 NOT NULL,
+ message_edit_count INTEGER DEFAULT 0 NOT NULL,
+ to_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ bcc_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ message_reported INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_privmsgs ADD PRIMARY KEY (msg_id);;
+
+CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs(author_ip);;
+CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs(message_time);;
+CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs(author_id);;
+CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs(root_level);;
+
+CREATE GENERATOR phpbb_privmsgs_gen;;
+SET GENERATOR phpbb_privmsgs_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_privmsgs FOR phpbb_privmsgs
+BEFORE INSERT
+AS
+BEGIN
+ NEW.msg_id = GEN_ID(phpbb_privmsgs_gen, 1);
+END;;
+
+
+# Table: 'phpbb_privmsgs_folder'
+CREATE TABLE phpbb_privmsgs_folder (
+ folder_id INTEGER NOT NULL,
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ folder_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ pm_count INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_privmsgs_folder ADD PRIMARY KEY (folder_id);;
+
+CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder(user_id);;
+
+CREATE GENERATOR phpbb_privmsgs_folder_gen;;
+SET GENERATOR phpbb_privmsgs_folder_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_privmsgs_folder FOR phpbb_privmsgs_folder
+BEFORE INSERT
+AS
+BEGIN
+ NEW.folder_id = GEN_ID(phpbb_privmsgs_folder_gen, 1);
+END;;
+
+
+# Table: 'phpbb_privmsgs_rules'
+CREATE TABLE phpbb_privmsgs_rules (
+ rule_id INTEGER NOT NULL,
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ rule_check INTEGER DEFAULT 0 NOT NULL,
+ rule_connection INTEGER DEFAULT 0 NOT NULL,
+ rule_string VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ rule_user_id INTEGER DEFAULT 0 NOT NULL,
+ rule_group_id INTEGER DEFAULT 0 NOT NULL,
+ rule_action INTEGER DEFAULT 0 NOT NULL,
+ rule_folder_id INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_privmsgs_rules ADD PRIMARY KEY (rule_id);;
+
+CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules(user_id);;
+
+CREATE GENERATOR phpbb_privmsgs_rules_gen;;
+SET GENERATOR phpbb_privmsgs_rules_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_privmsgs_rules FOR phpbb_privmsgs_rules
+BEFORE INSERT
+AS
+BEGIN
+ NEW.rule_id = GEN_ID(phpbb_privmsgs_rules_gen, 1);
+END;;
+
+
+# Table: 'phpbb_privmsgs_to'
+CREATE TABLE phpbb_privmsgs_to (
+ msg_id INTEGER DEFAULT 0 NOT NULL,
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ author_id INTEGER DEFAULT 0 NOT NULL,
+ pm_deleted INTEGER DEFAULT 0 NOT NULL,
+ pm_new INTEGER DEFAULT 1 NOT NULL,
+ pm_unread INTEGER DEFAULT 1 NOT NULL,
+ pm_replied INTEGER DEFAULT 0 NOT NULL,
+ pm_marked INTEGER DEFAULT 0 NOT NULL,
+ pm_forwarded INTEGER DEFAULT 0 NOT NULL,
+ folder_id INTEGER DEFAULT 0 NOT NULL
+);;
+
+CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to(msg_id);;
+CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to(author_id);;
+CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to(user_id, folder_id);;
+
+# Table: 'phpbb_profile_fields'
+CREATE TABLE phpbb_profile_fields (
+ field_id INTEGER NOT NULL,
+ field_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ field_type INTEGER DEFAULT 0 NOT NULL,
+ field_ident VARCHAR(20) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ field_length VARCHAR(20) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ field_minlen VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ field_maxlen VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ field_novalue VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ field_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ field_validation VARCHAR(20) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ field_required INTEGER DEFAULT 0 NOT NULL,
+ field_show_novalue INTEGER DEFAULT 0 NOT NULL,
+ field_show_on_reg INTEGER DEFAULT 0 NOT NULL,
+ field_show_on_pm INTEGER DEFAULT 0 NOT NULL,
+ field_show_on_vt INTEGER DEFAULT 0 NOT NULL,
+ field_show_profile INTEGER DEFAULT 0 NOT NULL,
+ field_hide INTEGER DEFAULT 0 NOT NULL,
+ field_no_view INTEGER DEFAULT 0 NOT NULL,
+ field_active INTEGER DEFAULT 0 NOT NULL,
+ field_order INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_profile_fields ADD PRIMARY KEY (field_id);;
+
+CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields(field_type);;
+CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields(field_order);;
+
+CREATE GENERATOR phpbb_profile_fields_gen;;
+SET GENERATOR phpbb_profile_fields_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_profile_fields FOR phpbb_profile_fields
+BEFORE INSERT
+AS
+BEGIN
+ NEW.field_id = GEN_ID(phpbb_profile_fields_gen, 1);
+END;;
+
+
+# Table: 'phpbb_profile_fields_data'
+CREATE TABLE phpbb_profile_fields_data (
+ user_id INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_profile_fields_data ADD PRIMARY KEY (user_id);;
+
+
+# Table: 'phpbb_profile_fields_lang'
+CREATE TABLE phpbb_profile_fields_lang (
+ field_id INTEGER DEFAULT 0 NOT NULL,
+ lang_id INTEGER DEFAULT 0 NOT NULL,
+ option_id INTEGER DEFAULT 0 NOT NULL,
+ field_type INTEGER DEFAULT 0 NOT NULL,
+ lang_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
+);;
+
+ALTER TABLE phpbb_profile_fields_lang ADD PRIMARY KEY (field_id, lang_id, option_id);;
+
+
+# Table: 'phpbb_profile_lang'
+CREATE TABLE phpbb_profile_lang (
+ field_id INTEGER DEFAULT 0 NOT NULL,
+ lang_id INTEGER DEFAULT 0 NOT NULL,
+ lang_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ lang_explain BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ lang_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
+);;
+
+ALTER TABLE phpbb_profile_lang ADD PRIMARY KEY (field_id, lang_id);;
+
+
+# Table: 'phpbb_ranks'
+CREATE TABLE phpbb_ranks (
+ rank_id INTEGER NOT NULL,
+ rank_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ rank_min INTEGER DEFAULT 0 NOT NULL,
+ rank_special INTEGER DEFAULT 0 NOT NULL,
+ rank_image VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
+);;
+
+ALTER TABLE phpbb_ranks ADD PRIMARY KEY (rank_id);;
+
+
+CREATE GENERATOR phpbb_ranks_gen;;
+SET GENERATOR phpbb_ranks_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_ranks FOR phpbb_ranks
+BEFORE INSERT
+AS
+BEGIN
+ NEW.rank_id = GEN_ID(phpbb_ranks_gen, 1);
+END;;
+
+
+# Table: 'phpbb_reports'
+CREATE TABLE phpbb_reports (
+ report_id INTEGER NOT NULL,
+ reason_id INTEGER DEFAULT 0 NOT NULL,
+ post_id INTEGER DEFAULT 0 NOT NULL,
+ pm_id INTEGER DEFAULT 0 NOT NULL,
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ user_notify INTEGER DEFAULT 0 NOT NULL,
+ report_closed INTEGER DEFAULT 0 NOT NULL,
+ report_time INTEGER DEFAULT 0 NOT NULL,
+ report_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ reported_post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
+);;
+
+ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);;
+
+CREATE INDEX phpbb_reports_post_id ON phpbb_reports(post_id);;
+CREATE INDEX phpbb_reports_pm_id ON phpbb_reports(pm_id);;
+
+CREATE GENERATOR phpbb_reports_gen;;
+SET GENERATOR phpbb_reports_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_reports FOR phpbb_reports
+BEFORE INSERT
+AS
+BEGIN
+ NEW.report_id = GEN_ID(phpbb_reports_gen, 1);
+END;;
+
+
+# Table: 'phpbb_reports_reasons'
+CREATE TABLE phpbb_reports_reasons (
+ reason_id INTEGER NOT NULL,
+ reason_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ reason_description BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ reason_order INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_reports_reasons ADD PRIMARY KEY (reason_id);;
+
+
+CREATE GENERATOR phpbb_reports_reasons_gen;;
+SET GENERATOR phpbb_reports_reasons_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_reports_reasons FOR phpbb_reports_reasons
+BEFORE INSERT
+AS
+BEGIN
+ NEW.reason_id = GEN_ID(phpbb_reports_reasons_gen, 1);
+END;;
+
+
+# Table: 'phpbb_search_results'
+CREATE TABLE phpbb_search_results (
+ search_key VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ search_time INTEGER DEFAULT 0 NOT NULL,
+ search_keywords BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ search_authors BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL
+);;
+
+ALTER TABLE phpbb_search_results ADD PRIMARY KEY (search_key);;
+
+
+# Table: 'phpbb_search_wordlist'
+CREATE TABLE phpbb_search_wordlist (
+ word_id INTEGER NOT NULL,
+ word_text VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ word_common INTEGER DEFAULT 0 NOT NULL,
+ word_count INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_search_wordlist ADD PRIMARY KEY (word_id);;
+
+CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist(word_text);;
+CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist(word_count);;
+
+CREATE GENERATOR phpbb_search_wordlist_gen;;
+SET GENERATOR phpbb_search_wordlist_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_search_wordlist FOR phpbb_search_wordlist
+BEFORE INSERT
+AS
+BEGIN
+ NEW.word_id = GEN_ID(phpbb_search_wordlist_gen, 1);
+END;;
+
+
+# Table: 'phpbb_search_wordmatch'
+CREATE TABLE phpbb_search_wordmatch (
+ post_id INTEGER DEFAULT 0 NOT NULL,
+ word_id INTEGER DEFAULT 0 NOT NULL,
+ title_match INTEGER DEFAULT 0 NOT NULL
+);;
+
+CREATE UNIQUE INDEX phpbb_search_wordmatch_unq_mtch ON phpbb_search_wordmatch(word_id, post_id, title_match);;
+CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch(word_id);;
+CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch(post_id);;
+
+# Table: 'phpbb_sessions'
+CREATE TABLE phpbb_sessions (
+ session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ session_user_id INTEGER DEFAULT 0 NOT NULL,
+ session_forum_id INTEGER DEFAULT 0 NOT NULL,
+ session_last_visit INTEGER DEFAULT 0 NOT NULL,
+ session_start INTEGER DEFAULT 0 NOT NULL,
+ session_time INTEGER DEFAULT 0 NOT NULL,
+ session_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ session_browser VARCHAR(150) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ session_forwarded_for VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ session_page VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ session_viewonline INTEGER DEFAULT 1 NOT NULL,
+ session_autologin INTEGER DEFAULT 0 NOT NULL,
+ session_admin INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_sessions ADD PRIMARY KEY (session_id);;
+
+CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions(session_time);;
+CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions(session_user_id);;
+CREATE INDEX phpbb_sessions_session_fid ON phpbb_sessions(session_forum_id);;
+
+# Table: 'phpbb_sessions_keys'
+CREATE TABLE phpbb_sessions_keys (
+ key_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ last_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ last_login INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_sessions_keys ADD PRIMARY KEY (key_id, user_id);;
+
+CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys(last_login);;
+
+# Table: 'phpbb_sitelist'
+CREATE TABLE phpbb_sitelist (
+ site_id INTEGER NOT NULL,
+ site_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ site_hostname VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ ip_exclude INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_sitelist ADD PRIMARY KEY (site_id);;
+
+
+CREATE GENERATOR phpbb_sitelist_gen;;
+SET GENERATOR phpbb_sitelist_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_sitelist FOR phpbb_sitelist
+BEFORE INSERT
+AS
+BEGIN
+ NEW.site_id = GEN_ID(phpbb_sitelist_gen, 1);
+END;;
+
+
+# Table: 'phpbb_smilies'
+CREATE TABLE phpbb_smilies (
+ smiley_id INTEGER NOT NULL,
+ code VARCHAR(50) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ emotion VARCHAR(50) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ smiley_url VARCHAR(50) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ smiley_width INTEGER DEFAULT 0 NOT NULL,
+ smiley_height INTEGER DEFAULT 0 NOT NULL,
+ smiley_order INTEGER DEFAULT 0 NOT NULL,
+ display_on_posting INTEGER DEFAULT 1 NOT NULL
+);;
+
+ALTER TABLE phpbb_smilies ADD PRIMARY KEY (smiley_id);;
+
+CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies(display_on_posting);;
+
+CREATE GENERATOR phpbb_smilies_gen;;
+SET GENERATOR phpbb_smilies_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_smilies FOR phpbb_smilies
+BEFORE INSERT
+AS
+BEGIN
+ NEW.smiley_id = GEN_ID(phpbb_smilies_gen, 1);
+END;;
+
+
+# Table: 'phpbb_styles'
+CREATE TABLE phpbb_styles (
+ style_id INTEGER NOT NULL,
+ style_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ style_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ style_active INTEGER DEFAULT 1 NOT NULL,
+ style_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT 'kNg=' NOT NULL,
+ style_parent_id INTEGER DEFAULT 0 NOT NULL,
+ style_parent_tree BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL
+);;
+
+ALTER TABLE phpbb_styles ADD PRIMARY KEY (style_id);;
+
+CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles(style_name);;
+
+CREATE GENERATOR phpbb_styles_gen;;
+SET GENERATOR phpbb_styles_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_styles FOR phpbb_styles
+BEFORE INSERT
+AS
+BEGIN
+ NEW.style_id = GEN_ID(phpbb_styles_gen, 1);
+END;;
+
+
+# Table: 'phpbb_topics'
+CREATE TABLE phpbb_topics (
+ topic_id INTEGER NOT NULL,
+ forum_id INTEGER DEFAULT 0 NOT NULL,
+ icon_id INTEGER DEFAULT 0 NOT NULL,
+ topic_attachment INTEGER DEFAULT 0 NOT NULL,
+ topic_approved INTEGER DEFAULT 1 NOT NULL,
+ topic_reported INTEGER DEFAULT 0 NOT NULL,
+ topic_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ topic_poster INTEGER DEFAULT 0 NOT NULL,
+ topic_time INTEGER DEFAULT 0 NOT NULL,
+ topic_time_limit INTEGER DEFAULT 0 NOT NULL,
+ topic_views INTEGER DEFAULT 0 NOT NULL,
+ topic_replies INTEGER DEFAULT 0 NOT NULL,
+ topic_replies_real INTEGER DEFAULT 0 NOT NULL,
+ topic_status INTEGER DEFAULT 0 NOT NULL,
+ topic_type INTEGER DEFAULT 0 NOT NULL,
+ topic_first_post_id INTEGER DEFAULT 0 NOT NULL,
+ topic_first_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ topic_first_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ topic_last_post_id INTEGER DEFAULT 0 NOT NULL,
+ topic_last_poster_id INTEGER DEFAULT 0 NOT NULL,
+ topic_last_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ topic_last_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ topic_last_post_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ topic_last_post_time INTEGER DEFAULT 0 NOT NULL,
+ topic_last_view_time INTEGER DEFAULT 0 NOT NULL,
+ topic_moved_id INTEGER DEFAULT 0 NOT NULL,
+ topic_bumped INTEGER DEFAULT 0 NOT NULL,
+ topic_bumper INTEGER DEFAULT 0 NOT NULL,
+ poll_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ poll_start INTEGER DEFAULT 0 NOT NULL,
+ poll_length INTEGER DEFAULT 0 NOT NULL,
+ poll_max_options INTEGER DEFAULT 1 NOT NULL,
+ poll_last_vote INTEGER DEFAULT 0 NOT NULL,
+ poll_vote_change INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_topics ADD PRIMARY KEY (topic_id);;
+
+CREATE INDEX phpbb_topics_forum_id ON phpbb_topics(forum_id);;
+CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics(forum_id, topic_type);;
+CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics(topic_last_post_time);;
+CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics(topic_approved);;
+CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics(forum_id, topic_approved, topic_last_post_id);;
+CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics(forum_id, topic_last_post_time, topic_moved_id);;
+
+CREATE GENERATOR phpbb_topics_gen;;
+SET GENERATOR phpbb_topics_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_topics FOR phpbb_topics
+BEFORE INSERT
+AS
+BEGIN
+ NEW.topic_id = GEN_ID(phpbb_topics_gen, 1);
+END;;
+
+
+# Table: 'phpbb_topics_track'
+CREATE TABLE phpbb_topics_track (
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ topic_id INTEGER DEFAULT 0 NOT NULL,
+ forum_id INTEGER DEFAULT 0 NOT NULL,
+ mark_time INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_topics_track ADD PRIMARY KEY (user_id, topic_id);;
+
+CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track(topic_id);;
+CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track(forum_id);;
+
+# Table: 'phpbb_topics_posted'
+CREATE TABLE phpbb_topics_posted (
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ topic_id INTEGER DEFAULT 0 NOT NULL,
+ topic_posted INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_topics_posted ADD PRIMARY KEY (user_id, topic_id);;
+
+
+# Table: 'phpbb_topics_watch'
+CREATE TABLE phpbb_topics_watch (
+ topic_id INTEGER DEFAULT 0 NOT NULL,
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ notify_status INTEGER DEFAULT 0 NOT NULL
+);;
+
+CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch(topic_id);;
+CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch(user_id);;
+CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch(notify_status);;
+
+# Table: 'phpbb_user_group'
+CREATE TABLE phpbb_user_group (
+ group_id INTEGER DEFAULT 0 NOT NULL,
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ group_leader INTEGER DEFAULT 0 NOT NULL,
+ user_pending INTEGER DEFAULT 1 NOT NULL
+);;
+
+CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group(group_id);;
+CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group(user_id);;
+CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group(group_leader);;
+
+# Table: 'phpbb_users'
+CREATE TABLE phpbb_users (
+ user_id INTEGER NOT NULL,
+ user_type INTEGER DEFAULT 0 NOT NULL,
+ group_id INTEGER DEFAULT 3 NOT NULL,
+ user_permissions BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL,
+ user_perm_from INTEGER DEFAULT 0 NOT NULL,
+ user_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ user_regdate INTEGER DEFAULT 0 NOT NULL,
+ username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ username_clean VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ user_password VARCHAR(40) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ user_passchg INTEGER DEFAULT 0 NOT NULL,
+ user_pass_convert INTEGER DEFAULT 0 NOT NULL,
+ user_email VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ user_email_hash DOUBLE PRECISION DEFAULT 0 NOT NULL,
+ user_birthday VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ user_lastvisit INTEGER DEFAULT 0 NOT NULL,
+ user_lastmark INTEGER DEFAULT 0 NOT NULL,
+ user_lastpost_time INTEGER DEFAULT 0 NOT NULL,
+ user_lastpage VARCHAR(200) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ user_last_confirm_key VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ user_last_search INTEGER DEFAULT 0 NOT NULL,
+ user_warnings INTEGER DEFAULT 0 NOT NULL,
+ user_last_warning INTEGER DEFAULT 0 NOT NULL,
+ user_login_attempts INTEGER DEFAULT 0 NOT NULL,
+ user_inactive_reason INTEGER DEFAULT 0 NOT NULL,
+ user_inactive_time INTEGER DEFAULT 0 NOT NULL,
+ user_posts INTEGER DEFAULT 0 NOT NULL,
+ user_lang VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ user_timezone VARCHAR(100) CHARACTER SET NONE DEFAULT 'UTC' NOT NULL,
+ user_dateformat VARCHAR(30) CHARACTER SET UTF8 DEFAULT 'd M Y H:i' NOT NULL COLLATE UNICODE,
+ user_style INTEGER DEFAULT 0 NOT NULL,
+ user_rank INTEGER DEFAULT 0 NOT NULL,
+ user_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ user_new_privmsg INTEGER DEFAULT 0 NOT NULL,
+ user_unread_privmsg INTEGER DEFAULT 0 NOT NULL,
+ user_last_privmsg INTEGER DEFAULT 0 NOT NULL,
+ user_message_rules INTEGER DEFAULT 0 NOT NULL,
+ user_full_folder INTEGER DEFAULT -3 NOT NULL,
+ user_emailtime INTEGER DEFAULT 0 NOT NULL,
+ user_topic_show_days INTEGER DEFAULT 0 NOT NULL,
+ user_topic_sortby_type VARCHAR(1) CHARACTER SET NONE DEFAULT 't' NOT NULL,
+ user_topic_sortby_dir VARCHAR(1) CHARACTER SET NONE DEFAULT 'd' NOT NULL,
+ user_post_show_days INTEGER DEFAULT 0 NOT NULL,
+ user_post_sortby_type VARCHAR(1) CHARACTER SET NONE DEFAULT 't' NOT NULL,
+ user_post_sortby_dir VARCHAR(1) CHARACTER SET NONE DEFAULT 'a' NOT NULL,
+ user_notify INTEGER DEFAULT 0 NOT NULL,
+ user_notify_pm INTEGER DEFAULT 1 NOT NULL,
+ user_notify_type INTEGER DEFAULT 0 NOT NULL,
+ user_allow_pm INTEGER DEFAULT 1 NOT NULL,
+ user_allow_viewonline INTEGER DEFAULT 1 NOT NULL,
+ user_allow_viewemail INTEGER DEFAULT 1 NOT NULL,
+ user_allow_massemail INTEGER DEFAULT 1 NOT NULL,
+ user_options INTEGER DEFAULT 230271 NOT NULL,
+ user_avatar VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ user_avatar_type 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 CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ user_sig_bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ user_sig_bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ user_from VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ user_icq VARCHAR(15) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ user_aim VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ user_yim VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ user_msnm VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ user_jabber VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ user_website VARCHAR(200) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ user_occ BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ user_interests BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
+ user_actkey VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ user_newpasswd VARCHAR(40) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ user_form_salt VARCHAR(32) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ user_new INTEGER DEFAULT 1 NOT NULL,
+ user_reminded INTEGER DEFAULT 0 NOT NULL,
+ user_reminded_time INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_users ADD PRIMARY KEY (user_id);;
+
+CREATE INDEX phpbb_users_user_birthday ON phpbb_users(user_birthday);;
+CREATE INDEX phpbb_users_user_email_hash ON phpbb_users(user_email_hash);;
+CREATE INDEX phpbb_users_user_type ON phpbb_users(user_type);;
+CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users(username_clean);;
+
+CREATE GENERATOR phpbb_users_gen;;
+SET GENERATOR phpbb_users_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_users FOR phpbb_users
+BEFORE INSERT
+AS
+BEGIN
+ NEW.user_id = GEN_ID(phpbb_users_gen, 1);
+END;;
+
+
+# Table: 'phpbb_warnings'
+CREATE TABLE phpbb_warnings (
+ warning_id INTEGER NOT NULL,
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ post_id INTEGER DEFAULT 0 NOT NULL,
+ log_id INTEGER DEFAULT 0 NOT NULL,
+ warning_time INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_warnings ADD PRIMARY KEY (warning_id);;
+
+
+CREATE GENERATOR phpbb_warnings_gen;;
+SET GENERATOR phpbb_warnings_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_warnings FOR phpbb_warnings
+BEFORE INSERT
+AS
+BEGIN
+ NEW.warning_id = GEN_ID(phpbb_warnings_gen, 1);
+END;;
+
+
+# Table: 'phpbb_words'
+CREATE TABLE phpbb_words (
+ word_id INTEGER NOT NULL,
+ word VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ replacement VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
+);;
+
+ALTER TABLE phpbb_words ADD PRIMARY KEY (word_id);;
+
+
+CREATE GENERATOR phpbb_words_gen;;
+SET GENERATOR phpbb_words_gen TO 0;;
+
+CREATE TRIGGER t_phpbb_words FOR phpbb_words
+BEFORE INSERT
+AS
+BEGIN
+ NEW.word_id = GEN_ID(phpbb_words_gen, 1);
+END;;
+
+
+# Table: 'phpbb_zebra'
+CREATE TABLE phpbb_zebra (
+ user_id INTEGER DEFAULT 0 NOT NULL,
+ zebra_id INTEGER DEFAULT 0 NOT NULL,
+ friend INTEGER DEFAULT 0 NOT NULL,
+ foe INTEGER DEFAULT 0 NOT NULL
+);;
+
+ALTER TABLE phpbb_zebra ADD PRIMARY KEY (user_id, zebra_id);;
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index 9d0e81a66d..9c393b8361 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -1,1657 +1,1655 @@
-/*
- * DO NOT EDIT THIS FILE, IT IS GENERATED
- *
- * To change the contents of this file, edit
- * phpBB/develop/create_schema_files.php and
- * run it.
- */
-
-/*
- Table: 'phpbb_attachments'
-*/
-CREATE TABLE [phpbb_attachments] (
- [attach_id] [int] IDENTITY (1, 1) NOT NULL ,
- [post_msg_id] [int] DEFAULT (0) NOT NULL ,
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [in_message] [int] DEFAULT (0) NOT NULL ,
- [poster_id] [int] DEFAULT (0) NOT NULL ,
- [is_orphan] [int] DEFAULT (1) NOT NULL ,
- [physical_filename] [varchar] (255) DEFAULT ('') NOT NULL ,
- [real_filename] [varchar] (255) DEFAULT ('') NOT NULL ,
- [download_count] [int] DEFAULT (0) NOT NULL ,
- [attach_comment] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [extension] [varchar] (100) DEFAULT ('') NOT NULL ,
- [mimetype] [varchar] (100) DEFAULT ('') NOT NULL ,
- [filesize] [int] DEFAULT (0) NOT NULL ,
- [filetime] [int] DEFAULT (0) NOT NULL ,
- [thumbnail] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_attachments] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_attachments] PRIMARY KEY CLUSTERED
- (
- [attach_id]
- ) ON [PRIMARY]
-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 [is_orphan] ON [phpbb_attachments]([is_orphan]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_acl_groups'
-*/
-CREATE TABLE [phpbb_acl_groups] (
- [group_id] [int] DEFAULT (0) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [auth_option_id] [int] DEFAULT (0) NOT NULL ,
- [auth_role_id] [int] DEFAULT (0) NOT NULL ,
- [auth_setting] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-CREATE INDEX [group_id] ON [phpbb_acl_groups]([group_id]) ON [PRIMARY]
-GO
-
-CREATE INDEX [auth_opt_id] ON [phpbb_acl_groups]([auth_option_id]) ON [PRIMARY]
-GO
-
-CREATE INDEX [auth_role_id] ON [phpbb_acl_groups]([auth_role_id]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_acl_options'
-*/
-CREATE TABLE [phpbb_acl_options] (
- [auth_option_id] [int] IDENTITY (1, 1) NOT NULL ,
- [auth_option] [varchar] (50) DEFAULT ('') NOT NULL ,
- [is_global] [int] DEFAULT (0) NOT NULL ,
- [is_local] [int] DEFAULT (0) NOT NULL ,
- [founder_only] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_acl_options] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_acl_options] PRIMARY KEY CLUSTERED
- (
- [auth_option_id]
- ) ON [PRIMARY]
-GO
-
-CREATE UNIQUE INDEX [auth_option] ON [phpbb_acl_options]([auth_option]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_acl_roles'
-*/
-CREATE TABLE [phpbb_acl_roles] (
- [role_id] [int] IDENTITY (1, 1) NOT NULL ,
- [role_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [role_description] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [role_type] [varchar] (10) DEFAULT ('') NOT NULL ,
- [role_order] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_acl_roles] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_acl_roles] PRIMARY KEY CLUSTERED
- (
- [role_id]
- ) ON [PRIMARY]
-GO
-
-CREATE INDEX [role_type] ON [phpbb_acl_roles]([role_type]) ON [PRIMARY]
-GO
-
-CREATE INDEX [role_order] ON [phpbb_acl_roles]([role_order]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_acl_roles_data'
-*/
-CREATE TABLE [phpbb_acl_roles_data] (
- [role_id] [int] DEFAULT (0) NOT NULL ,
- [auth_option_id] [int] DEFAULT (0) NOT NULL ,
- [auth_setting] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_acl_roles_data] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_acl_roles_data] PRIMARY KEY CLUSTERED
- (
- [role_id],
- [auth_option_id]
- ) ON [PRIMARY]
-GO
-
-CREATE INDEX [ath_op_id] ON [phpbb_acl_roles_data]([auth_option_id]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_acl_users'
-*/
-CREATE TABLE [phpbb_acl_users] (
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [auth_option_id] [int] DEFAULT (0) NOT NULL ,
- [auth_role_id] [int] DEFAULT (0) NOT NULL ,
- [auth_setting] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-CREATE INDEX [user_id] ON [phpbb_acl_users]([user_id]) ON [PRIMARY]
-GO
-
-CREATE INDEX [auth_option_id] ON [phpbb_acl_users]([auth_option_id]) ON [PRIMARY]
-GO
-
-CREATE INDEX [auth_role_id] ON [phpbb_acl_users]([auth_role_id]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_banlist'
-*/
-CREATE TABLE [phpbb_banlist] (
- [ban_id] [int] IDENTITY (1, 1) NOT NULL ,
- [ban_userid] [int] DEFAULT (0) NOT NULL ,
- [ban_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [ban_email] [varchar] (100) DEFAULT ('') NOT NULL ,
- [ban_start] [int] DEFAULT (0) NOT NULL ,
- [ban_end] [int] DEFAULT (0) NOT NULL ,
- [ban_exclude] [int] DEFAULT (0) NOT NULL ,
- [ban_reason] [varchar] (255) DEFAULT ('') NOT NULL ,
- [ban_give_reason] [varchar] (255) DEFAULT ('') NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_banlist] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_banlist] PRIMARY KEY CLUSTERED
- (
- [ban_id]
- ) ON [PRIMARY]
-GO
-
-CREATE INDEX [ban_end] ON [phpbb_banlist]([ban_end]) ON [PRIMARY]
-GO
-
-CREATE INDEX [ban_user] ON [phpbb_banlist]([ban_userid], [ban_exclude]) ON [PRIMARY]
-GO
-
-CREATE INDEX [ban_email] ON [phpbb_banlist]([ban_email], [ban_exclude]) ON [PRIMARY]
-GO
-
-CREATE INDEX [ban_ip] ON [phpbb_banlist]([ban_ip], [ban_exclude]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_bbcodes'
-*/
-CREATE TABLE [phpbb_bbcodes] (
- [bbcode_id] [int] DEFAULT (0) NOT NULL ,
- [bbcode_tag] [varchar] (16) DEFAULT ('') NOT NULL ,
- [bbcode_helpline] [varchar] (255) DEFAULT ('') NOT NULL ,
- [display_on_posting] [int] DEFAULT (0) NOT NULL ,
- [bbcode_match] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [bbcode_tpl] [text] DEFAULT ('') NOT NULL ,
- [first_pass_match] [text] DEFAULT ('') NOT NULL ,
- [first_pass_replace] [text] DEFAULT ('') NOT NULL ,
- [second_pass_match] [text] DEFAULT ('') NOT NULL ,
- [second_pass_replace] [text] DEFAULT ('') NOT NULL
-) 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
-
-CREATE INDEX [display_on_post] ON [phpbb_bbcodes]([display_on_posting]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_bookmarks'
-*/
-CREATE TABLE [phpbb_bookmarks] (
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_bookmarks] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_bookmarks] PRIMARY KEY CLUSTERED
- (
- [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] DEFAULT (1) NOT NULL ,
- [bot_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [bot_agent] [varchar] (255) DEFAULT ('') NOT NULL ,
- [bot_ip] [varchar] (255) DEFAULT ('') NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_bots] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_bots] PRIMARY KEY CLUSTERED
- (
- [bot_id]
- ) ON [PRIMARY]
-GO
-
-CREATE INDEX [bot_active] ON [phpbb_bots]([bot_active]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_config'
-*/
-CREATE TABLE [phpbb_config] (
- [config_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [config_value] [varchar] (255) DEFAULT ('') NOT NULL ,
- [is_dynamic] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_config] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_config] PRIMARY KEY CLUSTERED
- (
- [config_name]
- ) ON [PRIMARY]
-GO
-
-CREATE INDEX [is_dynamic] ON [phpbb_config]([is_dynamic]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_confirm'
-*/
-CREATE TABLE [phpbb_confirm] (
- [confirm_id] [char] (32) DEFAULT ('') NOT NULL ,
- [session_id] [char] (32) DEFAULT ('') NOT NULL ,
- [confirm_type] [int] DEFAULT (0) NOT NULL ,
- [code] [varchar] (8) DEFAULT ('') NOT NULL ,
- [seed] [int] DEFAULT (0) NOT NULL ,
- [attempts] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_confirm] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_confirm] PRIMARY KEY CLUSTERED
- (
- [session_id],
- [confirm_id]
- ) ON [PRIMARY]
-GO
-
-CREATE INDEX [confirm_type] ON [phpbb_confirm]([confirm_type]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_disallow'
-*/
-CREATE TABLE [phpbb_disallow] (
- [disallow_id] [int] IDENTITY (1, 1) NOT NULL ,
- [disallow_username] [varchar] (255) DEFAULT ('') 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] DEFAULT (0) NOT NULL ,
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [save_time] [int] DEFAULT (0) NOT NULL ,
- [draft_subject] [varchar] (255) DEFAULT ('') NOT NULL ,
- [draft_message] [text] DEFAULT ('') NOT NULL
-) 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
-
-CREATE INDEX [save_time] ON [phpbb_drafts]([save_time]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_ext'
-*/
-CREATE TABLE [phpbb_ext] (
- [ext_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [ext_active] [int] DEFAULT (0) NOT NULL ,
- [ext_state] [varchar] (8000) DEFAULT ('') NOT NULL
-) ON [PRIMARY]
-GO
-
-CREATE UNIQUE INDEX [ext_name] ON [phpbb_ext]([ext_name]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_extensions'
-*/
-CREATE TABLE [phpbb_extensions] (
- [extension_id] [int] IDENTITY (1, 1) NOT NULL ,
- [group_id] [int] DEFAULT (0) NOT NULL ,
- [extension] [varchar] (100) DEFAULT ('') NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_extensions] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_extensions] PRIMARY KEY CLUSTERED
- (
- [extension_id]
- ) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_extension_groups'
-*/
-CREATE TABLE [phpbb_extension_groups] (
- [group_id] [int] IDENTITY (1, 1) NOT NULL ,
- [group_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [cat_id] [int] DEFAULT (0) NOT NULL ,
- [allow_group] [int] DEFAULT (0) NOT NULL ,
- [download_mode] [int] DEFAULT (1) NOT NULL ,
- [upload_icon] [varchar] (255) DEFAULT ('') NOT NULL ,
- [max_filesize] [int] DEFAULT (0) NOT NULL ,
- [allowed_forums] [varchar] (8000) DEFAULT ('') NOT NULL ,
- [allow_in_pm] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_extension_groups] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_extension_groups] PRIMARY KEY CLUSTERED
- (
- [group_id]
- ) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_forums'
-*/
-CREATE TABLE [phpbb_forums] (
- [forum_id] [int] IDENTITY (1, 1) NOT NULL ,
- [parent_id] [int] DEFAULT (0) NOT NULL ,
- [left_id] [int] DEFAULT (0) NOT NULL ,
- [right_id] [int] DEFAULT (0) NOT NULL ,
- [forum_parents] [text] DEFAULT ('') NOT NULL ,
- [forum_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_desc] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [forum_desc_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_desc_options] [int] DEFAULT (7) NOT NULL ,
- [forum_desc_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
- [forum_link] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_password] [varchar] (40) DEFAULT ('') NOT NULL ,
- [forum_style] [int] DEFAULT (0) NOT NULL ,
- [forum_image] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_rules] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [forum_rules_link] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_rules_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_rules_options] [int] DEFAULT (7) NOT NULL ,
- [forum_rules_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
- [forum_topics_per_page] [int] DEFAULT (0) NOT NULL ,
- [forum_type] [int] DEFAULT (0) NOT NULL ,
- [forum_status] [int] DEFAULT (0) NOT NULL ,
- [forum_posts] [int] DEFAULT (0) NOT NULL ,
- [forum_topics] [int] DEFAULT (0) NOT NULL ,
- [forum_topics_real] [int] DEFAULT (0) NOT NULL ,
- [forum_last_post_id] [int] DEFAULT (0) NOT NULL ,
- [forum_last_poster_id] [int] DEFAULT (0) NOT NULL ,
- [forum_last_post_subject] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_last_post_time] [int] DEFAULT (0) NOT NULL ,
- [forum_last_poster_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [forum_last_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL ,
- [forum_flags] [int] DEFAULT (32) NOT NULL ,
- [forum_options] [int] DEFAULT (0) NOT NULL ,
- [display_subforum_list] [int] DEFAULT (1) NOT NULL ,
- [display_on_index] [int] DEFAULT (1) NOT NULL ,
- [enable_indexing] [int] DEFAULT (1) NOT NULL ,
- [enable_icons] [int] DEFAULT (1) NOT NULL ,
- [enable_prune] [int] DEFAULT (0) NOT NULL ,
- [prune_next] [int] DEFAULT (0) NOT NULL ,
- [prune_days] [int] DEFAULT (0) NOT NULL ,
- [prune_viewed] [int] DEFAULT (0) NOT NULL ,
- [prune_freq] [int] DEFAULT (0) NOT NULL
-) 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
-
-CREATE INDEX [left_right_id] ON [phpbb_forums]([left_id], [right_id]) ON [PRIMARY]
-GO
-
-CREATE INDEX [forum_lastpost_id] ON [phpbb_forums]([forum_last_post_id]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_forums_access'
-*/
-CREATE TABLE [phpbb_forums_access] (
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [session_id] [char] (32) DEFAULT ('') NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_forums_access] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_forums_access] PRIMARY KEY CLUSTERED
- (
- [forum_id],
- [user_id],
- [session_id]
- ) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_forums_track'
-*/
-CREATE TABLE [phpbb_forums_track] (
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [mark_time] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_forums_track] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_forums_track] PRIMARY KEY CLUSTERED
- (
- [user_id],
- [forum_id]
- ) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_forums_watch'
-*/
-CREATE TABLE [phpbb_forums_watch] (
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [notify_status] [int] DEFAULT (0) NOT NULL
-) 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_stat] 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] DEFAULT (1) NOT NULL ,
- [group_founder_manage] [int] DEFAULT (0) NOT NULL ,
- [group_skip_auth] [int] DEFAULT (0) NOT NULL ,
- [group_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [group_desc] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [group_desc_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
- [group_desc_options] [int] DEFAULT (7) NOT NULL ,
- [group_desc_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
- [group_display] [int] DEFAULT (0) NOT NULL ,
- [group_avatar] [varchar] (255) DEFAULT ('') NOT NULL ,
- [group_avatar_type] [int] DEFAULT (0) NOT NULL ,
- [group_avatar_width] [int] DEFAULT (0) NOT NULL ,
- [group_avatar_height] [int] DEFAULT (0) NOT NULL ,
- [group_rank] [int] DEFAULT (0) NOT NULL ,
- [group_colour] [varchar] (6) DEFAULT ('') NOT NULL ,
- [group_sig_chars] [int] DEFAULT (0) NOT NULL ,
- [group_receive_pm] [int] DEFAULT (0) NOT NULL ,
- [group_message_limit] [int] DEFAULT (0) NOT NULL ,
- [group_max_recipients] [int] DEFAULT (0) NOT NULL ,
- [group_legend] [int] DEFAULT (0) NOT NULL ,
- [group_teampage] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_groups] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_groups] PRIMARY KEY CLUSTERED
- (
- [group_id]
- ) ON [PRIMARY]
-GO
-
-CREATE INDEX [group_legend_name] ON [phpbb_groups]([group_legend], [group_name]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_icons'
-*/
-CREATE TABLE [phpbb_icons] (
- [icons_id] [int] IDENTITY (1, 1) NOT NULL ,
- [icons_url] [varchar] (255) DEFAULT ('') NOT NULL ,
- [icons_width] [int] DEFAULT (0) NOT NULL ,
- [icons_height] [int] DEFAULT (0) NOT NULL ,
- [icons_order] [int] DEFAULT (0) NOT NULL ,
- [display_on_posting] [int] DEFAULT (1) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_icons] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_icons] PRIMARY KEY CLUSTERED
- (
- [icons_id]
- ) ON [PRIMARY]
-GO
-
-CREATE INDEX [display_on_posting] ON [phpbb_icons]([display_on_posting]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_lang'
-*/
-CREATE TABLE [phpbb_lang] (
- [lang_id] [int] IDENTITY (1, 1) NOT NULL ,
- [lang_iso] [varchar] (30) DEFAULT ('') NOT NULL ,
- [lang_dir] [varchar] (30) DEFAULT ('') NOT NULL ,
- [lang_english_name] [varchar] (100) DEFAULT ('') NOT NULL ,
- [lang_local_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [lang_author] [varchar] (255) DEFAULT ('') NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_lang] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_lang] PRIMARY KEY CLUSTERED
- (
- [lang_id]
- ) ON [PRIMARY]
-GO
-
-CREATE INDEX [lang_iso] ON [phpbb_lang]([lang_iso]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_log'
-*/
-CREATE TABLE [phpbb_log] (
- [log_id] [int] IDENTITY (1, 1) NOT NULL ,
- [log_type] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [reportee_id] [int] DEFAULT (0) NOT NULL ,
- [log_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [log_time] [int] DEFAULT (0) NOT NULL ,
- [log_operation] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [log_data] [text] DEFAULT ('') NOT NULL
-) 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
-
-CREATE INDEX [log_type] ON [phpbb_log]([log_type]) ON [PRIMARY]
-GO
-
-CREATE INDEX [log_time] ON [phpbb_log]([log_time]) 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_login_attempts'
-*/
-CREATE TABLE [phpbb_login_attempts] (
- [attempt_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [attempt_browser] [varchar] (150) DEFAULT ('') NOT NULL ,
- [attempt_forwarded_for] [varchar] (255) DEFAULT ('') NOT NULL ,
- [attempt_time] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [username] [varchar] (255) DEFAULT (0) NOT NULL ,
- [username_clean] [varchar] (255) DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-CREATE INDEX [att_ip] ON [phpbb_login_attempts]([attempt_ip], [attempt_time]) ON [PRIMARY]
-GO
-
-CREATE INDEX [att_for] ON [phpbb_login_attempts]([attempt_forwarded_for], [attempt_time]) ON [PRIMARY]
-GO
-
-CREATE INDEX [att_time] ON [phpbb_login_attempts]([attempt_time]) ON [PRIMARY]
-GO
-
-CREATE INDEX [user_id] ON [phpbb_login_attempts]([user_id]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_moderator_cache'
-*/
-CREATE TABLE [phpbb_moderator_cache] (
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [username] [varchar] (255) DEFAULT ('') NOT NULL ,
- [group_id] [int] DEFAULT (0) NOT NULL ,
- [group_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [display_on_index] [int] DEFAULT (1) NOT NULL
-) ON [PRIMARY]
-GO
-
-CREATE INDEX [disp_idx] 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] DEFAULT (1) NOT NULL ,
- [module_display] [int] DEFAULT (1) NOT NULL ,
- [module_basename] [varchar] (255) DEFAULT ('') NOT NULL ,
- [module_class] [varchar] (10) DEFAULT ('') NOT NULL ,
- [parent_id] [int] DEFAULT (0) NOT NULL ,
- [left_id] [int] DEFAULT (0) NOT NULL ,
- [right_id] [int] DEFAULT (0) NOT NULL ,
- [module_langname] [varchar] (255) DEFAULT ('') NOT NULL ,
- [module_mode] [varchar] (255) DEFAULT ('') NOT NULL ,
- [module_auth] [varchar] (255) DEFAULT ('') NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_modules] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_modules] PRIMARY KEY CLUSTERED
- (
- [module_id]
- ) ON [PRIMARY]
-GO
-
-CREATE INDEX [left_right_id] ON [phpbb_modules]([left_id], [right_id]) ON [PRIMARY]
-GO
-
-CREATE INDEX [module_enabled] ON [phpbb_modules]([module_enabled]) ON [PRIMARY]
-GO
-
-CREATE INDEX [class_left_id] ON [phpbb_modules]([module_class], [left_id]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_poll_options'
-*/
-CREATE TABLE [phpbb_poll_options] (
- [poll_option_id] [int] DEFAULT (0) NOT NULL ,
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [poll_option_text] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [poll_option_total] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-CREATE INDEX [poll_opt_id] ON [phpbb_poll_options]([poll_option_id]) ON [PRIMARY]
-GO
-
-CREATE INDEX [topic_id] ON [phpbb_poll_options]([topic_id]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_poll_votes'
-*/
-CREATE TABLE [phpbb_poll_votes] (
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [poll_option_id] [int] DEFAULT (0) NOT NULL ,
- [vote_user_id] [int] DEFAULT (0) NOT NULL ,
- [vote_user_ip] [varchar] (40) DEFAULT ('') NOT NULL
-) ON [PRIMARY]
-GO
-
-CREATE INDEX [topic_id] ON [phpbb_poll_votes]([topic_id]) ON [PRIMARY]
-GO
-
-CREATE INDEX [vote_user_id] ON [phpbb_poll_votes]([vote_user_id]) ON [PRIMARY]
-GO
-
-CREATE INDEX [vote_user_ip] ON [phpbb_poll_votes]([vote_user_ip]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_posts'
-*/
-CREATE TABLE [phpbb_posts] (
- [post_id] [int] IDENTITY (1, 1) NOT NULL ,
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [poster_id] [int] DEFAULT (0) NOT NULL ,
- [icon_id] [int] DEFAULT (0) NOT NULL ,
- [poster_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [post_time] [int] DEFAULT (0) NOT NULL ,
- [post_approved] [int] DEFAULT (1) NOT NULL ,
- [post_reported] [int] DEFAULT (0) NOT NULL ,
- [enable_bbcode] [int] DEFAULT (1) NOT NULL ,
- [enable_smilies] [int] DEFAULT (1) NOT NULL ,
- [enable_magic_url] [int] DEFAULT (1) NOT NULL ,
- [enable_sig] [int] DEFAULT (1) NOT NULL ,
- [post_username] [varchar] (255) DEFAULT ('') NOT NULL ,
- [post_subject] [varchar] (255) DEFAULT ('') NOT NULL ,
- [post_text] [text] DEFAULT ('') NOT NULL ,
- [post_checksum] [varchar] (32) DEFAULT ('') NOT NULL ,
- [post_attachment] [int] DEFAULT (0) NOT NULL ,
- [bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
- [bbcode_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
- [post_postcount] [int] DEFAULT (1) NOT NULL ,
- [post_edit_time] [int] DEFAULT (0) NOT NULL ,
- [post_edit_reason] [varchar] (255) DEFAULT ('') NOT NULL ,
- [post_edit_user] [int] DEFAULT (0) NOT NULL ,
- [post_edit_count] [int] DEFAULT (0) NOT NULL ,
- [post_edit_locked] [int] DEFAULT (0) NOT NULL
-) 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
-
-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_username] ON [phpbb_posts]([post_username]) ON [PRIMARY]
-GO
-
-CREATE INDEX [tid_post_time] ON [phpbb_posts]([topic_id], [post_time]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_privmsgs'
-*/
-CREATE TABLE [phpbb_privmsgs] (
- [msg_id] [int] IDENTITY (1, 1) NOT NULL ,
- [root_level] [int] DEFAULT (0) NOT NULL ,
- [author_id] [int] DEFAULT (0) NOT NULL ,
- [icon_id] [int] DEFAULT (0) NOT NULL ,
- [author_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [message_time] [int] DEFAULT (0) NOT NULL ,
- [enable_bbcode] [int] DEFAULT (1) NOT NULL ,
- [enable_smilies] [int] DEFAULT (1) NOT NULL ,
- [enable_magic_url] [int] DEFAULT (1) NOT NULL ,
- [enable_sig] [int] DEFAULT (1) NOT NULL ,
- [message_subject] [varchar] (255) DEFAULT ('') NOT NULL ,
- [message_text] [text] DEFAULT ('') NOT NULL ,
- [message_edit_reason] [varchar] (255) DEFAULT ('') NOT NULL ,
- [message_edit_user] [int] DEFAULT (0) NOT NULL ,
- [message_attachment] [int] DEFAULT (0) NOT NULL ,
- [bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
- [bbcode_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
- [message_edit_time] [int] DEFAULT (0) NOT NULL ,
- [message_edit_count] [int] DEFAULT (0) NOT NULL ,
- [to_address] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [bcc_address] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [message_reported] [int] DEFAULT (0) NOT NULL
-) 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
-
-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] DEFAULT (0) NOT NULL ,
- [folder_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [pm_count] [int] DEFAULT (0) 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
-
-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] DEFAULT (0) NOT NULL ,
- [rule_check] [int] DEFAULT (0) NOT NULL ,
- [rule_connection] [int] DEFAULT (0) NOT NULL ,
- [rule_string] [varchar] (255) DEFAULT ('') NOT NULL ,
- [rule_user_id] [int] DEFAULT (0) NOT NULL ,
- [rule_group_id] [int] DEFAULT (0) NOT NULL ,
- [rule_action] [int] DEFAULT (0) NOT NULL ,
- [rule_folder_id] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_privmsgs_rules] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_privmsgs_rules] PRIMARY KEY CLUSTERED
- (
- [rule_id]
- ) ON [PRIMARY]
-GO
-
-CREATE INDEX [user_id] ON [phpbb_privmsgs_rules]([user_id]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_privmsgs_to'
-*/
-CREATE TABLE [phpbb_privmsgs_to] (
- [msg_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [author_id] [int] DEFAULT (0) NOT NULL ,
- [pm_deleted] [int] DEFAULT (0) NOT NULL ,
- [pm_new] [int] DEFAULT (1) NOT NULL ,
- [pm_unread] [int] DEFAULT (1) NOT NULL ,
- [pm_replied] [int] DEFAULT (0) NOT NULL ,
- [pm_marked] [int] DEFAULT (0) NOT NULL ,
- [pm_forwarded] [int] DEFAULT (0) NOT NULL ,
- [folder_id] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-CREATE INDEX [msg_id] ON [phpbb_privmsgs_to]([msg_id]) ON [PRIMARY]
-GO
-
-CREATE INDEX [author_id] ON [phpbb_privmsgs_to]([author_id]) ON [PRIMARY]
-GO
-
-CREATE INDEX [usr_flder_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] (255) DEFAULT ('') NOT NULL ,
- [field_type] [int] DEFAULT (0) NOT NULL ,
- [field_ident] [varchar] (20) DEFAULT ('') NOT NULL ,
- [field_length] [varchar] (20) DEFAULT ('') NOT NULL ,
- [field_minlen] [varchar] (255) DEFAULT ('') NOT NULL ,
- [field_maxlen] [varchar] (255) DEFAULT ('') NOT NULL ,
- [field_novalue] [varchar] (255) DEFAULT ('') NOT NULL ,
- [field_default_value] [varchar] (255) DEFAULT ('') NOT NULL ,
- [field_validation] [varchar] (20) DEFAULT ('') NOT NULL ,
- [field_required] [int] DEFAULT (0) NOT NULL ,
- [field_show_novalue] [int] DEFAULT (0) NOT NULL ,
- [field_show_on_reg] [int] DEFAULT (0) NOT NULL ,
- [field_show_on_pm] [int] DEFAULT (0) NOT NULL ,
- [field_show_on_vt] [int] DEFAULT (0) NOT NULL ,
- [field_show_profile] [int] DEFAULT (0) NOT NULL ,
- [field_hide] [int] DEFAULT (0) NOT NULL ,
- [field_no_view] [int] DEFAULT (0) NOT NULL ,
- [field_active] [int] DEFAULT (0) NOT NULL ,
- [field_order] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_profile_fields] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_profile_fields] PRIMARY KEY CLUSTERED
- (
- [field_id]
- ) ON [PRIMARY]
-GO
-
-CREATE INDEX [fld_type] ON [phpbb_profile_fields]([field_type]) ON [PRIMARY]
-GO
-
-CREATE INDEX [fld_ordr] ON [phpbb_profile_fields]([field_order]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_profile_fields_data'
-*/
-CREATE TABLE [phpbb_profile_fields_data] (
- [user_id] [int] DEFAULT (0) 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
-
-
-/*
- Table: 'phpbb_profile_fields_lang'
-*/
-CREATE TABLE [phpbb_profile_fields_lang] (
- [field_id] [int] DEFAULT (0) NOT NULL ,
- [lang_id] [int] DEFAULT (0) NOT NULL ,
- [option_id] [int] DEFAULT (0) NOT NULL ,
- [field_type] [int] DEFAULT (0) NOT NULL ,
- [lang_value] [varchar] (255) DEFAULT ('') NOT NULL
-) 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
-
-
-/*
- Table: 'phpbb_profile_lang'
-*/
-CREATE TABLE [phpbb_profile_lang] (
- [field_id] [int] DEFAULT (0) NOT NULL ,
- [lang_id] [int] DEFAULT (0) NOT NULL ,
- [lang_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [lang_explain] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [lang_default_value] [varchar] (255) DEFAULT ('') NOT NULL
-) 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
-
-
-/*
- Table: 'phpbb_ranks'
-*/
-CREATE TABLE [phpbb_ranks] (
- [rank_id] [int] IDENTITY (1, 1) NOT NULL ,
- [rank_title] [varchar] (255) DEFAULT ('') NOT NULL ,
- [rank_min] [int] DEFAULT (0) NOT NULL ,
- [rank_special] [int] DEFAULT (0) NOT NULL ,
- [rank_image] [varchar] (255) DEFAULT ('') NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_ranks] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_ranks] PRIMARY KEY CLUSTERED
- (
- [rank_id]
- ) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_reports'
-*/
-CREATE TABLE [phpbb_reports] (
- [report_id] [int] IDENTITY (1, 1) NOT NULL ,
- [reason_id] [int] DEFAULT (0) NOT NULL ,
- [post_id] [int] DEFAULT (0) NOT NULL ,
- [pm_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [user_notify] [int] DEFAULT (0) NOT NULL ,
- [report_closed] [int] DEFAULT (0) NOT NULL ,
- [report_time] [int] DEFAULT (0) NOT NULL ,
- [report_text] [text] DEFAULT ('') NOT NULL ,
- [reported_post_text] [text] DEFAULT ('') NOT NULL
-) 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
-
-CREATE INDEX [post_id] ON [phpbb_reports]([post_id]) ON [PRIMARY]
-GO
-
-CREATE INDEX [pm_id] ON [phpbb_reports]([pm_id]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_reports_reasons'
-*/
-CREATE TABLE [phpbb_reports_reasons] (
- [reason_id] [int] IDENTITY (1, 1) NOT NULL ,
- [reason_title] [varchar] (255) DEFAULT ('') NOT NULL ,
- [reason_description] [text] DEFAULT ('') NOT NULL ,
- [reason_order] [int] DEFAULT (0) NOT NULL
-) 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
-
-
-/*
- Table: 'phpbb_search_results'
-*/
-CREATE TABLE [phpbb_search_results] (
- [search_key] [varchar] (32) DEFAULT ('') NOT NULL ,
- [search_time] [int] DEFAULT (0) NOT NULL ,
- [search_keywords] [text] DEFAULT ('') NOT NULL ,
- [search_authors] [text] DEFAULT ('') NOT NULL
-) 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
-
-
-/*
- Table: 'phpbb_search_wordlist'
-*/
-CREATE TABLE [phpbb_search_wordlist] (
- [word_id] [int] IDENTITY (1, 1) NOT NULL ,
- [word_text] [varchar] (255) DEFAULT ('') NOT NULL ,
- [word_common] [int] DEFAULT (0) NOT NULL ,
- [word_count] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_search_wordlist] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_search_wordlist] PRIMARY KEY CLUSTERED
- (
- [word_id]
- ) ON [PRIMARY]
-GO
-
-CREATE UNIQUE INDEX [wrd_txt] ON [phpbb_search_wordlist]([word_text]) ON [PRIMARY]
-GO
-
-CREATE INDEX [wrd_cnt] ON [phpbb_search_wordlist]([word_count]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_search_wordmatch'
-*/
-CREATE TABLE [phpbb_search_wordmatch] (
- [post_id] [int] DEFAULT (0) NOT NULL ,
- [word_id] [int] DEFAULT (0) NOT NULL ,
- [title_match] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-CREATE UNIQUE INDEX [unq_mtch] ON [phpbb_search_wordmatch]([word_id], [post_id], [title_match]) ON [PRIMARY]
-GO
-
-CREATE INDEX [word_id] ON [phpbb_search_wordmatch]([word_id]) ON [PRIMARY]
-GO
-
-CREATE INDEX [post_id] ON [phpbb_search_wordmatch]([post_id]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_sessions'
-*/
-CREATE TABLE [phpbb_sessions] (
- [session_id] [char] (32) DEFAULT ('') NOT NULL ,
- [session_user_id] [int] DEFAULT (0) NOT NULL ,
- [session_forum_id] [int] DEFAULT (0) NOT NULL ,
- [session_last_visit] [int] DEFAULT (0) NOT NULL ,
- [session_start] [int] DEFAULT (0) NOT NULL ,
- [session_time] [int] DEFAULT (0) NOT NULL ,
- [session_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [session_browser] [varchar] (150) DEFAULT ('') NOT NULL ,
- [session_forwarded_for] [varchar] (255) DEFAULT ('') NOT NULL ,
- [session_page] [varchar] (255) DEFAULT ('') NOT NULL ,
- [session_viewonline] [int] DEFAULT (1) NOT NULL ,
- [session_autologin] [int] DEFAULT (0) NOT NULL ,
- [session_admin] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_sessions] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_sessions] PRIMARY KEY CLUSTERED
- (
- [session_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 [session_fid] ON [phpbb_sessions]([session_forum_id]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_sessions_keys'
-*/
-CREATE TABLE [phpbb_sessions_keys] (
- [key_id] [char] (32) DEFAULT ('') NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [last_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [last_login] [int] DEFAULT (0) NOT NULL
-) 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
-
-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) DEFAULT ('') NOT NULL ,
- [site_hostname] [varchar] (255) DEFAULT ('') NOT NULL ,
- [ip_exclude] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_sitelist] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_sitelist] PRIMARY KEY CLUSTERED
- (
- [site_id]
- ) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_smilies'
-*/
-CREATE TABLE [phpbb_smilies] (
- [smiley_id] [int] IDENTITY (1, 1) NOT NULL ,
- [code] [varchar] (50) DEFAULT ('') NOT NULL ,
- [emotion] [varchar] (50) DEFAULT ('') NOT NULL ,
- [smiley_url] [varchar] (50) DEFAULT ('') NOT NULL ,
- [smiley_width] [int] DEFAULT (0) NOT NULL ,
- [smiley_height] [int] DEFAULT (0) NOT NULL ,
- [smiley_order] [int] DEFAULT (0) NOT NULL ,
- [display_on_posting] [int] DEFAULT (1) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_smilies] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_smilies] PRIMARY KEY CLUSTERED
- (
- [smiley_id]
- ) ON [PRIMARY]
-GO
-
-CREATE INDEX [display_on_post] ON [phpbb_smilies]([display_on_posting]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_styles'
-*/
-CREATE TABLE [phpbb_styles] (
- [style_id] [int] IDENTITY (1, 1) NOT NULL ,
- [style_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [style_copyright] [varchar] (255) DEFAULT ('') NOT NULL ,
- [style_active] [int] DEFAULT (1) NOT NULL ,
- [style_path] [varchar] (100) DEFAULT ('') NOT NULL ,
- [bbcode_bitfield] [varchar] (255) DEFAULT ('kNg=') NOT NULL ,
- [style_parent_id] [int] DEFAULT (0) NOT NULL ,
- [style_parent_tree] [varchar] (8000) DEFAULT ('') NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_styles] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_styles] PRIMARY KEY CLUSTERED
- (
- [style_id]
- ) ON [PRIMARY]
-GO
-
-CREATE UNIQUE INDEX [style_name] ON [phpbb_styles]([style_name]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_topics'
-*/
-CREATE TABLE [phpbb_topics] (
- [topic_id] [int] IDENTITY (1, 1) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [icon_id] [int] DEFAULT (0) NOT NULL ,
- [topic_attachment] [int] DEFAULT (0) NOT NULL ,
- [topic_approved] [int] DEFAULT (1) NOT NULL ,
- [topic_reported] [int] DEFAULT (0) NOT NULL ,
- [topic_title] [varchar] (255) DEFAULT ('') NOT NULL ,
- [topic_poster] [int] DEFAULT (0) NOT NULL ,
- [topic_time] [int] DEFAULT (0) NOT NULL ,
- [topic_time_limit] [int] DEFAULT (0) NOT NULL ,
- [topic_views] [int] DEFAULT (0) NOT NULL ,
- [topic_replies] [int] DEFAULT (0) NOT NULL ,
- [topic_replies_real] [int] DEFAULT (0) NOT NULL ,
- [topic_status] [int] DEFAULT (0) NOT NULL ,
- [topic_type] [int] DEFAULT (0) NOT NULL ,
- [topic_first_post_id] [int] DEFAULT (0) NOT NULL ,
- [topic_first_poster_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [topic_first_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL ,
- [topic_last_post_id] [int] DEFAULT (0) NOT NULL ,
- [topic_last_poster_id] [int] DEFAULT (0) NOT NULL ,
- [topic_last_poster_name] [varchar] (255) DEFAULT ('') NOT NULL ,
- [topic_last_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL ,
- [topic_last_post_subject] [varchar] (255) DEFAULT ('') NOT NULL ,
- [topic_last_post_time] [int] DEFAULT (0) NOT NULL ,
- [topic_last_view_time] [int] DEFAULT (0) NOT NULL ,
- [topic_moved_id] [int] DEFAULT (0) NOT NULL ,
- [topic_bumped] [int] DEFAULT (0) NOT NULL ,
- [topic_bumper] [int] DEFAULT (0) NOT NULL ,
- [poll_title] [varchar] (255) DEFAULT ('') NOT NULL ,
- [poll_start] [int] DEFAULT (0) NOT NULL ,
- [poll_length] [int] DEFAULT (0) NOT NULL ,
- [poll_max_options] [int] DEFAULT (1) NOT NULL ,
- [poll_last_vote] [int] DEFAULT (0) NOT NULL ,
- [poll_vote_change] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_topics] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_topics] PRIMARY KEY CLUSTERED
- (
- [topic_id]
- ) ON [PRIMARY]
-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 [last_post_time] ON [phpbb_topics]([topic_last_post_time]) ON [PRIMARY]
-GO
-
-CREATE INDEX [topic_approved] ON [phpbb_topics]([topic_approved]) ON [PRIMARY]
-GO
-
-CREATE INDEX [forum_appr_last] ON [phpbb_topics]([forum_id], [topic_approved], [topic_last_post_id]) ON [PRIMARY]
-GO
-
-CREATE INDEX [fid_time_moved] ON [phpbb_topics]([forum_id], [topic_last_post_time], [topic_moved_id]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_topics_track'
-*/
-CREATE TABLE [phpbb_topics_track] (
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [forum_id] [int] DEFAULT (0) NOT NULL ,
- [mark_time] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_topics_track] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_topics_track] PRIMARY KEY CLUSTERED
- (
- [user_id],
- [topic_id]
- ) ON [PRIMARY]
-GO
-
-CREATE INDEX [topic_id] ON [phpbb_topics_track]([topic_id]) ON [PRIMARY]
-GO
-
-CREATE INDEX [forum_id] ON [phpbb_topics_track]([forum_id]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_topics_posted'
-*/
-CREATE TABLE [phpbb_topics_posted] (
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [topic_posted] [int] DEFAULT (0) NOT NULL
-) 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
-
-
-/*
- Table: 'phpbb_topics_watch'
-*/
-CREATE TABLE [phpbb_topics_watch] (
- [topic_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [notify_status] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-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_stat] ON [phpbb_topics_watch]([notify_status]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_user_group'
-*/
-CREATE TABLE [phpbb_user_group] (
- [group_id] [int] DEFAULT (0) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [group_leader] [int] DEFAULT (0) NOT NULL ,
- [user_pending] [int] DEFAULT (1) NOT NULL
-) ON [PRIMARY]
-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] DEFAULT (0) NOT NULL ,
- [group_id] [int] DEFAULT (3) NOT NULL ,
- [user_permissions] [text] DEFAULT ('') NOT NULL ,
- [user_perm_from] [int] DEFAULT (0) NOT NULL ,
- [user_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
- [user_regdate] [int] DEFAULT (0) NOT NULL ,
- [username] [varchar] (255) DEFAULT ('') NOT NULL ,
- [username_clean] [varchar] (255) DEFAULT ('') NOT NULL ,
- [user_password] [varchar] (40) DEFAULT ('') NOT NULL ,
- [user_passchg] [int] DEFAULT (0) NOT NULL ,
- [user_pass_convert] [int] DEFAULT (0) NOT NULL ,
- [user_email] [varchar] (100) DEFAULT ('') NOT NULL ,
- [user_email_hash] [float] DEFAULT (0) NOT NULL ,
- [user_birthday] [varchar] (10) DEFAULT ('') NOT NULL ,
- [user_lastvisit] [int] DEFAULT (0) NOT NULL ,
- [user_lastmark] [int] DEFAULT (0) NOT NULL ,
- [user_lastpost_time] [int] DEFAULT (0) NOT NULL ,
- [user_lastpage] [varchar] (200) DEFAULT ('') NOT NULL ,
- [user_last_confirm_key] [varchar] (10) DEFAULT ('') NOT NULL ,
- [user_last_search] [int] DEFAULT (0) NOT NULL ,
- [user_warnings] [int] DEFAULT (0) NOT NULL ,
- [user_last_warning] [int] DEFAULT (0) NOT NULL ,
- [user_login_attempts] [int] DEFAULT (0) NOT NULL ,
- [user_inactive_reason] [int] DEFAULT (0) NOT NULL ,
- [user_inactive_time] [int] DEFAULT (0) NOT NULL ,
- [user_posts] [int] DEFAULT (0) NOT NULL ,
- [user_lang] [varchar] (30) DEFAULT ('') NOT NULL ,
- [user_timezone] [varchar] (100) DEFAULT ('UTC') NOT NULL ,
- [user_dateformat] [varchar] (30) DEFAULT ('d M Y H:i') NOT NULL ,
- [user_style] [int] DEFAULT (0) NOT NULL ,
- [user_rank] [int] DEFAULT (0) NOT NULL ,
- [user_colour] [varchar] (6) DEFAULT ('') NOT NULL ,
- [user_new_privmsg] [int] DEFAULT (0) NOT NULL ,
- [user_unread_privmsg] [int] DEFAULT (0) NOT NULL ,
- [user_last_privmsg] [int] DEFAULT (0) NOT NULL ,
- [user_message_rules] [int] DEFAULT (0) NOT NULL ,
- [user_full_folder] [int] DEFAULT (-3) NOT NULL ,
- [user_emailtime] [int] DEFAULT (0) NOT NULL ,
- [user_topic_show_days] [int] DEFAULT (0) NOT NULL ,
- [user_topic_sortby_type] [varchar] (1) DEFAULT ('t') NOT NULL ,
- [user_topic_sortby_dir] [varchar] (1) DEFAULT ('d') NOT NULL ,
- [user_post_show_days] [int] DEFAULT (0) NOT NULL ,
- [user_post_sortby_type] [varchar] (1) DEFAULT ('t') NOT NULL ,
- [user_post_sortby_dir] [varchar] (1) DEFAULT ('a') NOT NULL ,
- [user_notify] [int] DEFAULT (0) NOT NULL ,
- [user_notify_pm] [int] DEFAULT (1) NOT NULL ,
- [user_notify_type] [int] DEFAULT (0) NOT NULL ,
- [user_allow_pm] [int] DEFAULT (1) NOT NULL ,
- [user_allow_viewonline] [int] DEFAULT (1) NOT NULL ,
- [user_allow_viewemail] [int] DEFAULT (1) NOT NULL ,
- [user_allow_massemail] [int] DEFAULT (1) NOT NULL ,
- [user_options] [int] DEFAULT (230271) NOT NULL ,
- [user_avatar] [varchar] (255) DEFAULT ('') NOT NULL ,
- [user_avatar_type] [int] DEFAULT (0) NOT NULL ,
- [user_avatar_width] [int] DEFAULT (0) NOT NULL ,
- [user_avatar_height] [int] DEFAULT (0) NOT NULL ,
- [user_sig] [text] DEFAULT ('') NOT NULL ,
- [user_sig_bbcode_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
- [user_sig_bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
- [user_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] (4000) DEFAULT ('') NOT NULL ,
- [user_interests] [varchar] (4000) DEFAULT ('') NOT NULL ,
- [user_actkey] [varchar] (32) DEFAULT ('') NOT NULL ,
- [user_newpasswd] [varchar] (40) DEFAULT ('') NOT NULL ,
- [user_form_salt] [varchar] (32) DEFAULT ('') NOT NULL ,
- [user_new] [int] DEFAULT (1) NOT NULL ,
- [user_reminded] [int] DEFAULT (0) NOT NULL ,
- [user_reminded_time] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_users] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_users] PRIMARY KEY CLUSTERED
- (
- [user_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]
-GO
-
-CREATE INDEX [user_type] ON [phpbb_users]([user_type]) ON [PRIMARY]
-GO
-
-CREATE UNIQUE INDEX [username_clean] ON [phpbb_users]([username_clean]) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_warnings'
-*/
-CREATE TABLE [phpbb_warnings] (
- [warning_id] [int] IDENTITY (1, 1) NOT NULL ,
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [post_id] [int] DEFAULT (0) NOT NULL ,
- [log_id] [int] DEFAULT (0) NOT NULL ,
- [warning_time] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_warnings] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_warnings] PRIMARY KEY CLUSTERED
- (
- [warning_id]
- ) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_words'
-*/
-CREATE TABLE [phpbb_words] (
- [word_id] [int] IDENTITY (1, 1) NOT NULL ,
- [word] [varchar] (255) DEFAULT ('') NOT NULL ,
- [replacement] [varchar] (255) DEFAULT ('') NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_words] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_words] PRIMARY KEY CLUSTERED
- (
- [word_id]
- ) ON [PRIMARY]
-GO
-
-
-/*
- Table: 'phpbb_zebra'
-*/
-CREATE TABLE [phpbb_zebra] (
- [user_id] [int] DEFAULT (0) NOT NULL ,
- [zebra_id] [int] DEFAULT (0) NOT NULL ,
- [friend] [int] DEFAULT (0) NOT NULL ,
- [foe] [int] DEFAULT (0) NOT NULL
-) ON [PRIMARY]
-GO
-
-ALTER TABLE [phpbb_zebra] WITH NOCHECK ADD
- CONSTRAINT [PK_phpbb_zebra] PRIMARY KEY CLUSTERED
- (
- [user_id],
- [zebra_id]
- ) ON [PRIMARY]
-GO
-
-
+/*
+ * DO NOT EDIT THIS FILE, IT IS GENERATED
+ *
+ * To change the contents of this file, edit
+ * phpBB/develop/create_schema_files.php and
+ * run it.
+ */
+
+/*
+ Table: 'phpbb_attachments'
+*/
+CREATE TABLE [phpbb_attachments] (
+ [attach_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [post_msg_id] [int] DEFAULT (0) NOT NULL ,
+ [topic_id] [int] DEFAULT (0) NOT NULL ,
+ [in_message] [int] DEFAULT (0) NOT NULL ,
+ [poster_id] [int] DEFAULT (0) NOT NULL ,
+ [is_orphan] [int] DEFAULT (1) NOT NULL ,
+ [physical_filename] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [real_filename] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [download_count] [int] DEFAULT (0) NOT NULL ,
+ [attach_comment] [varchar] (4000) DEFAULT ('') NOT NULL ,
+ [extension] [varchar] (100) DEFAULT ('') NOT NULL ,
+ [mimetype] [varchar] (100) DEFAULT ('') NOT NULL ,
+ [filesize] [int] DEFAULT (0) NOT NULL ,
+ [filetime] [int] DEFAULT (0) NOT NULL ,
+ [thumbnail] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_attachments] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_attachments] PRIMARY KEY CLUSTERED
+ (
+ [attach_id]
+ ) ON [PRIMARY]
+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 [is_orphan] ON [phpbb_attachments]([is_orphan]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_acl_groups'
+*/
+CREATE TABLE [phpbb_acl_groups] (
+ [group_id] [int] DEFAULT (0) NOT NULL ,
+ [forum_id] [int] DEFAULT (0) NOT NULL ,
+ [auth_option_id] [int] DEFAULT (0) NOT NULL ,
+ [auth_role_id] [int] DEFAULT (0) NOT NULL ,
+ [auth_setting] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE INDEX [group_id] ON [phpbb_acl_groups]([group_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [auth_opt_id] ON [phpbb_acl_groups]([auth_option_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [auth_role_id] ON [phpbb_acl_groups]([auth_role_id]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_acl_options'
+*/
+CREATE TABLE [phpbb_acl_options] (
+ [auth_option_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [auth_option] [varchar] (50) DEFAULT ('') NOT NULL ,
+ [is_global] [int] DEFAULT (0) NOT NULL ,
+ [is_local] [int] DEFAULT (0) NOT NULL ,
+ [founder_only] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_acl_options] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_acl_options] PRIMARY KEY CLUSTERED
+ (
+ [auth_option_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE UNIQUE INDEX [auth_option] ON [phpbb_acl_options]([auth_option]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_acl_roles'
+*/
+CREATE TABLE [phpbb_acl_roles] (
+ [role_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [role_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [role_description] [varchar] (4000) DEFAULT ('') NOT NULL ,
+ [role_type] [varchar] (10) DEFAULT ('') NOT NULL ,
+ [role_order] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_acl_roles] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_acl_roles] PRIMARY KEY CLUSTERED
+ (
+ [role_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE INDEX [role_type] ON [phpbb_acl_roles]([role_type]) ON [PRIMARY]
+GO
+
+CREATE INDEX [role_order] ON [phpbb_acl_roles]([role_order]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_acl_roles_data'
+*/
+CREATE TABLE [phpbb_acl_roles_data] (
+ [role_id] [int] DEFAULT (0) NOT NULL ,
+ [auth_option_id] [int] DEFAULT (0) NOT NULL ,
+ [auth_setting] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_acl_roles_data] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_acl_roles_data] PRIMARY KEY CLUSTERED
+ (
+ [role_id],
+ [auth_option_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE INDEX [ath_op_id] ON [phpbb_acl_roles_data]([auth_option_id]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_acl_users'
+*/
+CREATE TABLE [phpbb_acl_users] (
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [forum_id] [int] DEFAULT (0) NOT NULL ,
+ [auth_option_id] [int] DEFAULT (0) NOT NULL ,
+ [auth_role_id] [int] DEFAULT (0) NOT NULL ,
+ [auth_setting] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE INDEX [user_id] ON [phpbb_acl_users]([user_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [auth_option_id] ON [phpbb_acl_users]([auth_option_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [auth_role_id] ON [phpbb_acl_users]([auth_role_id]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_banlist'
+*/
+CREATE TABLE [phpbb_banlist] (
+ [ban_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [ban_userid] [int] DEFAULT (0) NOT NULL ,
+ [ban_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
+ [ban_email] [varchar] (100) DEFAULT ('') NOT NULL ,
+ [ban_start] [int] DEFAULT (0) NOT NULL ,
+ [ban_end] [int] DEFAULT (0) NOT NULL ,
+ [ban_exclude] [int] DEFAULT (0) NOT NULL ,
+ [ban_reason] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [ban_give_reason] [varchar] (255) DEFAULT ('') NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_banlist] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_banlist] PRIMARY KEY CLUSTERED
+ (
+ [ban_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE INDEX [ban_end] ON [phpbb_banlist]([ban_end]) ON [PRIMARY]
+GO
+
+CREATE INDEX [ban_user] ON [phpbb_banlist]([ban_userid], [ban_exclude]) ON [PRIMARY]
+GO
+
+CREATE INDEX [ban_email] ON [phpbb_banlist]([ban_email], [ban_exclude]) ON [PRIMARY]
+GO
+
+CREATE INDEX [ban_ip] ON [phpbb_banlist]([ban_ip], [ban_exclude]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_bbcodes'
+*/
+CREATE TABLE [phpbb_bbcodes] (
+ [bbcode_id] [int] DEFAULT (0) NOT NULL ,
+ [bbcode_tag] [varchar] (16) DEFAULT ('') NOT NULL ,
+ [bbcode_helpline] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [display_on_posting] [int] DEFAULT (0) NOT NULL ,
+ [bbcode_match] [varchar] (4000) DEFAULT ('') NOT NULL ,
+ [bbcode_tpl] [text] DEFAULT ('') NOT NULL ,
+ [first_pass_match] [text] DEFAULT ('') NOT NULL ,
+ [first_pass_replace] [text] DEFAULT ('') NOT NULL ,
+ [second_pass_match] [text] DEFAULT ('') NOT NULL ,
+ [second_pass_replace] [text] DEFAULT ('') NOT NULL
+) 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
+
+CREATE INDEX [display_on_post] ON [phpbb_bbcodes]([display_on_posting]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_bookmarks'
+*/
+CREATE TABLE [phpbb_bookmarks] (
+ [topic_id] [int] DEFAULT (0) NOT NULL ,
+ [user_id] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_bookmarks] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_bookmarks] PRIMARY KEY CLUSTERED
+ (
+ [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] DEFAULT (1) NOT NULL ,
+ [bot_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [bot_agent] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [bot_ip] [varchar] (255) DEFAULT ('') NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_bots] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_bots] PRIMARY KEY CLUSTERED
+ (
+ [bot_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE INDEX [bot_active] ON [phpbb_bots]([bot_active]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_config'
+*/
+CREATE TABLE [phpbb_config] (
+ [config_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [config_value] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [is_dynamic] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_config] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_config] PRIMARY KEY CLUSTERED
+ (
+ [config_name]
+ ) ON [PRIMARY]
+GO
+
+CREATE INDEX [is_dynamic] ON [phpbb_config]([is_dynamic]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_confirm'
+*/
+CREATE TABLE [phpbb_confirm] (
+ [confirm_id] [char] (32) DEFAULT ('') NOT NULL ,
+ [session_id] [char] (32) DEFAULT ('') NOT NULL ,
+ [confirm_type] [int] DEFAULT (0) NOT NULL ,
+ [code] [varchar] (8) DEFAULT ('') NOT NULL ,
+ [seed] [int] DEFAULT (0) NOT NULL ,
+ [attempts] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_confirm] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_confirm] PRIMARY KEY CLUSTERED
+ (
+ [session_id],
+ [confirm_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE INDEX [confirm_type] ON [phpbb_confirm]([confirm_type]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_disallow'
+*/
+CREATE TABLE [phpbb_disallow] (
+ [disallow_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [disallow_username] [varchar] (255) DEFAULT ('') 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] DEFAULT (0) NOT NULL ,
+ [topic_id] [int] DEFAULT (0) NOT NULL ,
+ [forum_id] [int] DEFAULT (0) NOT NULL ,
+ [save_time] [int] DEFAULT (0) NOT NULL ,
+ [draft_subject] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [draft_message] [text] DEFAULT ('') NOT NULL
+) 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
+
+CREATE INDEX [save_time] ON [phpbb_drafts]([save_time]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_ext'
+*/
+CREATE TABLE [phpbb_ext] (
+ [ext_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [ext_active] [int] DEFAULT (0) NOT NULL ,
+ [ext_state] [varchar] (8000) DEFAULT ('') NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE UNIQUE INDEX [ext_name] ON [phpbb_ext]([ext_name]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_extensions'
+*/
+CREATE TABLE [phpbb_extensions] (
+ [extension_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [group_id] [int] DEFAULT (0) NOT NULL ,
+ [extension] [varchar] (100) DEFAULT ('') NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_extensions] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_extensions] PRIMARY KEY CLUSTERED
+ (
+ [extension_id]
+ ) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_extension_groups'
+*/
+CREATE TABLE [phpbb_extension_groups] (
+ [group_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [group_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [cat_id] [int] DEFAULT (0) NOT NULL ,
+ [allow_group] [int] DEFAULT (0) NOT NULL ,
+ [download_mode] [int] DEFAULT (1) NOT NULL ,
+ [upload_icon] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [max_filesize] [int] DEFAULT (0) NOT NULL ,
+ [allowed_forums] [varchar] (8000) DEFAULT ('') NOT NULL ,
+ [allow_in_pm] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_extension_groups] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_extension_groups] PRIMARY KEY CLUSTERED
+ (
+ [group_id]
+ ) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_forums'
+*/
+CREATE TABLE [phpbb_forums] (
+ [forum_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [parent_id] [int] DEFAULT (0) NOT NULL ,
+ [left_id] [int] DEFAULT (0) NOT NULL ,
+ [right_id] [int] DEFAULT (0) NOT NULL ,
+ [forum_parents] [text] DEFAULT ('') NOT NULL ,
+ [forum_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [forum_desc] [varchar] (4000) DEFAULT ('') NOT NULL ,
+ [forum_desc_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [forum_desc_options] [int] DEFAULT (7) NOT NULL ,
+ [forum_desc_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
+ [forum_link] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [forum_password] [varchar] (40) DEFAULT ('') NOT NULL ,
+ [forum_style] [int] DEFAULT (0) NOT NULL ,
+ [forum_image] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [forum_rules] [varchar] (4000) DEFAULT ('') NOT NULL ,
+ [forum_rules_link] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [forum_rules_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [forum_rules_options] [int] DEFAULT (7) NOT NULL ,
+ [forum_rules_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
+ [forum_topics_per_page] [int] DEFAULT (0) NOT NULL ,
+ [forum_type] [int] DEFAULT (0) NOT NULL ,
+ [forum_status] [int] DEFAULT (0) NOT NULL ,
+ [forum_posts] [int] DEFAULT (0) NOT NULL ,
+ [forum_topics] [int] DEFAULT (0) NOT NULL ,
+ [forum_topics_real] [int] DEFAULT (0) NOT NULL ,
+ [forum_last_post_id] [int] DEFAULT (0) NOT NULL ,
+ [forum_last_poster_id] [int] DEFAULT (0) NOT NULL ,
+ [forum_last_post_subject] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [forum_last_post_time] [int] DEFAULT (0) NOT NULL ,
+ [forum_last_poster_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [forum_last_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL ,
+ [forum_flags] [int] DEFAULT (32) NOT NULL ,
+ [forum_options] [int] DEFAULT (0) NOT NULL ,
+ [display_subforum_list] [int] DEFAULT (1) NOT NULL ,
+ [display_on_index] [int] DEFAULT (1) NOT NULL ,
+ [enable_indexing] [int] DEFAULT (1) NOT NULL ,
+ [enable_icons] [int] DEFAULT (1) NOT NULL ,
+ [enable_prune] [int] DEFAULT (0) NOT NULL ,
+ [prune_next] [int] DEFAULT (0) NOT NULL ,
+ [prune_days] [int] DEFAULT (0) NOT NULL ,
+ [prune_viewed] [int] DEFAULT (0) NOT NULL ,
+ [prune_freq] [int] DEFAULT (0) NOT NULL
+) 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
+
+CREATE INDEX [left_right_id] ON [phpbb_forums]([left_id], [right_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [forum_lastpost_id] ON [phpbb_forums]([forum_last_post_id]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_forums_access'
+*/
+CREATE TABLE [phpbb_forums_access] (
+ [forum_id] [int] DEFAULT (0) NOT NULL ,
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [session_id] [char] (32) DEFAULT ('') NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_forums_access] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_forums_access] PRIMARY KEY CLUSTERED
+ (
+ [forum_id],
+ [user_id],
+ [session_id]
+ ) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_forums_track'
+*/
+CREATE TABLE [phpbb_forums_track] (
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [forum_id] [int] DEFAULT (0) NOT NULL ,
+ [mark_time] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_forums_track] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_forums_track] PRIMARY KEY CLUSTERED
+ (
+ [user_id],
+ [forum_id]
+ ) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_forums_watch'
+*/
+CREATE TABLE [phpbb_forums_watch] (
+ [forum_id] [int] DEFAULT (0) NOT NULL ,
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [notify_status] [int] DEFAULT (0) NOT NULL
+) 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_stat] 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] DEFAULT (1) NOT NULL ,
+ [group_founder_manage] [int] DEFAULT (0) NOT NULL ,
+ [group_skip_auth] [int] DEFAULT (0) NOT NULL ,
+ [group_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [group_desc] [varchar] (4000) DEFAULT ('') NOT NULL ,
+ [group_desc_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [group_desc_options] [int] DEFAULT (7) NOT NULL ,
+ [group_desc_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
+ [group_display] [int] DEFAULT (0) NOT NULL ,
+ [group_avatar] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [group_avatar_type] [int] DEFAULT (0) NOT NULL ,
+ [group_avatar_width] [int] DEFAULT (0) NOT NULL ,
+ [group_avatar_height] [int] DEFAULT (0) NOT NULL ,
+ [group_rank] [int] DEFAULT (0) NOT NULL ,
+ [group_colour] [varchar] (6) DEFAULT ('') NOT NULL ,
+ [group_sig_chars] [int] DEFAULT (0) NOT NULL ,
+ [group_receive_pm] [int] DEFAULT (0) NOT NULL ,
+ [group_message_limit] [int] DEFAULT (0) NOT NULL ,
+ [group_max_recipients] [int] DEFAULT (0) NOT NULL ,
+ [group_legend] [int] DEFAULT (0) NOT NULL ,
+ [group_teampage] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_groups] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_groups] PRIMARY KEY CLUSTERED
+ (
+ [group_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE INDEX [group_legend_name] ON [phpbb_groups]([group_legend], [group_name]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_icons'
+*/
+CREATE TABLE [phpbb_icons] (
+ [icons_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [icons_url] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [icons_width] [int] DEFAULT (0) NOT NULL ,
+ [icons_height] [int] DEFAULT (0) NOT NULL ,
+ [icons_order] [int] DEFAULT (0) NOT NULL ,
+ [display_on_posting] [int] DEFAULT (1) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_icons] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_icons] PRIMARY KEY CLUSTERED
+ (
+ [icons_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE INDEX [display_on_posting] ON [phpbb_icons]([display_on_posting]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_lang'
+*/
+CREATE TABLE [phpbb_lang] (
+ [lang_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [lang_iso] [varchar] (30) DEFAULT ('') NOT NULL ,
+ [lang_dir] [varchar] (30) DEFAULT ('') NOT NULL ,
+ [lang_english_name] [varchar] (100) DEFAULT ('') NOT NULL ,
+ [lang_local_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [lang_author] [varchar] (255) DEFAULT ('') NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_lang] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_lang] PRIMARY KEY CLUSTERED
+ (
+ [lang_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE INDEX [lang_iso] ON [phpbb_lang]([lang_iso]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_log'
+*/
+CREATE TABLE [phpbb_log] (
+ [log_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [log_type] [int] DEFAULT (0) NOT NULL ,
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [forum_id] [int] DEFAULT (0) NOT NULL ,
+ [topic_id] [int] DEFAULT (0) NOT NULL ,
+ [reportee_id] [int] DEFAULT (0) NOT NULL ,
+ [log_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
+ [log_time] [int] DEFAULT (0) NOT NULL ,
+ [log_operation] [varchar] (4000) DEFAULT ('') NOT NULL ,
+ [log_data] [text] DEFAULT ('') NOT NULL
+) 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
+
+CREATE INDEX [log_type] ON [phpbb_log]([log_type]) ON [PRIMARY]
+GO
+
+CREATE INDEX [log_time] ON [phpbb_log]([log_time]) 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_login_attempts'
+*/
+CREATE TABLE [phpbb_login_attempts] (
+ [attempt_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
+ [attempt_browser] [varchar] (150) DEFAULT ('') NOT NULL ,
+ [attempt_forwarded_for] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [attempt_time] [int] DEFAULT (0) NOT NULL ,
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [username] [varchar] (255) DEFAULT (0) NOT NULL ,
+ [username_clean] [varchar] (255) DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE INDEX [att_ip] ON [phpbb_login_attempts]([attempt_ip], [attempt_time]) ON [PRIMARY]
+GO
+
+CREATE INDEX [att_for] ON [phpbb_login_attempts]([attempt_forwarded_for], [attempt_time]) ON [PRIMARY]
+GO
+
+CREATE INDEX [att_time] ON [phpbb_login_attempts]([attempt_time]) ON [PRIMARY]
+GO
+
+CREATE INDEX [user_id] ON [phpbb_login_attempts]([user_id]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_moderator_cache'
+*/
+CREATE TABLE [phpbb_moderator_cache] (
+ [forum_id] [int] DEFAULT (0) NOT NULL ,
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [username] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [group_id] [int] DEFAULT (0) NOT NULL ,
+ [group_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [display_on_index] [int] DEFAULT (1) NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE INDEX [disp_idx] 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] DEFAULT (1) NOT NULL ,
+ [module_display] [int] DEFAULT (1) NOT NULL ,
+ [module_basename] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [module_class] [varchar] (10) DEFAULT ('') NOT NULL ,
+ [parent_id] [int] DEFAULT (0) NOT NULL ,
+ [left_id] [int] DEFAULT (0) NOT NULL ,
+ [right_id] [int] DEFAULT (0) NOT NULL ,
+ [module_langname] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [module_mode] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [module_auth] [varchar] (255) DEFAULT ('') NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_modules] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_modules] PRIMARY KEY CLUSTERED
+ (
+ [module_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE INDEX [left_right_id] ON [phpbb_modules]([left_id], [right_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [module_enabled] ON [phpbb_modules]([module_enabled]) ON [PRIMARY]
+GO
+
+CREATE INDEX [class_left_id] ON [phpbb_modules]([module_class], [left_id]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_poll_options'
+*/
+CREATE TABLE [phpbb_poll_options] (
+ [poll_option_id] [int] DEFAULT (0) NOT NULL ,
+ [topic_id] [int] DEFAULT (0) NOT NULL ,
+ [poll_option_text] [varchar] (4000) DEFAULT ('') NOT NULL ,
+ [poll_option_total] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE INDEX [poll_opt_id] ON [phpbb_poll_options]([poll_option_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [topic_id] ON [phpbb_poll_options]([topic_id]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_poll_votes'
+*/
+CREATE TABLE [phpbb_poll_votes] (
+ [topic_id] [int] DEFAULT (0) NOT NULL ,
+ [poll_option_id] [int] DEFAULT (0) NOT NULL ,
+ [vote_user_id] [int] DEFAULT (0) NOT NULL ,
+ [vote_user_ip] [varchar] (40) DEFAULT ('') NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE INDEX [topic_id] ON [phpbb_poll_votes]([topic_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [vote_user_id] ON [phpbb_poll_votes]([vote_user_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [vote_user_ip] ON [phpbb_poll_votes]([vote_user_ip]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_posts'
+*/
+CREATE TABLE [phpbb_posts] (
+ [post_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [topic_id] [int] DEFAULT (0) NOT NULL ,
+ [forum_id] [int] DEFAULT (0) NOT NULL ,
+ [poster_id] [int] DEFAULT (0) NOT NULL ,
+ [icon_id] [int] DEFAULT (0) NOT NULL ,
+ [poster_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
+ [post_time] [int] DEFAULT (0) NOT NULL ,
+ [post_approved] [int] DEFAULT (1) NOT NULL ,
+ [post_reported] [int] DEFAULT (0) NOT NULL ,
+ [enable_bbcode] [int] DEFAULT (1) NOT NULL ,
+ [enable_smilies] [int] DEFAULT (1) NOT NULL ,
+ [enable_magic_url] [int] DEFAULT (1) NOT NULL ,
+ [enable_sig] [int] DEFAULT (1) NOT NULL ,
+ [post_username] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [post_subject] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [post_text] [text] DEFAULT ('') NOT NULL ,
+ [post_checksum] [varchar] (32) DEFAULT ('') NOT NULL ,
+ [post_attachment] [int] DEFAULT (0) NOT NULL ,
+ [bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [bbcode_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
+ [post_postcount] [int] DEFAULT (1) NOT NULL ,
+ [post_edit_time] [int] DEFAULT (0) NOT NULL ,
+ [post_edit_reason] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [post_edit_user] [int] DEFAULT (0) NOT NULL ,
+ [post_edit_count] [int] DEFAULT (0) NOT NULL ,
+ [post_edit_locked] [int] DEFAULT (0) NOT NULL
+) 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
+
+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_username] ON [phpbb_posts]([post_username]) ON [PRIMARY]
+GO
+
+CREATE INDEX [tid_post_time] ON [phpbb_posts]([topic_id], [post_time]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_privmsgs'
+*/
+CREATE TABLE [phpbb_privmsgs] (
+ [msg_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [root_level] [int] DEFAULT (0) NOT NULL ,
+ [author_id] [int] DEFAULT (0) NOT NULL ,
+ [icon_id] [int] DEFAULT (0) NOT NULL ,
+ [author_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
+ [message_time] [int] DEFAULT (0) NOT NULL ,
+ [enable_bbcode] [int] DEFAULT (1) NOT NULL ,
+ [enable_smilies] [int] DEFAULT (1) NOT NULL ,
+ [enable_magic_url] [int] DEFAULT (1) NOT NULL ,
+ [enable_sig] [int] DEFAULT (1) NOT NULL ,
+ [message_subject] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [message_text] [text] DEFAULT ('') NOT NULL ,
+ [message_edit_reason] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [message_edit_user] [int] DEFAULT (0) NOT NULL ,
+ [message_attachment] [int] DEFAULT (0) NOT NULL ,
+ [bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [bbcode_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
+ [message_edit_time] [int] DEFAULT (0) NOT NULL ,
+ [message_edit_count] [int] DEFAULT (0) NOT NULL ,
+ [to_address] [varchar] (4000) DEFAULT ('') NOT NULL ,
+ [bcc_address] [varchar] (4000) DEFAULT ('') NOT NULL ,
+ [message_reported] [int] DEFAULT (0) NOT NULL
+) 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
+
+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] DEFAULT (0) NOT NULL ,
+ [folder_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [pm_count] [int] DEFAULT (0) 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
+
+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] DEFAULT (0) NOT NULL ,
+ [rule_check] [int] DEFAULT (0) NOT NULL ,
+ [rule_connection] [int] DEFAULT (0) NOT NULL ,
+ [rule_string] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [rule_user_id] [int] DEFAULT (0) NOT NULL ,
+ [rule_group_id] [int] DEFAULT (0) NOT NULL ,
+ [rule_action] [int] DEFAULT (0) NOT NULL ,
+ [rule_folder_id] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_privmsgs_rules] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_privmsgs_rules] PRIMARY KEY CLUSTERED
+ (
+ [rule_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE INDEX [user_id] ON [phpbb_privmsgs_rules]([user_id]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_privmsgs_to'
+*/
+CREATE TABLE [phpbb_privmsgs_to] (
+ [msg_id] [int] DEFAULT (0) NOT NULL ,
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [author_id] [int] DEFAULT (0) NOT NULL ,
+ [pm_deleted] [int] DEFAULT (0) NOT NULL ,
+ [pm_new] [int] DEFAULT (1) NOT NULL ,
+ [pm_unread] [int] DEFAULT (1) NOT NULL ,
+ [pm_replied] [int] DEFAULT (0) NOT NULL ,
+ [pm_marked] [int] DEFAULT (0) NOT NULL ,
+ [pm_forwarded] [int] DEFAULT (0) NOT NULL ,
+ [folder_id] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE INDEX [msg_id] ON [phpbb_privmsgs_to]([msg_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [author_id] ON [phpbb_privmsgs_to]([author_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [usr_flder_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] (255) DEFAULT ('') NOT NULL ,
+ [field_type] [int] DEFAULT (0) NOT NULL ,
+ [field_ident] [varchar] (20) DEFAULT ('') NOT NULL ,
+ [field_length] [varchar] (20) DEFAULT ('') NOT NULL ,
+ [field_minlen] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [field_maxlen] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [field_novalue] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [field_default_value] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [field_validation] [varchar] (20) DEFAULT ('') NOT NULL ,
+ [field_required] [int] DEFAULT (0) NOT NULL ,
+ [field_show_novalue] [int] DEFAULT (0) NOT NULL ,
+ [field_show_on_reg] [int] DEFAULT (0) NOT NULL ,
+ [field_show_on_pm] [int] DEFAULT (0) NOT NULL ,
+ [field_show_on_vt] [int] DEFAULT (0) NOT NULL ,
+ [field_show_profile] [int] DEFAULT (0) NOT NULL ,
+ [field_hide] [int] DEFAULT (0) NOT NULL ,
+ [field_no_view] [int] DEFAULT (0) NOT NULL ,
+ [field_active] [int] DEFAULT (0) NOT NULL ,
+ [field_order] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_profile_fields] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_profile_fields] PRIMARY KEY CLUSTERED
+ (
+ [field_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE INDEX [fld_type] ON [phpbb_profile_fields]([field_type]) ON [PRIMARY]
+GO
+
+CREATE INDEX [fld_ordr] ON [phpbb_profile_fields]([field_order]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_profile_fields_data'
+*/
+CREATE TABLE [phpbb_profile_fields_data] (
+ [user_id] [int] DEFAULT (0) 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
+
+
+/*
+ Table: 'phpbb_profile_fields_lang'
+*/
+CREATE TABLE [phpbb_profile_fields_lang] (
+ [field_id] [int] DEFAULT (0) NOT NULL ,
+ [lang_id] [int] DEFAULT (0) NOT NULL ,
+ [option_id] [int] DEFAULT (0) NOT NULL ,
+ [field_type] [int] DEFAULT (0) NOT NULL ,
+ [lang_value] [varchar] (255) DEFAULT ('') NOT NULL
+) 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
+
+
+/*
+ Table: 'phpbb_profile_lang'
+*/
+CREATE TABLE [phpbb_profile_lang] (
+ [field_id] [int] DEFAULT (0) NOT NULL ,
+ [lang_id] [int] DEFAULT (0) NOT NULL ,
+ [lang_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [lang_explain] [varchar] (4000) DEFAULT ('') NOT NULL ,
+ [lang_default_value] [varchar] (255) DEFAULT ('') NOT NULL
+) 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
+
+
+/*
+ Table: 'phpbb_ranks'
+*/
+CREATE TABLE [phpbb_ranks] (
+ [rank_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [rank_title] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [rank_min] [int] DEFAULT (0) NOT NULL ,
+ [rank_special] [int] DEFAULT (0) NOT NULL ,
+ [rank_image] [varchar] (255) DEFAULT ('') NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_ranks] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_ranks] PRIMARY KEY CLUSTERED
+ (
+ [rank_id]
+ ) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_reports'
+*/
+CREATE TABLE [phpbb_reports] (
+ [report_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [reason_id] [int] DEFAULT (0) NOT NULL ,
+ [post_id] [int] DEFAULT (0) NOT NULL ,
+ [pm_id] [int] DEFAULT (0) NOT NULL ,
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [user_notify] [int] DEFAULT (0) NOT NULL ,
+ [report_closed] [int] DEFAULT (0) NOT NULL ,
+ [report_time] [int] DEFAULT (0) NOT NULL ,
+ [report_text] [text] DEFAULT ('') NOT NULL ,
+ [reported_post_text] [text] DEFAULT ('') NOT NULL
+) 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
+
+CREATE INDEX [post_id] ON [phpbb_reports]([post_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [pm_id] ON [phpbb_reports]([pm_id]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_reports_reasons'
+*/
+CREATE TABLE [phpbb_reports_reasons] (
+ [reason_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [reason_title] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [reason_description] [text] DEFAULT ('') NOT NULL ,
+ [reason_order] [int] DEFAULT (0) NOT NULL
+) 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
+
+
+/*
+ Table: 'phpbb_search_results'
+*/
+CREATE TABLE [phpbb_search_results] (
+ [search_key] [varchar] (32) DEFAULT ('') NOT NULL ,
+ [search_time] [int] DEFAULT (0) NOT NULL ,
+ [search_keywords] [text] DEFAULT ('') NOT NULL ,
+ [search_authors] [text] DEFAULT ('') NOT NULL
+) 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
+
+
+/*
+ Table: 'phpbb_search_wordlist'
+*/
+CREATE TABLE [phpbb_search_wordlist] (
+ [word_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [word_text] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [word_common] [int] DEFAULT (0) NOT NULL ,
+ [word_count] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_search_wordlist] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_search_wordlist] PRIMARY KEY CLUSTERED
+ (
+ [word_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE UNIQUE INDEX [wrd_txt] ON [phpbb_search_wordlist]([word_text]) ON [PRIMARY]
+GO
+
+CREATE INDEX [wrd_cnt] ON [phpbb_search_wordlist]([word_count]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_search_wordmatch'
+*/
+CREATE TABLE [phpbb_search_wordmatch] (
+ [post_id] [int] DEFAULT (0) NOT NULL ,
+ [word_id] [int] DEFAULT (0) NOT NULL ,
+ [title_match] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE UNIQUE INDEX [unq_mtch] ON [phpbb_search_wordmatch]([word_id], [post_id], [title_match]) ON [PRIMARY]
+GO
+
+CREATE INDEX [word_id] ON [phpbb_search_wordmatch]([word_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [post_id] ON [phpbb_search_wordmatch]([post_id]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_sessions'
+*/
+CREATE TABLE [phpbb_sessions] (
+ [session_id] [char] (32) DEFAULT ('') NOT NULL ,
+ [session_user_id] [int] DEFAULT (0) NOT NULL ,
+ [session_forum_id] [int] DEFAULT (0) NOT NULL ,
+ [session_last_visit] [int] DEFAULT (0) NOT NULL ,
+ [session_start] [int] DEFAULT (0) NOT NULL ,
+ [session_time] [int] DEFAULT (0) NOT NULL ,
+ [session_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
+ [session_browser] [varchar] (150) DEFAULT ('') NOT NULL ,
+ [session_forwarded_for] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [session_page] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [session_viewonline] [int] DEFAULT (1) NOT NULL ,
+ [session_autologin] [int] DEFAULT (0) NOT NULL ,
+ [session_admin] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_sessions] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_sessions] PRIMARY KEY CLUSTERED
+ (
+ [session_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 [session_fid] ON [phpbb_sessions]([session_forum_id]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_sessions_keys'
+*/
+CREATE TABLE [phpbb_sessions_keys] (
+ [key_id] [char] (32) DEFAULT ('') NOT NULL ,
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [last_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
+ [last_login] [int] DEFAULT (0) NOT NULL
+) 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
+
+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) DEFAULT ('') NOT NULL ,
+ [site_hostname] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [ip_exclude] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_sitelist] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_sitelist] PRIMARY KEY CLUSTERED
+ (
+ [site_id]
+ ) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_smilies'
+*/
+CREATE TABLE [phpbb_smilies] (
+ [smiley_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [code] [varchar] (50) DEFAULT ('') NOT NULL ,
+ [emotion] [varchar] (50) DEFAULT ('') NOT NULL ,
+ [smiley_url] [varchar] (50) DEFAULT ('') NOT NULL ,
+ [smiley_width] [int] DEFAULT (0) NOT NULL ,
+ [smiley_height] [int] DEFAULT (0) NOT NULL ,
+ [smiley_order] [int] DEFAULT (0) NOT NULL ,
+ [display_on_posting] [int] DEFAULT (1) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_smilies] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_smilies] PRIMARY KEY CLUSTERED
+ (
+ [smiley_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE INDEX [display_on_post] ON [phpbb_smilies]([display_on_posting]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_styles'
+*/
+CREATE TABLE [phpbb_styles] (
+ [style_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [style_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [style_copyright] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [style_active] [int] DEFAULT (1) NOT NULL ,
+ [style_path] [varchar] (100) DEFAULT ('') NOT NULL ,
+ [bbcode_bitfield] [varchar] (255) DEFAULT ('kNg=') NOT NULL ,
+ [style_parent_id] [int] DEFAULT (0) NOT NULL ,
+ [style_parent_tree] [varchar] (8000) DEFAULT ('') NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_styles] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_styles] PRIMARY KEY CLUSTERED
+ (
+ [style_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE UNIQUE INDEX [style_name] ON [phpbb_styles]([style_name]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_topics'
+*/
+CREATE TABLE [phpbb_topics] (
+ [topic_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [forum_id] [int] DEFAULT (0) NOT NULL ,
+ [icon_id] [int] DEFAULT (0) NOT NULL ,
+ [topic_attachment] [int] DEFAULT (0) NOT NULL ,
+ [topic_approved] [int] DEFAULT (1) NOT NULL ,
+ [topic_reported] [int] DEFAULT (0) NOT NULL ,
+ [topic_title] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [topic_poster] [int] DEFAULT (0) NOT NULL ,
+ [topic_time] [int] DEFAULT (0) NOT NULL ,
+ [topic_time_limit] [int] DEFAULT (0) NOT NULL ,
+ [topic_views] [int] DEFAULT (0) NOT NULL ,
+ [topic_replies] [int] DEFAULT (0) NOT NULL ,
+ [topic_replies_real] [int] DEFAULT (0) NOT NULL ,
+ [topic_status] [int] DEFAULT (0) NOT NULL ,
+ [topic_type] [int] DEFAULT (0) NOT NULL ,
+ [topic_first_post_id] [int] DEFAULT (0) NOT NULL ,
+ [topic_first_poster_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [topic_first_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL ,
+ [topic_last_post_id] [int] DEFAULT (0) NOT NULL ,
+ [topic_last_poster_id] [int] DEFAULT (0) NOT NULL ,
+ [topic_last_poster_name] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [topic_last_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL ,
+ [topic_last_post_subject] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [topic_last_post_time] [int] DEFAULT (0) NOT NULL ,
+ [topic_last_view_time] [int] DEFAULT (0) NOT NULL ,
+ [topic_moved_id] [int] DEFAULT (0) NOT NULL ,
+ [topic_bumped] [int] DEFAULT (0) NOT NULL ,
+ [topic_bumper] [int] DEFAULT (0) NOT NULL ,
+ [poll_title] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [poll_start] [int] DEFAULT (0) NOT NULL ,
+ [poll_length] [int] DEFAULT (0) NOT NULL ,
+ [poll_max_options] [int] DEFAULT (1) NOT NULL ,
+ [poll_last_vote] [int] DEFAULT (0) NOT NULL ,
+ [poll_vote_change] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_topics] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_topics] PRIMARY KEY CLUSTERED
+ (
+ [topic_id]
+ ) ON [PRIMARY]
+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 [last_post_time] ON [phpbb_topics]([topic_last_post_time]) ON [PRIMARY]
+GO
+
+CREATE INDEX [topic_approved] ON [phpbb_topics]([topic_approved]) ON [PRIMARY]
+GO
+
+CREATE INDEX [forum_appr_last] ON [phpbb_topics]([forum_id], [topic_approved], [topic_last_post_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [fid_time_moved] ON [phpbb_topics]([forum_id], [topic_last_post_time], [topic_moved_id]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_topics_track'
+*/
+CREATE TABLE [phpbb_topics_track] (
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [topic_id] [int] DEFAULT (0) NOT NULL ,
+ [forum_id] [int] DEFAULT (0) NOT NULL ,
+ [mark_time] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_topics_track] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_topics_track] PRIMARY KEY CLUSTERED
+ (
+ [user_id],
+ [topic_id]
+ ) ON [PRIMARY]
+GO
+
+CREATE INDEX [topic_id] ON [phpbb_topics_track]([topic_id]) ON [PRIMARY]
+GO
+
+CREATE INDEX [forum_id] ON [phpbb_topics_track]([forum_id]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_topics_posted'
+*/
+CREATE TABLE [phpbb_topics_posted] (
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [topic_id] [int] DEFAULT (0) NOT NULL ,
+ [topic_posted] [int] DEFAULT (0) NOT NULL
+) 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
+
+
+/*
+ Table: 'phpbb_topics_watch'
+*/
+CREATE TABLE [phpbb_topics_watch] (
+ [topic_id] [int] DEFAULT (0) NOT NULL ,
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [notify_status] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+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_stat] ON [phpbb_topics_watch]([notify_status]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_user_group'
+*/
+CREATE TABLE [phpbb_user_group] (
+ [group_id] [int] DEFAULT (0) NOT NULL ,
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [group_leader] [int] DEFAULT (0) NOT NULL ,
+ [user_pending] [int] DEFAULT (1) NOT NULL
+) ON [PRIMARY]
+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] DEFAULT (0) NOT NULL ,
+ [group_id] [int] DEFAULT (3) NOT NULL ,
+ [user_permissions] [text] DEFAULT ('') NOT NULL ,
+ [user_perm_from] [int] DEFAULT (0) NOT NULL ,
+ [user_ip] [varchar] (40) DEFAULT ('') NOT NULL ,
+ [user_regdate] [int] DEFAULT (0) NOT NULL ,
+ [username] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [username_clean] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [user_password] [varchar] (40) DEFAULT ('') NOT NULL ,
+ [user_passchg] [int] DEFAULT (0) NOT NULL ,
+ [user_pass_convert] [int] DEFAULT (0) NOT NULL ,
+ [user_email] [varchar] (100) DEFAULT ('') NOT NULL ,
+ [user_email_hash] [float] DEFAULT (0) NOT NULL ,
+ [user_birthday] [varchar] (10) DEFAULT ('') NOT NULL ,
+ [user_lastvisit] [int] DEFAULT (0) NOT NULL ,
+ [user_lastmark] [int] DEFAULT (0) NOT NULL ,
+ [user_lastpost_time] [int] DEFAULT (0) NOT NULL ,
+ [user_lastpage] [varchar] (200) DEFAULT ('') NOT NULL ,
+ [user_last_confirm_key] [varchar] (10) DEFAULT ('') NOT NULL ,
+ [user_last_search] [int] DEFAULT (0) NOT NULL ,
+ [user_warnings] [int] DEFAULT (0) NOT NULL ,
+ [user_last_warning] [int] DEFAULT (0) NOT NULL ,
+ [user_login_attempts] [int] DEFAULT (0) NOT NULL ,
+ [user_inactive_reason] [int] DEFAULT (0) NOT NULL ,
+ [user_inactive_time] [int] DEFAULT (0) NOT NULL ,
+ [user_posts] [int] DEFAULT (0) NOT NULL ,
+ [user_lang] [varchar] (30) DEFAULT ('') NOT NULL ,
+ [user_timezone] [varchar] (100) DEFAULT ('UTC') NOT NULL ,
+ [user_dateformat] [varchar] (30) DEFAULT ('d M Y H:i') NOT NULL ,
+ [user_style] [int] DEFAULT (0) NOT NULL ,
+ [user_rank] [int] DEFAULT (0) NOT NULL ,
+ [user_colour] [varchar] (6) DEFAULT ('') NOT NULL ,
+ [user_new_privmsg] [int] DEFAULT (0) NOT NULL ,
+ [user_unread_privmsg] [int] DEFAULT (0) NOT NULL ,
+ [user_last_privmsg] [int] DEFAULT (0) NOT NULL ,
+ [user_message_rules] [int] DEFAULT (0) NOT NULL ,
+ [user_full_folder] [int] DEFAULT (-3) NOT NULL ,
+ [user_emailtime] [int] DEFAULT (0) NOT NULL ,
+ [user_topic_show_days] [int] DEFAULT (0) NOT NULL ,
+ [user_topic_sortby_type] [varchar] (1) DEFAULT ('t') NOT NULL ,
+ [user_topic_sortby_dir] [varchar] (1) DEFAULT ('d') NOT NULL ,
+ [user_post_show_days] [int] DEFAULT (0) NOT NULL ,
+ [user_post_sortby_type] [varchar] (1) DEFAULT ('t') NOT NULL ,
+ [user_post_sortby_dir] [varchar] (1) DEFAULT ('a') NOT NULL ,
+ [user_notify] [int] DEFAULT (0) NOT NULL ,
+ [user_notify_pm] [int] DEFAULT (1) NOT NULL ,
+ [user_notify_type] [int] DEFAULT (0) NOT NULL ,
+ [user_allow_pm] [int] DEFAULT (1) NOT NULL ,
+ [user_allow_viewonline] [int] DEFAULT (1) NOT NULL ,
+ [user_allow_viewemail] [int] DEFAULT (1) NOT NULL ,
+ [user_allow_massemail] [int] DEFAULT (1) NOT NULL ,
+ [user_options] [int] DEFAULT (230271) NOT NULL ,
+ [user_avatar] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [user_avatar_type] [int] DEFAULT (0) NOT NULL ,
+ [user_avatar_width] [int] DEFAULT (0) NOT NULL ,
+ [user_avatar_height] [int] DEFAULT (0) NOT NULL ,
+ [user_sig] [text] DEFAULT ('') NOT NULL ,
+ [user_sig_bbcode_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
+ [user_sig_bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [user_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] (4000) DEFAULT ('') NOT NULL ,
+ [user_interests] [varchar] (4000) DEFAULT ('') NOT NULL ,
+ [user_actkey] [varchar] (32) DEFAULT ('') NOT NULL ,
+ [user_newpasswd] [varchar] (40) DEFAULT ('') NOT NULL ,
+ [user_form_salt] [varchar] (32) DEFAULT ('') NOT NULL ,
+ [user_new] [int] DEFAULT (1) NOT NULL ,
+ [user_reminded] [int] DEFAULT (0) NOT NULL ,
+ [user_reminded_time] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_users] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_users] PRIMARY KEY CLUSTERED
+ (
+ [user_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]
+GO
+
+CREATE INDEX [user_type] ON [phpbb_users]([user_type]) ON [PRIMARY]
+GO
+
+CREATE UNIQUE INDEX [username_clean] ON [phpbb_users]([username_clean]) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_warnings'
+*/
+CREATE TABLE [phpbb_warnings] (
+ [warning_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [post_id] [int] DEFAULT (0) NOT NULL ,
+ [log_id] [int] DEFAULT (0) NOT NULL ,
+ [warning_time] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_warnings] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_warnings] PRIMARY KEY CLUSTERED
+ (
+ [warning_id]
+ ) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_words'
+*/
+CREATE TABLE [phpbb_words] (
+ [word_id] [int] IDENTITY (1, 1) NOT NULL ,
+ [word] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [replacement] [varchar] (255) DEFAULT ('') NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_words] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_words] PRIMARY KEY CLUSTERED
+ (
+ [word_id]
+ ) ON [PRIMARY]
+GO
+
+
+/*
+ Table: 'phpbb_zebra'
+*/
+CREATE TABLE [phpbb_zebra] (
+ [user_id] [int] DEFAULT (0) NOT NULL ,
+ [zebra_id] [int] DEFAULT (0) NOT NULL ,
+ [friend] [int] DEFAULT (0) NOT NULL ,
+ [foe] [int] DEFAULT (0) NOT NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [phpbb_zebra] WITH NOCHECK ADD
+ CONSTRAINT [PK_phpbb_zebra] PRIMARY KEY CLUSTERED
+ (
+ [user_id],
+ [zebra_id]
+ ) ON [PRIMARY]
+GO
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
index e71afcd5b3..8f2b779649 100644
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ b/phpBB/install/schemas/mysql_40_schema.sql
@@ -1,978 +1,976 @@
-# DO NOT EDIT THIS FILE, IT IS GENERATED
-#
-# To change the contents of this file, edit
-# phpBB/develop/create_schema_files.php and
-# run it.
-# Table: 'phpbb_attachments'
-CREATE TABLE phpbb_attachments (
- attach_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- post_msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- in_message tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- is_orphan tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- physical_filename varbinary(255) DEFAULT '' NOT NULL,
- real_filename varbinary(255) DEFAULT '' NOT NULL,
- download_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- attach_comment blob NOT NULL,
- extension varbinary(100) DEFAULT '' NOT NULL,
- mimetype varbinary(100) DEFAULT '' NOT NULL,
- filesize int(20) UNSIGNED DEFAULT '0' NOT NULL,
- filetime int(11) UNSIGNED DEFAULT '0' NOT NULL,
- thumbnail tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (attach_id),
- KEY filetime (filetime),
- KEY post_msg_id (post_msg_id),
- KEY topic_id (topic_id),
- KEY poster_id (poster_id),
- KEY is_orphan (is_orphan)
-);
-
-
-# Table: 'phpbb_acl_groups'
-CREATE TABLE phpbb_acl_groups (
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_setting tinyint(2) DEFAULT '0' NOT NULL,
- KEY group_id (group_id),
- KEY auth_opt_id (auth_option_id),
- KEY auth_role_id (auth_role_id)
-);
-
-
-# Table: 'phpbb_acl_options'
-CREATE TABLE phpbb_acl_options (
- auth_option_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- auth_option varbinary(50) DEFAULT '' NOT NULL,
- is_global tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- is_local tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- founder_only tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (auth_option_id),
- UNIQUE auth_option (auth_option)
-);
-
-
-# Table: 'phpbb_acl_roles'
-CREATE TABLE phpbb_acl_roles (
- role_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- role_name blob NOT NULL,
- role_description blob NOT NULL,
- role_type varbinary(10) DEFAULT '' NOT NULL,
- role_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (role_id),
- KEY role_type (role_type),
- KEY role_order (role_order)
-);
-
-
-# Table: 'phpbb_acl_roles_data'
-CREATE TABLE phpbb_acl_roles_data (
- role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_setting tinyint(2) DEFAULT '0' NOT NULL,
- PRIMARY KEY (role_id, auth_option_id),
- KEY ath_op_id (auth_option_id)
-);
-
-
-# Table: 'phpbb_acl_users'
-CREATE TABLE phpbb_acl_users (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_setting tinyint(2) DEFAULT '0' NOT NULL,
- KEY user_id (user_id),
- KEY auth_option_id (auth_option_id),
- KEY auth_role_id (auth_role_id)
-);
-
-
-# Table: 'phpbb_banlist'
-CREATE TABLE phpbb_banlist (
- ban_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- ban_userid mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- ban_ip varbinary(40) DEFAULT '' NOT NULL,
- ban_email blob NOT NULL,
- ban_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
- ban_end int(11) UNSIGNED DEFAULT '0' NOT NULL,
- ban_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- ban_reason blob NOT NULL,
- ban_give_reason blob NOT NULL,
- PRIMARY KEY (ban_id),
- KEY ban_end (ban_end),
- KEY ban_user (ban_userid, ban_exclude),
- KEY ban_email (ban_email(255), ban_exclude),
- KEY ban_ip (ban_ip, ban_exclude)
-);
-
-
-# Table: 'phpbb_bbcodes'
-CREATE TABLE phpbb_bbcodes (
- bbcode_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_tag varbinary(16) DEFAULT '' NOT NULL,
- bbcode_helpline blob NOT NULL,
- display_on_posting tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_match blob NOT NULL,
- bbcode_tpl mediumblob NOT NULL,
- first_pass_match mediumblob NOT NULL,
- first_pass_replace mediumblob NOT NULL,
- second_pass_match mediumblob NOT NULL,
- second_pass_replace mediumblob NOT NULL,
- PRIMARY KEY (bbcode_id),
- KEY display_on_post (display_on_posting)
-);
-
-
-# Table: 'phpbb_bookmarks'
-CREATE TABLE phpbb_bookmarks (
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (topic_id, user_id)
-);
-
-
-# Table: 'phpbb_bots'
-CREATE TABLE phpbb_bots (
- bot_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- bot_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- bot_name blob NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- bot_agent varbinary(255) DEFAULT '' NOT NULL,
- bot_ip varbinary(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (bot_id),
- KEY bot_active (bot_active)
-);
-
-
-# Table: 'phpbb_config'
-CREATE TABLE phpbb_config (
- config_name varbinary(255) DEFAULT '' NOT NULL,
- config_value blob NOT NULL,
- is_dynamic tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (config_name),
- KEY is_dynamic (is_dynamic)
-);
-
-
-# Table: 'phpbb_confirm'
-CREATE TABLE phpbb_confirm (
- confirm_id binary(32) DEFAULT '' NOT NULL,
- session_id binary(32) DEFAULT '' NOT NULL,
- confirm_type tinyint(3) DEFAULT '0' NOT NULL,
- code varbinary(8) DEFAULT '' NOT NULL,
- seed int(10) UNSIGNED DEFAULT '0' NOT NULL,
- attempts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (session_id, confirm_id),
- KEY confirm_type (confirm_type)
-);
-
-
-# Table: 'phpbb_disallow'
-CREATE TABLE phpbb_disallow (
- disallow_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- disallow_username blob NOT NULL,
- PRIMARY KEY (disallow_id)
-);
-
-
-# Table: 'phpbb_drafts'
-CREATE TABLE phpbb_drafts (
- draft_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- save_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- draft_subject blob NOT NULL,
- draft_message mediumblob NOT NULL,
- PRIMARY KEY (draft_id),
- KEY save_time (save_time)
-);
-
-
-# Table: 'phpbb_ext'
-CREATE TABLE phpbb_ext (
- ext_name varbinary(255) DEFAULT '' NOT NULL,
- ext_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- ext_state blob NOT NULL,
- UNIQUE ext_name (ext_name)
-);
-
-
-# Table: 'phpbb_extensions'
-CREATE TABLE phpbb_extensions (
- extension_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- extension varbinary(100) DEFAULT '' NOT NULL,
- PRIMARY KEY (extension_id)
-);
-
-
-# Table: 'phpbb_extension_groups'
-CREATE TABLE phpbb_extension_groups (
- group_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- group_name blob NOT NULL,
- cat_id tinyint(2) DEFAULT '0' NOT NULL,
- allow_group tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- download_mode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- upload_icon varbinary(255) DEFAULT '' NOT NULL,
- max_filesize int(20) UNSIGNED DEFAULT '0' NOT NULL,
- allowed_forums blob NOT NULL,
- allow_in_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (group_id)
-);
-
-
-# Table: 'phpbb_forums'
-CREATE TABLE phpbb_forums (
- forum_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_parents mediumblob NOT NULL,
- forum_name blob NOT NULL,
- forum_desc blob NOT NULL,
- forum_desc_bitfield varbinary(255) DEFAULT '' NOT NULL,
- forum_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
- forum_desc_uid varbinary(8) DEFAULT '' NOT NULL,
- forum_link blob NOT NULL,
- forum_password varbinary(120) DEFAULT '' NOT NULL,
- forum_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_image varbinary(255) DEFAULT '' NOT NULL,
- forum_rules blob NOT NULL,
- forum_rules_link blob NOT NULL,
- forum_rules_bitfield varbinary(255) DEFAULT '' NOT NULL,
- forum_rules_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
- forum_rules_uid varbinary(8) DEFAULT '' NOT NULL,
- forum_topics_per_page tinyint(4) DEFAULT '0' NOT NULL,
- forum_type tinyint(4) DEFAULT '0' NOT NULL,
- forum_status tinyint(4) DEFAULT '0' NOT NULL,
- forum_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_topics mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_topics_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_post_subject blob NOT NULL,
- forum_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_poster_name blob NOT NULL,
- forum_last_poster_colour varbinary(6) DEFAULT '' NOT NULL,
- forum_flags tinyint(4) DEFAULT '32' NOT NULL,
- forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL,
- display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- prune_next int(11) UNSIGNED DEFAULT '0' NOT NULL,
- prune_days mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- prune_viewed mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- prune_freq mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (forum_id),
- KEY left_right_id (left_id, right_id),
- KEY forum_lastpost_id (forum_last_post_id)
-);
-
-
-# Table: 'phpbb_forums_access'
-CREATE TABLE phpbb_forums_access (
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- session_id binary(32) DEFAULT '' NOT NULL,
- PRIMARY KEY (forum_id, user_id, session_id)
-);
-
-
-# Table: 'phpbb_forums_track'
-CREATE TABLE phpbb_forums_track (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, forum_id)
-);
-
-
-# Table: 'phpbb_forums_watch'
-CREATE TABLE phpbb_forums_watch (
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- KEY forum_id (forum_id),
- KEY user_id (user_id),
- KEY notify_stat (notify_status)
-);
-
-
-# Table: 'phpbb_groups'
-CREATE TABLE phpbb_groups (
- group_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- group_type tinyint(4) DEFAULT '1' NOT NULL,
- group_founder_manage tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_skip_auth tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_name blob NOT NULL,
- group_desc blob NOT NULL,
- group_desc_bitfield varbinary(255) DEFAULT '' NOT NULL,
- group_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
- group_desc_uid varbinary(8) DEFAULT '' NOT NULL,
- group_display tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_avatar varbinary(255) DEFAULT '' NOT NULL,
- group_avatar_type tinyint(2) DEFAULT '0' NOT NULL,
- group_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- group_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- group_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_colour varbinary(6) DEFAULT '' NOT NULL,
- group_sig_chars mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_legend mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_teampage mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (group_id),
- KEY group_legend_name (group_legend, group_name(255))
-);
-
-
-# Table: 'phpbb_icons'
-CREATE TABLE phpbb_icons (
- icons_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- icons_url varbinary(255) DEFAULT '' NOT NULL,
- icons_width tinyint(4) DEFAULT '0' NOT NULL,
- icons_height tinyint(4) DEFAULT '0' NOT NULL,
- icons_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- PRIMARY KEY (icons_id),
- KEY display_on_posting (display_on_posting)
-);
-
-
-# Table: 'phpbb_lang'
-CREATE TABLE phpbb_lang (
- lang_id tinyint(4) NOT NULL auto_increment,
- lang_iso varbinary(30) DEFAULT '' NOT NULL,
- lang_dir varbinary(30) DEFAULT '' NOT NULL,
- lang_english_name blob NOT NULL,
- lang_local_name blob NOT NULL,
- lang_author blob NOT NULL,
- PRIMARY KEY (lang_id),
- KEY lang_iso (lang_iso)
-);
-
-
-# Table: 'phpbb_log'
-CREATE TABLE phpbb_log (
- log_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- log_type tinyint(4) DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- reportee_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- log_ip varbinary(40) DEFAULT '' NOT NULL,
- log_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- log_operation blob NOT NULL,
- log_data mediumblob NOT NULL,
- PRIMARY KEY (log_id),
- KEY log_type (log_type),
- KEY log_time (log_time),
- KEY forum_id (forum_id),
- KEY topic_id (topic_id),
- KEY reportee_id (reportee_id),
- KEY user_id (user_id)
-);
-
-
-# Table: 'phpbb_login_attempts'
-CREATE TABLE phpbb_login_attempts (
- attempt_ip varbinary(40) DEFAULT '' NOT NULL,
- attempt_browser varbinary(150) DEFAULT '' NOT NULL,
- attempt_forwarded_for varbinary(255) DEFAULT '' NOT NULL,
- attempt_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- username blob NOT NULL,
- username_clean blob NOT NULL,
- KEY att_ip (attempt_ip, attempt_time),
- KEY att_for (attempt_forwarded_for, attempt_time),
- KEY att_time (attempt_time),
- KEY user_id (user_id)
-);
-
-
-# Table: 'phpbb_moderator_cache'
-CREATE TABLE phpbb_moderator_cache (
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- username blob NOT NULL,
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_name blob NOT NULL,
- display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- KEY disp_idx (display_on_index),
- KEY forum_id (forum_id)
-);
-
-
-# Table: 'phpbb_modules'
-CREATE TABLE phpbb_modules (
- module_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- module_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- module_display tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- module_basename varbinary(255) DEFAULT '' NOT NULL,
- module_class varbinary(10) DEFAULT '' NOT NULL,
- parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- module_langname varbinary(255) DEFAULT '' NOT NULL,
- module_mode varbinary(255) DEFAULT '' NOT NULL,
- module_auth varbinary(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (module_id),
- KEY left_right_id (left_id, right_id),
- KEY module_enabled (module_enabled),
- KEY class_left_id (module_class, left_id)
-);
-
-
-# Table: 'phpbb_poll_options'
-CREATE TABLE phpbb_poll_options (
- poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poll_option_text blob NOT NULL,
- poll_option_total mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- KEY poll_opt_id (poll_option_id),
- KEY topic_id (topic_id)
-);
-
-
-# Table: 'phpbb_poll_votes'
-CREATE TABLE phpbb_poll_votes (
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
- vote_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- vote_user_ip varbinary(40) DEFAULT '' NOT NULL,
- KEY topic_id (topic_id),
- KEY vote_user_id (vote_user_id),
- KEY vote_user_ip (vote_user_ip)
-);
-
-
-# Table: 'phpbb_posts'
-CREATE TABLE phpbb_posts (
- post_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poster_ip varbinary(40) DEFAULT '' NOT NULL,
- post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- post_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- post_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- post_username blob NOT NULL,
- post_subject blob NOT NULL,
- post_text mediumblob NOT NULL,
- post_checksum varbinary(32) DEFAULT '' NOT NULL,
- post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_bitfield varbinary(255) DEFAULT '' NOT NULL,
- bbcode_uid varbinary(8) DEFAULT '' NOT NULL,
- post_postcount tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- post_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- post_edit_reason blob NOT NULL,
- post_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- post_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- post_edit_locked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (post_id),
- KEY forum_id (forum_id),
- KEY topic_id (topic_id),
- KEY poster_ip (poster_ip),
- KEY poster_id (poster_id),
- KEY post_approved (post_approved),
- KEY post_username (post_username(255)),
- KEY tid_post_time (topic_id, post_time)
-);
-
-
-# Table: 'phpbb_privmsgs'
-CREATE TABLE phpbb_privmsgs (
- msg_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- root_level mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- author_ip varbinary(40) DEFAULT '' NOT NULL,
- message_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- message_subject blob NOT NULL,
- message_text mediumblob NOT NULL,
- message_edit_reason blob NOT NULL,
- message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- message_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_bitfield varbinary(255) DEFAULT '' NOT NULL,
- bbcode_uid varbinary(8) DEFAULT '' NOT NULL,
- message_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- message_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- to_address blob NOT NULL,
- bcc_address blob NOT NULL,
- message_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (msg_id),
- KEY author_ip (author_ip),
- KEY message_time (message_time),
- KEY author_id (author_id),
- KEY root_level (root_level)
-);
-
-
-# Table: 'phpbb_privmsgs_folder'
-CREATE TABLE phpbb_privmsgs_folder (
- folder_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- folder_name blob NOT NULL,
- pm_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (folder_id),
- KEY user_id (user_id)
-);
-
-
-# Table: 'phpbb_privmsgs_rules'
-CREATE TABLE phpbb_privmsgs_rules (
- rule_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_check mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_connection mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_string blob NOT NULL,
- rule_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_action mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_folder_id int(11) DEFAULT '0' NOT NULL,
- PRIMARY KEY (rule_id),
- KEY user_id (user_id)
-);
-
-
-# Table: 'phpbb_privmsgs_to'
-CREATE TABLE phpbb_privmsgs_to (
- msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- pm_deleted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- pm_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- pm_unread tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- pm_replied tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- pm_marked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- pm_forwarded tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- folder_id int(11) DEFAULT '0' NOT NULL,
- KEY msg_id (msg_id),
- KEY author_id (author_id),
- KEY usr_flder_id (user_id, folder_id)
-);
-
-
-# Table: 'phpbb_profile_fields'
-CREATE TABLE phpbb_profile_fields (
- field_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- field_name blob NOT NULL,
- field_type tinyint(4) DEFAULT '0' NOT NULL,
- field_ident varbinary(20) DEFAULT '' NOT NULL,
- field_length varbinary(20) DEFAULT '' NOT NULL,
- field_minlen varbinary(255) DEFAULT '' NOT NULL,
- field_maxlen varbinary(255) DEFAULT '' NOT NULL,
- field_novalue blob NOT NULL,
- field_default_value blob NOT NULL,
- field_validation varbinary(60) DEFAULT '' NOT NULL,
- field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_on_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_hide tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_no_view tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (field_id),
- KEY fld_type (field_type),
- KEY fld_ordr (field_order)
-);
-
-
-# Table: 'phpbb_profile_fields_data'
-CREATE TABLE phpbb_profile_fields_data (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id)
-);
-
-
-# Table: 'phpbb_profile_fields_lang'
-CREATE TABLE phpbb_profile_fields_lang (
- field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- field_type tinyint(4) DEFAULT '0' NOT NULL,
- lang_value blob NOT NULL,
- PRIMARY KEY (field_id, lang_id, option_id)
-);
-
-
-# Table: 'phpbb_profile_lang'
-CREATE TABLE phpbb_profile_lang (
- field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- lang_name blob NOT NULL,
- lang_explain blob NOT NULL,
- lang_default_value blob NOT NULL,
- PRIMARY KEY (field_id, lang_id)
-);
-
-
-# Table: 'phpbb_ranks'
-CREATE TABLE phpbb_ranks (
- rank_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- rank_title blob NOT NULL,
- rank_min mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rank_special tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- rank_image varbinary(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (rank_id)
-);
-
-
-# Table: 'phpbb_reports'
-CREATE TABLE phpbb_reports (
- report_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- reason_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- pm_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- report_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- report_text mediumblob NOT NULL,
- reported_post_text mediumblob NOT NULL,
- PRIMARY KEY (report_id),
- KEY post_id (post_id),
- KEY pm_id (pm_id)
-);
-
-
-# Table: 'phpbb_reports_reasons'
-CREATE TABLE phpbb_reports_reasons (
- reason_id smallint(4) UNSIGNED NOT NULL auto_increment,
- reason_title blob NOT NULL,
- reason_description mediumblob NOT NULL,
- reason_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (reason_id)
-);
-
-
-# Table: 'phpbb_search_results'
-CREATE TABLE phpbb_search_results (
- search_key varbinary(32) DEFAULT '' NOT NULL,
- search_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- search_keywords mediumblob NOT NULL,
- search_authors mediumblob NOT NULL,
- PRIMARY KEY (search_key)
-);
-
-
-# Table: 'phpbb_search_wordlist'
-CREATE TABLE phpbb_search_wordlist (
- word_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- word_text blob NOT NULL,
- word_common tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- word_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (word_id),
- UNIQUE wrd_txt (word_text(255)),
- KEY wrd_cnt (word_count)
-);
-
-
-# Table: 'phpbb_search_wordmatch'
-CREATE TABLE phpbb_search_wordmatch (
- post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- word_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- title_match tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- UNIQUE unq_mtch (word_id, post_id, title_match),
- KEY word_id (word_id),
- KEY post_id (post_id)
-);
-
-
-# Table: 'phpbb_sessions'
-CREATE TABLE phpbb_sessions (
- session_id binary(32) DEFAULT '' NOT NULL,
- session_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- session_forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- session_last_visit int(11) UNSIGNED DEFAULT '0' NOT NULL,
- session_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
- session_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- session_ip varbinary(40) DEFAULT '' NOT NULL,
- session_browser varbinary(150) DEFAULT '' NOT NULL,
- session_forwarded_for varbinary(255) DEFAULT '' NOT NULL,
- session_page blob NOT NULL,
- session_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- session_autologin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- session_admin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (session_id),
- KEY session_time (session_time),
- KEY session_user_id (session_user_id),
- KEY session_fid (session_forum_id)
-);
-
-
-# Table: 'phpbb_sessions_keys'
-CREATE TABLE phpbb_sessions_keys (
- key_id binary(32) DEFAULT '' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- last_ip varbinary(40) DEFAULT '' NOT NULL,
- last_login int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (key_id, user_id),
- KEY last_login (last_login)
-);
-
-
-# Table: 'phpbb_sitelist'
-CREATE TABLE phpbb_sitelist (
- site_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- site_ip varbinary(40) DEFAULT '' NOT NULL,
- site_hostname varbinary(255) DEFAULT '' NOT NULL,
- ip_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (site_id)
-);
-
-
-# Table: 'phpbb_smilies'
-CREATE TABLE phpbb_smilies (
- smiley_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- code varbinary(150) DEFAULT '' NOT NULL,
- emotion varbinary(150) DEFAULT '' NOT NULL,
- smiley_url varbinary(50) DEFAULT '' NOT NULL,
- smiley_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- smiley_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- smiley_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- PRIMARY KEY (smiley_id),
- KEY display_on_post (display_on_posting)
-);
-
-
-# Table: 'phpbb_styles'
-CREATE TABLE phpbb_styles (
- style_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- style_name blob NOT NULL,
- style_copyright blob NOT NULL,
- style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- style_path varbinary(100) DEFAULT '' NOT NULL,
- bbcode_bitfield varbinary(255) DEFAULT 'kNg=' NOT NULL,
- style_parent_id int(4) UNSIGNED DEFAULT '0' NOT NULL,
- style_parent_tree blob NOT NULL,
- PRIMARY KEY (style_id),
- UNIQUE style_name (style_name(255))
-);
-
-
-# Table: 'phpbb_topics'
-CREATE TABLE phpbb_topics (
- topic_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- topic_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- topic_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- topic_title blob NOT NULL,
- topic_poster mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_time_limit int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_views mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_replies mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_replies_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_status tinyint(3) DEFAULT '0' NOT NULL,
- topic_type tinyint(3) DEFAULT '0' NOT NULL,
- topic_first_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_first_poster_name blob NOT NULL,
- topic_first_poster_colour varbinary(6) DEFAULT '' NOT NULL,
- topic_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_last_poster_name blob NOT NULL,
- topic_last_poster_colour varbinary(6) DEFAULT '' NOT NULL,
- topic_last_post_subject blob NOT NULL,
- topic_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_last_view_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_moved_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_bumped tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- topic_bumper mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poll_title blob NOT NULL,
- poll_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
- poll_length int(11) UNSIGNED DEFAULT '0' NOT NULL,
- poll_max_options tinyint(4) DEFAULT '1' NOT NULL,
- poll_last_vote int(11) UNSIGNED DEFAULT '0' NOT NULL,
- poll_vote_change tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (topic_id),
- KEY forum_id (forum_id),
- KEY forum_id_type (forum_id, topic_type),
- KEY last_post_time (topic_last_post_time),
- KEY topic_approved (topic_approved),
- KEY forum_appr_last (forum_id, topic_approved, topic_last_post_id),
- KEY fid_time_moved (forum_id, topic_last_post_time, topic_moved_id)
-);
-
-
-# Table: 'phpbb_topics_track'
-CREATE TABLE phpbb_topics_track (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, topic_id),
- KEY topic_id (topic_id),
- KEY forum_id (forum_id)
-);
-
-
-# Table: 'phpbb_topics_posted'
-CREATE TABLE phpbb_topics_posted (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_posted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, topic_id)
-);
-
-
-# Table: 'phpbb_topics_watch'
-CREATE TABLE phpbb_topics_watch (
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- KEY topic_id (topic_id),
- KEY user_id (user_id),
- KEY notify_stat (notify_status)
-);
-
-
-# Table: 'phpbb_user_group'
-CREATE TABLE phpbb_user_group (
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_leader tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_pending tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- KEY group_id (group_id),
- KEY user_id (user_id),
- KEY group_leader (group_leader)
-);
-
-
-# Table: 'phpbb_users'
-CREATE TABLE phpbb_users (
- user_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_type tinyint(2) DEFAULT '0' NOT NULL,
- group_id mediumint(8) UNSIGNED DEFAULT '3' NOT NULL,
- user_permissions mediumblob NOT NULL,
- user_perm_from mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_ip varbinary(40) DEFAULT '' NOT NULL,
- user_regdate int(11) UNSIGNED DEFAULT '0' NOT NULL,
- username blob NOT NULL,
- username_clean blob NOT NULL,
- user_password varbinary(120) DEFAULT '' NOT NULL,
- user_passchg int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_pass_convert tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_email blob NOT NULL,
- user_email_hash bigint(20) DEFAULT '0' NOT NULL,
- user_birthday varbinary(10) DEFAULT '' NOT NULL,
- user_lastvisit int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_lastmark int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_lastpost_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_lastpage blob NOT NULL,
- user_last_confirm_key varbinary(10) DEFAULT '' NOT NULL,
- user_last_search int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_warnings tinyint(4) DEFAULT '0' NOT NULL,
- user_last_warning int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_login_attempts tinyint(4) DEFAULT '0' NOT NULL,
- user_inactive_reason tinyint(2) DEFAULT '0' NOT NULL,
- user_inactive_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_lang varbinary(30) DEFAULT '' NOT NULL,
- user_timezone varbinary(100) DEFAULT 'UTC' NOT NULL,
- user_dateformat varbinary(90) DEFAULT 'd M Y H:i' NOT NULL,
- user_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_colour varbinary(6) DEFAULT '' NOT NULL,
- user_new_privmsg int(4) DEFAULT '0' NOT NULL,
- user_unread_privmsg int(4) DEFAULT '0' NOT NULL,
- user_last_privmsg int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_message_rules tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_full_folder int(11) DEFAULT '-3' NOT NULL,
- user_emailtime int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_topic_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_topic_sortby_type varbinary(1) DEFAULT 't' NOT NULL,
- user_topic_sortby_dir varbinary(1) DEFAULT 'd' NOT NULL,
- user_post_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_post_sortby_type varbinary(1) DEFAULT 't' NOT NULL,
- user_post_sortby_dir varbinary(1) DEFAULT 'a' NOT NULL,
- user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_notify_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_notify_type tinyint(4) DEFAULT '0' NOT NULL,
- user_allow_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_allow_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_allow_viewemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_allow_massemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_options int(11) UNSIGNED DEFAULT '230271' NOT NULL,
- user_avatar varbinary(255) DEFAULT '' NOT NULL,
- user_avatar_type tinyint(2) DEFAULT '0' NOT NULL,
- user_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_sig mediumblob NOT NULL,
- user_sig_bbcode_uid varbinary(8) DEFAULT '' NOT NULL,
- user_sig_bbcode_bitfield varbinary(255) DEFAULT '' NOT NULL,
- user_from blob NOT NULL,
- user_icq varbinary(15) DEFAULT '' NOT NULL,
- user_aim blob NOT NULL,
- user_yim blob NOT NULL,
- user_msnm blob NOT NULL,
- user_jabber blob NOT NULL,
- user_website blob NOT NULL,
- user_occ blob NOT NULL,
- user_interests blob NOT NULL,
- user_actkey varbinary(32) DEFAULT '' NOT NULL,
- user_newpasswd varbinary(120) DEFAULT '' NOT NULL,
- user_form_salt varbinary(96) DEFAULT '' NOT NULL,
- user_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_reminded tinyint(4) DEFAULT '0' NOT NULL,
- user_reminded_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id),
- KEY user_birthday (user_birthday),
- KEY user_email_hash (user_email_hash),
- KEY user_type (user_type),
- UNIQUE username_clean (username_clean(255))
-);
-
-
-# Table: 'phpbb_warnings'
-CREATE TABLE phpbb_warnings (
- warning_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- log_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- warning_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (warning_id)
-);
-
-
-# Table: 'phpbb_words'
-CREATE TABLE phpbb_words (
- word_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- word blob NOT NULL,
- replacement blob NOT NULL,
- PRIMARY KEY (word_id)
-);
-
-
-# Table: 'phpbb_zebra'
-CREATE TABLE phpbb_zebra (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- zebra_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- friend tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- foe tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, zebra_id)
-);
-
-
+# DO NOT EDIT THIS FILE, IT IS GENERATED
+#
+# To change the contents of this file, edit
+# phpBB/develop/create_schema_files.php and
+# run it.
+# Table: 'phpbb_attachments'
+CREATE TABLE phpbb_attachments (
+ attach_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ post_msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ in_message tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ is_orphan tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ physical_filename varbinary(255) DEFAULT '' NOT NULL,
+ real_filename varbinary(255) DEFAULT '' NOT NULL,
+ download_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ attach_comment blob NOT NULL,
+ extension varbinary(100) DEFAULT '' NOT NULL,
+ mimetype varbinary(100) DEFAULT '' NOT NULL,
+ filesize int(20) UNSIGNED DEFAULT '0' NOT NULL,
+ filetime int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ thumbnail tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (attach_id),
+ KEY filetime (filetime),
+ KEY post_msg_id (post_msg_id),
+ KEY topic_id (topic_id),
+ KEY poster_id (poster_id),
+ KEY is_orphan (is_orphan)
+);
+
+
+# Table: 'phpbb_acl_groups'
+CREATE TABLE phpbb_acl_groups (
+ group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_setting tinyint(2) DEFAULT '0' NOT NULL,
+ KEY group_id (group_id),
+ KEY auth_opt_id (auth_option_id),
+ KEY auth_role_id (auth_role_id)
+);
+
+
+# Table: 'phpbb_acl_options'
+CREATE TABLE phpbb_acl_options (
+ auth_option_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ auth_option varbinary(50) DEFAULT '' NOT NULL,
+ is_global tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ is_local tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ founder_only tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (auth_option_id),
+ UNIQUE auth_option (auth_option)
+);
+
+
+# Table: 'phpbb_acl_roles'
+CREATE TABLE phpbb_acl_roles (
+ role_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ role_name blob NOT NULL,
+ role_description blob NOT NULL,
+ role_type varbinary(10) DEFAULT '' NOT NULL,
+ role_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (role_id),
+ KEY role_type (role_type),
+ KEY role_order (role_order)
+);
+
+
+# Table: 'phpbb_acl_roles_data'
+CREATE TABLE phpbb_acl_roles_data (
+ role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_setting tinyint(2) DEFAULT '0' NOT NULL,
+ PRIMARY KEY (role_id, auth_option_id),
+ KEY ath_op_id (auth_option_id)
+);
+
+
+# Table: 'phpbb_acl_users'
+CREATE TABLE phpbb_acl_users (
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_setting tinyint(2) DEFAULT '0' NOT NULL,
+ KEY user_id (user_id),
+ KEY auth_option_id (auth_option_id),
+ KEY auth_role_id (auth_role_id)
+);
+
+
+# Table: 'phpbb_banlist'
+CREATE TABLE phpbb_banlist (
+ ban_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ ban_userid mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ ban_ip varbinary(40) DEFAULT '' NOT NULL,
+ ban_email blob NOT NULL,
+ ban_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ ban_end int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ ban_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ ban_reason blob NOT NULL,
+ ban_give_reason blob NOT NULL,
+ PRIMARY KEY (ban_id),
+ KEY ban_end (ban_end),
+ KEY ban_user (ban_userid, ban_exclude),
+ KEY ban_email (ban_email(255), ban_exclude),
+ KEY ban_ip (ban_ip, ban_exclude)
+);
+
+
+# Table: 'phpbb_bbcodes'
+CREATE TABLE phpbb_bbcodes (
+ bbcode_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ bbcode_tag varbinary(16) DEFAULT '' NOT NULL,
+ bbcode_helpline blob NOT NULL,
+ display_on_posting tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ bbcode_match blob NOT NULL,
+ bbcode_tpl mediumblob NOT NULL,
+ first_pass_match mediumblob NOT NULL,
+ first_pass_replace mediumblob NOT NULL,
+ second_pass_match mediumblob NOT NULL,
+ second_pass_replace mediumblob NOT NULL,
+ PRIMARY KEY (bbcode_id),
+ KEY display_on_post (display_on_posting)
+);
+
+
+# Table: 'phpbb_bookmarks'
+CREATE TABLE phpbb_bookmarks (
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (topic_id, user_id)
+);
+
+
+# Table: 'phpbb_bots'
+CREATE TABLE phpbb_bots (
+ bot_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ bot_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ bot_name blob NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ bot_agent varbinary(255) DEFAULT '' NOT NULL,
+ bot_ip varbinary(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (bot_id),
+ KEY bot_active (bot_active)
+);
+
+
+# Table: 'phpbb_config'
+CREATE TABLE phpbb_config (
+ config_name varbinary(255) DEFAULT '' NOT NULL,
+ config_value blob NOT NULL,
+ is_dynamic tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (config_name),
+ KEY is_dynamic (is_dynamic)
+);
+
+
+# Table: 'phpbb_confirm'
+CREATE TABLE phpbb_confirm (
+ confirm_id binary(32) DEFAULT '' NOT NULL,
+ session_id binary(32) DEFAULT '' NOT NULL,
+ confirm_type tinyint(3) DEFAULT '0' NOT NULL,
+ code varbinary(8) DEFAULT '' NOT NULL,
+ seed int(10) UNSIGNED DEFAULT '0' NOT NULL,
+ attempts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (session_id, confirm_id),
+ KEY confirm_type (confirm_type)
+);
+
+
+# Table: 'phpbb_disallow'
+CREATE TABLE phpbb_disallow (
+ disallow_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ disallow_username blob NOT NULL,
+ PRIMARY KEY (disallow_id)
+);
+
+
+# Table: 'phpbb_drafts'
+CREATE TABLE phpbb_drafts (
+ draft_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ save_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ draft_subject blob NOT NULL,
+ draft_message mediumblob NOT NULL,
+ PRIMARY KEY (draft_id),
+ KEY save_time (save_time)
+);
+
+
+# Table: 'phpbb_ext'
+CREATE TABLE phpbb_ext (
+ ext_name varbinary(255) DEFAULT '' NOT NULL,
+ ext_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ ext_state blob NOT NULL,
+ UNIQUE ext_name (ext_name)
+);
+
+
+# Table: 'phpbb_extensions'
+CREATE TABLE phpbb_extensions (
+ extension_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ extension varbinary(100) DEFAULT '' NOT NULL,
+ PRIMARY KEY (extension_id)
+);
+
+
+# Table: 'phpbb_extension_groups'
+CREATE TABLE phpbb_extension_groups (
+ group_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ group_name blob NOT NULL,
+ cat_id tinyint(2) DEFAULT '0' NOT NULL,
+ allow_group tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ download_mode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ upload_icon varbinary(255) DEFAULT '' NOT NULL,
+ max_filesize int(20) UNSIGNED DEFAULT '0' NOT NULL,
+ allowed_forums blob NOT NULL,
+ allow_in_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (group_id)
+);
+
+
+# Table: 'phpbb_forums'
+CREATE TABLE phpbb_forums (
+ forum_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_parents mediumblob NOT NULL,
+ forum_name blob NOT NULL,
+ forum_desc blob NOT NULL,
+ forum_desc_bitfield varbinary(255) DEFAULT '' NOT NULL,
+ forum_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
+ forum_desc_uid varbinary(8) DEFAULT '' NOT NULL,
+ forum_link blob NOT NULL,
+ forum_password varbinary(120) DEFAULT '' NOT NULL,
+ forum_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_image varbinary(255) DEFAULT '' NOT NULL,
+ forum_rules blob NOT NULL,
+ forum_rules_link blob NOT NULL,
+ forum_rules_bitfield varbinary(255) DEFAULT '' NOT NULL,
+ forum_rules_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
+ forum_rules_uid varbinary(8) DEFAULT '' NOT NULL,
+ forum_topics_per_page tinyint(4) DEFAULT '0' NOT NULL,
+ forum_type tinyint(4) DEFAULT '0' NOT NULL,
+ forum_status tinyint(4) DEFAULT '0' NOT NULL,
+ forum_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_topics mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_topics_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_last_post_subject blob NOT NULL,
+ forum_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_last_poster_name blob NOT NULL,
+ forum_last_poster_colour varbinary(6) DEFAULT '' NOT NULL,
+ forum_flags tinyint(4) DEFAULT '32' NOT NULL,
+ forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL,
+ display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ prune_next int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ prune_days mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ prune_viewed mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ prune_freq mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (forum_id),
+ KEY left_right_id (left_id, right_id),
+ KEY forum_lastpost_id (forum_last_post_id)
+);
+
+
+# Table: 'phpbb_forums_access'
+CREATE TABLE phpbb_forums_access (
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ session_id binary(32) DEFAULT '' NOT NULL,
+ PRIMARY KEY (forum_id, user_id, session_id)
+);
+
+
+# Table: 'phpbb_forums_track'
+CREATE TABLE phpbb_forums_track (
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (user_id, forum_id)
+);
+
+
+# Table: 'phpbb_forums_watch'
+CREATE TABLE phpbb_forums_watch (
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ KEY forum_id (forum_id),
+ KEY user_id (user_id),
+ KEY notify_stat (notify_status)
+);
+
+
+# Table: 'phpbb_groups'
+CREATE TABLE phpbb_groups (
+ group_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ group_type tinyint(4) DEFAULT '1' NOT NULL,
+ group_founder_manage tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ group_skip_auth tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ group_name blob NOT NULL,
+ group_desc blob NOT NULL,
+ group_desc_bitfield varbinary(255) DEFAULT '' NOT NULL,
+ group_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
+ group_desc_uid varbinary(8) DEFAULT '' NOT NULL,
+ group_display tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ group_avatar varbinary(255) DEFAULT '' NOT NULL,
+ group_avatar_type tinyint(2) DEFAULT '0' NOT NULL,
+ group_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ group_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ group_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_colour varbinary(6) DEFAULT '' NOT NULL,
+ group_sig_chars mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_legend mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_teampage mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (group_id),
+ KEY group_legend_name (group_legend, group_name(255))
+);
+
+
+# Table: 'phpbb_icons'
+CREATE TABLE phpbb_icons (
+ icons_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ icons_url varbinary(255) DEFAULT '' NOT NULL,
+ icons_width tinyint(4) DEFAULT '0' NOT NULL,
+ icons_height tinyint(4) DEFAULT '0' NOT NULL,
+ icons_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ PRIMARY KEY (icons_id),
+ KEY display_on_posting (display_on_posting)
+);
+
+
+# Table: 'phpbb_lang'
+CREATE TABLE phpbb_lang (
+ lang_id tinyint(4) NOT NULL auto_increment,
+ lang_iso varbinary(30) DEFAULT '' NOT NULL,
+ lang_dir varbinary(30) DEFAULT '' NOT NULL,
+ lang_english_name blob NOT NULL,
+ lang_local_name blob NOT NULL,
+ lang_author blob NOT NULL,
+ PRIMARY KEY (lang_id),
+ KEY lang_iso (lang_iso)
+);
+
+
+# Table: 'phpbb_log'
+CREATE TABLE phpbb_log (
+ log_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ log_type tinyint(4) DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ reportee_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ log_ip varbinary(40) DEFAULT '' NOT NULL,
+ log_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ log_operation blob NOT NULL,
+ log_data mediumblob NOT NULL,
+ PRIMARY KEY (log_id),
+ KEY log_type (log_type),
+ KEY log_time (log_time),
+ KEY forum_id (forum_id),
+ KEY topic_id (topic_id),
+ KEY reportee_id (reportee_id),
+ KEY user_id (user_id)
+);
+
+
+# Table: 'phpbb_login_attempts'
+CREATE TABLE phpbb_login_attempts (
+ attempt_ip varbinary(40) DEFAULT '' NOT NULL,
+ attempt_browser varbinary(150) DEFAULT '' NOT NULL,
+ attempt_forwarded_for varbinary(255) DEFAULT '' NOT NULL,
+ attempt_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ username blob NOT NULL,
+ username_clean blob NOT NULL,
+ KEY att_ip (attempt_ip, attempt_time),
+ KEY att_for (attempt_forwarded_for, attempt_time),
+ KEY att_time (attempt_time),
+ KEY user_id (user_id)
+);
+
+
+# Table: 'phpbb_moderator_cache'
+CREATE TABLE phpbb_moderator_cache (
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ username blob NOT NULL,
+ group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_name blob NOT NULL,
+ display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ KEY disp_idx (display_on_index),
+ KEY forum_id (forum_id)
+);
+
+
+# Table: 'phpbb_modules'
+CREATE TABLE phpbb_modules (
+ module_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ module_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ module_display tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ module_basename varbinary(255) DEFAULT '' NOT NULL,
+ module_class varbinary(10) DEFAULT '' NOT NULL,
+ parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ module_langname varbinary(255) DEFAULT '' NOT NULL,
+ module_mode varbinary(255) DEFAULT '' NOT NULL,
+ module_auth varbinary(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (module_id),
+ KEY left_right_id (left_id, right_id),
+ KEY module_enabled (module_enabled),
+ KEY class_left_id (module_class, left_id)
+);
+
+
+# Table: 'phpbb_poll_options'
+CREATE TABLE phpbb_poll_options (
+ poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ poll_option_text blob NOT NULL,
+ poll_option_total mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ KEY poll_opt_id (poll_option_id),
+ KEY topic_id (topic_id)
+);
+
+
+# Table: 'phpbb_poll_votes'
+CREATE TABLE phpbb_poll_votes (
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
+ vote_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ vote_user_ip varbinary(40) DEFAULT '' NOT NULL,
+ KEY topic_id (topic_id),
+ KEY vote_user_id (vote_user_id),
+ KEY vote_user_ip (vote_user_ip)
+);
+
+
+# Table: 'phpbb_posts'
+CREATE TABLE phpbb_posts (
+ post_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ poster_ip varbinary(40) DEFAULT '' NOT NULL,
+ post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ post_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ post_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ post_username blob NOT NULL,
+ post_subject blob NOT NULL,
+ post_text mediumblob NOT NULL,
+ post_checksum varbinary(32) DEFAULT '' NOT NULL,
+ post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ bbcode_bitfield varbinary(255) DEFAULT '' NOT NULL,
+ bbcode_uid varbinary(8) DEFAULT '' NOT NULL,
+ post_postcount tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ post_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ post_edit_reason blob NOT NULL,
+ post_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ post_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ post_edit_locked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (post_id),
+ KEY forum_id (forum_id),
+ KEY topic_id (topic_id),
+ KEY poster_ip (poster_ip),
+ KEY poster_id (poster_id),
+ KEY post_approved (post_approved),
+ KEY post_username (post_username(255)),
+ KEY tid_post_time (topic_id, post_time)
+);
+
+
+# Table: 'phpbb_privmsgs'
+CREATE TABLE phpbb_privmsgs (
+ msg_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ root_level mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ author_ip varbinary(40) DEFAULT '' NOT NULL,
+ message_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ message_subject blob NOT NULL,
+ message_text mediumblob NOT NULL,
+ message_edit_reason blob NOT NULL,
+ message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ message_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ bbcode_bitfield varbinary(255) DEFAULT '' NOT NULL,
+ bbcode_uid varbinary(8) DEFAULT '' NOT NULL,
+ message_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ message_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ to_address blob NOT NULL,
+ bcc_address blob NOT NULL,
+ message_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (msg_id),
+ KEY author_ip (author_ip),
+ KEY message_time (message_time),
+ KEY author_id (author_id),
+ KEY root_level (root_level)
+);
+
+
+# Table: 'phpbb_privmsgs_folder'
+CREATE TABLE phpbb_privmsgs_folder (
+ folder_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ folder_name blob NOT NULL,
+ pm_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (folder_id),
+ KEY user_id (user_id)
+);
+
+
+# Table: 'phpbb_privmsgs_rules'
+CREATE TABLE phpbb_privmsgs_rules (
+ rule_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ rule_check mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ rule_connection mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ rule_string blob NOT NULL,
+ rule_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ rule_group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ rule_action mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ rule_folder_id int(11) DEFAULT '0' NOT NULL,
+ PRIMARY KEY (rule_id),
+ KEY user_id (user_id)
+);
+
+
+# Table: 'phpbb_privmsgs_to'
+CREATE TABLE phpbb_privmsgs_to (
+ msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ pm_deleted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ pm_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ pm_unread tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ pm_replied tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ pm_marked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ pm_forwarded tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ folder_id int(11) DEFAULT '0' NOT NULL,
+ KEY msg_id (msg_id),
+ KEY author_id (author_id),
+ KEY usr_flder_id (user_id, folder_id)
+);
+
+
+# Table: 'phpbb_profile_fields'
+CREATE TABLE phpbb_profile_fields (
+ field_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ field_name blob NOT NULL,
+ field_type tinyint(4) DEFAULT '0' NOT NULL,
+ field_ident varbinary(20) DEFAULT '' NOT NULL,
+ field_length varbinary(20) DEFAULT '' NOT NULL,
+ field_minlen varbinary(255) DEFAULT '' NOT NULL,
+ field_maxlen varbinary(255) DEFAULT '' NOT NULL,
+ field_novalue blob NOT NULL,
+ field_default_value blob NOT NULL,
+ field_validation varbinary(60) DEFAULT '' NOT NULL,
+ field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_on_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_hide tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_no_view tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (field_id),
+ KEY fld_type (field_type),
+ KEY fld_ordr (field_order)
+);
+
+
+# Table: 'phpbb_profile_fields_data'
+CREATE TABLE phpbb_profile_fields_data (
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (user_id)
+);
+
+
+# Table: 'phpbb_profile_fields_lang'
+CREATE TABLE phpbb_profile_fields_lang (
+ field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ field_type tinyint(4) DEFAULT '0' NOT NULL,
+ lang_value blob NOT NULL,
+ PRIMARY KEY (field_id, lang_id, option_id)
+);
+
+
+# Table: 'phpbb_profile_lang'
+CREATE TABLE phpbb_profile_lang (
+ field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ lang_name blob NOT NULL,
+ lang_explain blob NOT NULL,
+ lang_default_value blob NOT NULL,
+ PRIMARY KEY (field_id, lang_id)
+);
+
+
+# Table: 'phpbb_ranks'
+CREATE TABLE phpbb_ranks (
+ rank_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ rank_title blob NOT NULL,
+ rank_min mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ rank_special tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ rank_image varbinary(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (rank_id)
+);
+
+
+# Table: 'phpbb_reports'
+CREATE TABLE phpbb_reports (
+ report_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ reason_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ pm_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ report_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ report_text mediumblob NOT NULL,
+ reported_post_text mediumblob NOT NULL,
+ PRIMARY KEY (report_id),
+ KEY post_id (post_id),
+ KEY pm_id (pm_id)
+);
+
+
+# Table: 'phpbb_reports_reasons'
+CREATE TABLE phpbb_reports_reasons (
+ reason_id smallint(4) UNSIGNED NOT NULL auto_increment,
+ reason_title blob NOT NULL,
+ reason_description mediumblob NOT NULL,
+ reason_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (reason_id)
+);
+
+
+# Table: 'phpbb_search_results'
+CREATE TABLE phpbb_search_results (
+ search_key varbinary(32) DEFAULT '' NOT NULL,
+ search_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ search_keywords mediumblob NOT NULL,
+ search_authors mediumblob NOT NULL,
+ PRIMARY KEY (search_key)
+);
+
+
+# Table: 'phpbb_search_wordlist'
+CREATE TABLE phpbb_search_wordlist (
+ word_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ word_text blob NOT NULL,
+ word_common tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ word_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (word_id),
+ UNIQUE wrd_txt (word_text(255)),
+ KEY wrd_cnt (word_count)
+);
+
+
+# Table: 'phpbb_search_wordmatch'
+CREATE TABLE phpbb_search_wordmatch (
+ post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ word_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ title_match tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ UNIQUE unq_mtch (word_id, post_id, title_match),
+ KEY word_id (word_id),
+ KEY post_id (post_id)
+);
+
+
+# Table: 'phpbb_sessions'
+CREATE TABLE phpbb_sessions (
+ session_id binary(32) DEFAULT '' NOT NULL,
+ session_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ session_forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ session_last_visit int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ session_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ session_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ session_ip varbinary(40) DEFAULT '' NOT NULL,
+ session_browser varbinary(150) DEFAULT '' NOT NULL,
+ session_forwarded_for varbinary(255) DEFAULT '' NOT NULL,
+ session_page blob NOT NULL,
+ session_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ session_autologin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ session_admin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (session_id),
+ KEY session_time (session_time),
+ KEY session_user_id (session_user_id),
+ KEY session_fid (session_forum_id)
+);
+
+
+# Table: 'phpbb_sessions_keys'
+CREATE TABLE phpbb_sessions_keys (
+ key_id binary(32) DEFAULT '' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ last_ip varbinary(40) DEFAULT '' NOT NULL,
+ last_login int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (key_id, user_id),
+ KEY last_login (last_login)
+);
+
+
+# Table: 'phpbb_sitelist'
+CREATE TABLE phpbb_sitelist (
+ site_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ site_ip varbinary(40) DEFAULT '' NOT NULL,
+ site_hostname varbinary(255) DEFAULT '' NOT NULL,
+ ip_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (site_id)
+);
+
+
+# Table: 'phpbb_smilies'
+CREATE TABLE phpbb_smilies (
+ smiley_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ code varbinary(150) DEFAULT '' NOT NULL,
+ emotion varbinary(150) DEFAULT '' NOT NULL,
+ smiley_url varbinary(50) DEFAULT '' NOT NULL,
+ smiley_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ smiley_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ smiley_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ PRIMARY KEY (smiley_id),
+ KEY display_on_post (display_on_posting)
+);
+
+
+# Table: 'phpbb_styles'
+CREATE TABLE phpbb_styles (
+ style_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ style_name blob NOT NULL,
+ style_copyright blob NOT NULL,
+ style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ style_path varbinary(100) DEFAULT '' NOT NULL,
+ bbcode_bitfield varbinary(255) DEFAULT 'kNg=' NOT NULL,
+ style_parent_id int(4) UNSIGNED DEFAULT '0' NOT NULL,
+ style_parent_tree blob NOT NULL,
+ PRIMARY KEY (style_id),
+ UNIQUE style_name (style_name(255))
+);
+
+
+# Table: 'phpbb_topics'
+CREATE TABLE phpbb_topics (
+ topic_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ topic_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_title blob NOT NULL,
+ topic_poster mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_time_limit int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_views mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_replies mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_replies_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_status tinyint(3) DEFAULT '0' NOT NULL,
+ topic_type tinyint(3) DEFAULT '0' NOT NULL,
+ topic_first_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_first_poster_name blob NOT NULL,
+ topic_first_poster_colour varbinary(6) DEFAULT '' NOT NULL,
+ topic_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_last_poster_name blob NOT NULL,
+ topic_last_poster_colour varbinary(6) DEFAULT '' NOT NULL,
+ topic_last_post_subject blob NOT NULL,
+ topic_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_last_view_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_moved_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_bumped tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_bumper mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ poll_title blob NOT NULL,
+ poll_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ poll_length int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ poll_max_options tinyint(4) DEFAULT '1' NOT NULL,
+ poll_last_vote int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ poll_vote_change tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (topic_id),
+ KEY forum_id (forum_id),
+ KEY forum_id_type (forum_id, topic_type),
+ KEY last_post_time (topic_last_post_time),
+ KEY topic_approved (topic_approved),
+ KEY forum_appr_last (forum_id, topic_approved, topic_last_post_id),
+ KEY fid_time_moved (forum_id, topic_last_post_time, topic_moved_id)
+);
+
+
+# Table: 'phpbb_topics_track'
+CREATE TABLE phpbb_topics_track (
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (user_id, topic_id),
+ KEY topic_id (topic_id),
+ KEY forum_id (forum_id)
+);
+
+
+# Table: 'phpbb_topics_posted'
+CREATE TABLE phpbb_topics_posted (
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_posted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (user_id, topic_id)
+);
+
+
+# Table: 'phpbb_topics_watch'
+CREATE TABLE phpbb_topics_watch (
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ KEY topic_id (topic_id),
+ KEY user_id (user_id),
+ KEY notify_stat (notify_status)
+);
+
+
+# Table: 'phpbb_user_group'
+CREATE TABLE phpbb_user_group (
+ group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_leader tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ user_pending tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ KEY group_id (group_id),
+ KEY user_id (user_id),
+ KEY group_leader (group_leader)
+);
+
+
+# Table: 'phpbb_users'
+CREATE TABLE phpbb_users (
+ user_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ user_type tinyint(2) DEFAULT '0' NOT NULL,
+ group_id mediumint(8) UNSIGNED DEFAULT '3' NOT NULL,
+ user_permissions mediumblob NOT NULL,
+ user_perm_from mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_ip varbinary(40) DEFAULT '' NOT NULL,
+ user_regdate int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ username blob NOT NULL,
+ username_clean blob NOT NULL,
+ user_password varbinary(120) DEFAULT '' NOT NULL,
+ user_passchg int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_pass_convert tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ user_email blob NOT NULL,
+ user_email_hash bigint(20) DEFAULT '0' NOT NULL,
+ user_birthday varbinary(10) DEFAULT '' NOT NULL,
+ user_lastvisit int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_lastmark int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_lastpost_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_lastpage blob NOT NULL,
+ user_last_confirm_key varbinary(10) DEFAULT '' NOT NULL,
+ user_last_search int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_warnings tinyint(4) DEFAULT '0' NOT NULL,
+ user_last_warning int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_login_attempts tinyint(4) DEFAULT '0' NOT NULL,
+ user_inactive_reason tinyint(2) DEFAULT '0' NOT NULL,
+ user_inactive_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_lang varbinary(30) DEFAULT '' NOT NULL,
+ user_timezone varbinary(100) DEFAULT 'UTC' NOT NULL,
+ user_dateformat varbinary(90) DEFAULT 'd M Y H:i' NOT NULL,
+ user_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_colour varbinary(6) DEFAULT '' NOT NULL,
+ user_new_privmsg int(4) DEFAULT '0' NOT NULL,
+ user_unread_privmsg int(4) DEFAULT '0' NOT NULL,
+ user_last_privmsg int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_message_rules tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ user_full_folder int(11) DEFAULT '-3' NOT NULL,
+ user_emailtime int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_topic_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ user_topic_sortby_type varbinary(1) DEFAULT 't' NOT NULL,
+ user_topic_sortby_dir varbinary(1) DEFAULT 'd' NOT NULL,
+ user_post_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ user_post_sortby_type varbinary(1) DEFAULT 't' NOT NULL,
+ user_post_sortby_dir varbinary(1) DEFAULT 'a' NOT NULL,
+ user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ user_notify_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ user_notify_type tinyint(4) DEFAULT '0' NOT NULL,
+ user_allow_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ user_allow_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ user_allow_viewemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ user_allow_massemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ user_options int(11) UNSIGNED DEFAULT '230271' NOT NULL,
+ user_avatar varbinary(255) DEFAULT '' NOT NULL,
+ user_avatar_type tinyint(2) DEFAULT '0' NOT NULL,
+ user_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ user_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ user_sig mediumblob NOT NULL,
+ user_sig_bbcode_uid varbinary(8) DEFAULT '' NOT NULL,
+ user_sig_bbcode_bitfield varbinary(255) DEFAULT '' NOT NULL,
+ user_from blob NOT NULL,
+ user_icq varbinary(15) DEFAULT '' NOT NULL,
+ user_aim blob NOT NULL,
+ user_yim blob NOT NULL,
+ user_msnm blob NOT NULL,
+ user_jabber blob NOT NULL,
+ user_website blob NOT NULL,
+ user_occ blob NOT NULL,
+ user_interests blob NOT NULL,
+ user_actkey varbinary(32) DEFAULT '' NOT NULL,
+ user_newpasswd varbinary(120) DEFAULT '' NOT NULL,
+ user_form_salt varbinary(96) DEFAULT '' NOT NULL,
+ user_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ user_reminded tinyint(4) DEFAULT '0' NOT NULL,
+ user_reminded_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (user_id),
+ KEY user_birthday (user_birthday),
+ KEY user_email_hash (user_email_hash),
+ KEY user_type (user_type),
+ UNIQUE username_clean (username_clean(255))
+);
+
+
+# Table: 'phpbb_warnings'
+CREATE TABLE phpbb_warnings (
+ warning_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ log_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ warning_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (warning_id)
+);
+
+
+# Table: 'phpbb_words'
+CREATE TABLE phpbb_words (
+ word_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ word blob NOT NULL,
+ replacement blob NOT NULL,
+ PRIMARY KEY (word_id)
+);
+
+
+# Table: 'phpbb_zebra'
+CREATE TABLE phpbb_zebra (
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ zebra_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ friend tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ foe tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (user_id, zebra_id)
+);
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index 20af6f3566..45da3284b7 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -1,978 +1,976 @@
-# DO NOT EDIT THIS FILE, IT IS GENERATED
-#
-# To change the contents of this file, edit
-# phpBB/develop/create_schema_files.php and
-# run it.
-# Table: 'phpbb_attachments'
-CREATE TABLE phpbb_attachments (
- attach_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- post_msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- in_message tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- is_orphan tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- physical_filename varchar(255) DEFAULT '' NOT NULL,
- real_filename varchar(255) DEFAULT '' NOT NULL,
- download_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- attach_comment text NOT NULL,
- extension varchar(100) DEFAULT '' NOT NULL,
- mimetype varchar(100) DEFAULT '' NOT NULL,
- filesize int(20) UNSIGNED DEFAULT '0' NOT NULL,
- filetime int(11) UNSIGNED DEFAULT '0' NOT NULL,
- thumbnail tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (attach_id),
- KEY filetime (filetime),
- KEY post_msg_id (post_msg_id),
- KEY topic_id (topic_id),
- KEY poster_id (poster_id),
- KEY is_orphan (is_orphan)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_acl_groups'
-CREATE TABLE phpbb_acl_groups (
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_setting tinyint(2) DEFAULT '0' NOT NULL,
- KEY group_id (group_id),
- KEY auth_opt_id (auth_option_id),
- KEY auth_role_id (auth_role_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_acl_options'
-CREATE TABLE phpbb_acl_options (
- auth_option_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- auth_option varchar(50) DEFAULT '' NOT NULL,
- is_global tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- is_local tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- founder_only tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (auth_option_id),
- UNIQUE auth_option (auth_option)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_acl_roles'
-CREATE TABLE phpbb_acl_roles (
- role_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- role_name varchar(255) DEFAULT '' NOT NULL,
- role_description text NOT NULL,
- role_type varchar(10) DEFAULT '' NOT NULL,
- role_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (role_id),
- KEY role_type (role_type),
- KEY role_order (role_order)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_acl_roles_data'
-CREATE TABLE phpbb_acl_roles_data (
- role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_setting tinyint(2) DEFAULT '0' NOT NULL,
- PRIMARY KEY (role_id, auth_option_id),
- KEY ath_op_id (auth_option_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_acl_users'
-CREATE TABLE phpbb_acl_users (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- auth_setting tinyint(2) DEFAULT '0' NOT NULL,
- KEY user_id (user_id),
- KEY auth_option_id (auth_option_id),
- KEY auth_role_id (auth_role_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_banlist'
-CREATE TABLE phpbb_banlist (
- ban_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- ban_userid mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- ban_ip varchar(40) DEFAULT '' NOT NULL,
- ban_email varchar(100) DEFAULT '' NOT NULL,
- ban_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
- ban_end int(11) UNSIGNED DEFAULT '0' NOT NULL,
- ban_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- ban_reason varchar(255) DEFAULT '' NOT NULL,
- ban_give_reason varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (ban_id),
- KEY ban_end (ban_end),
- KEY ban_user (ban_userid, ban_exclude),
- KEY ban_email (ban_email, ban_exclude),
- KEY ban_ip (ban_ip, ban_exclude)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_bbcodes'
-CREATE TABLE phpbb_bbcodes (
- bbcode_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_tag varchar(16) DEFAULT '' NOT NULL,
- bbcode_helpline varchar(255) DEFAULT '' NOT NULL,
- display_on_posting tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_match text NOT NULL,
- bbcode_tpl mediumtext NOT NULL,
- first_pass_match mediumtext NOT NULL,
- first_pass_replace mediumtext NOT NULL,
- second_pass_match mediumtext NOT NULL,
- second_pass_replace mediumtext NOT NULL,
- PRIMARY KEY (bbcode_id),
- KEY display_on_post (display_on_posting)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_bookmarks'
-CREATE TABLE phpbb_bookmarks (
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (topic_id, user_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_bots'
-CREATE TABLE phpbb_bots (
- bot_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- bot_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- bot_name varchar(255) DEFAULT '' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- bot_agent varchar(255) DEFAULT '' NOT NULL,
- bot_ip varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (bot_id),
- KEY bot_active (bot_active)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_config'
-CREATE TABLE phpbb_config (
- config_name varchar(255) DEFAULT '' NOT NULL,
- config_value varchar(255) DEFAULT '' NOT NULL,
- is_dynamic tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (config_name),
- KEY is_dynamic (is_dynamic)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_confirm'
-CREATE TABLE phpbb_confirm (
- confirm_id char(32) DEFAULT '' NOT NULL,
- session_id char(32) DEFAULT '' NOT NULL,
- confirm_type tinyint(3) DEFAULT '0' NOT NULL,
- code varchar(8) DEFAULT '' NOT NULL,
- seed int(10) UNSIGNED DEFAULT '0' NOT NULL,
- attempts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (session_id, confirm_id),
- KEY confirm_type (confirm_type)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_disallow'
-CREATE TABLE phpbb_disallow (
- disallow_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- disallow_username varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (disallow_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_drafts'
-CREATE TABLE phpbb_drafts (
- draft_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- save_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- draft_subject varchar(255) DEFAULT '' NOT NULL,
- draft_message mediumtext NOT NULL,
- PRIMARY KEY (draft_id),
- KEY save_time (save_time)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_ext'
-CREATE TABLE phpbb_ext (
- ext_name varchar(255) DEFAULT '' NOT NULL,
- ext_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- ext_state text NOT NULL,
- UNIQUE ext_name (ext_name)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_extensions'
-CREATE TABLE phpbb_extensions (
- extension_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- extension varchar(100) DEFAULT '' NOT NULL,
- PRIMARY KEY (extension_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_extension_groups'
-CREATE TABLE phpbb_extension_groups (
- group_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- group_name varchar(255) DEFAULT '' NOT NULL,
- cat_id tinyint(2) DEFAULT '0' NOT NULL,
- allow_group tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- download_mode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- upload_icon varchar(255) DEFAULT '' NOT NULL,
- max_filesize int(20) UNSIGNED DEFAULT '0' NOT NULL,
- allowed_forums text NOT NULL,
- allow_in_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (group_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_forums'
-CREATE TABLE phpbb_forums (
- forum_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_parents mediumtext NOT NULL,
- forum_name varchar(255) DEFAULT '' NOT NULL,
- forum_desc text NOT NULL,
- forum_desc_bitfield varchar(255) DEFAULT '' NOT NULL,
- forum_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
- forum_desc_uid varchar(8) DEFAULT '' NOT NULL,
- forum_link varchar(255) DEFAULT '' NOT NULL,
- forum_password varchar(40) DEFAULT '' NOT NULL,
- forum_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_image varchar(255) DEFAULT '' NOT NULL,
- forum_rules text NOT NULL,
- forum_rules_link varchar(255) DEFAULT '' NOT NULL,
- forum_rules_bitfield varchar(255) DEFAULT '' NOT NULL,
- forum_rules_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
- forum_rules_uid varchar(8) DEFAULT '' NOT NULL,
- forum_topics_per_page tinyint(4) DEFAULT '0' NOT NULL,
- forum_type tinyint(4) DEFAULT '0' NOT NULL,
- forum_status tinyint(4) DEFAULT '0' NOT NULL,
- forum_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_topics mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_topics_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_post_subject varchar(255) DEFAULT '' NOT NULL,
- forum_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_poster_name varchar(255) DEFAULT '' NOT NULL,
- forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL,
- forum_flags tinyint(4) DEFAULT '32' NOT NULL,
- forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL,
- display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- prune_next int(11) UNSIGNED DEFAULT '0' NOT NULL,
- prune_days mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- prune_viewed mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- prune_freq mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (forum_id),
- KEY left_right_id (left_id, right_id),
- KEY forum_lastpost_id (forum_last_post_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_forums_access'
-CREATE TABLE phpbb_forums_access (
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- session_id char(32) DEFAULT '' NOT NULL,
- PRIMARY KEY (forum_id, user_id, session_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_forums_track'
-CREATE TABLE phpbb_forums_track (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, forum_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_forums_watch'
-CREATE TABLE phpbb_forums_watch (
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- KEY forum_id (forum_id),
- KEY user_id (user_id),
- KEY notify_stat (notify_status)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_groups'
-CREATE TABLE phpbb_groups (
- group_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- group_type tinyint(4) DEFAULT '1' NOT NULL,
- group_founder_manage tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_skip_auth tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_name varchar(255) DEFAULT '' NOT NULL,
- group_desc text NOT NULL,
- group_desc_bitfield varchar(255) DEFAULT '' NOT NULL,
- group_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
- group_desc_uid varchar(8) DEFAULT '' NOT NULL,
- group_display tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_avatar varchar(255) DEFAULT '' NOT NULL,
- group_avatar_type tinyint(2) DEFAULT '0' NOT NULL,
- group_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- group_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- group_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_colour varchar(6) DEFAULT '' NOT NULL,
- group_sig_chars mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_legend mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_teampage mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (group_id),
- KEY group_legend_name (group_legend, group_name)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_icons'
-CREATE TABLE phpbb_icons (
- icons_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- icons_url varchar(255) DEFAULT '' NOT NULL,
- icons_width tinyint(4) DEFAULT '0' NOT NULL,
- icons_height tinyint(4) DEFAULT '0' NOT NULL,
- icons_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- PRIMARY KEY (icons_id),
- KEY display_on_posting (display_on_posting)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_lang'
-CREATE TABLE phpbb_lang (
- lang_id tinyint(4) NOT NULL auto_increment,
- lang_iso varchar(30) DEFAULT '' NOT NULL,
- lang_dir varchar(30) DEFAULT '' NOT NULL,
- lang_english_name varchar(100) DEFAULT '' NOT NULL,
- lang_local_name varchar(255) DEFAULT '' NOT NULL,
- lang_author varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (lang_id),
- KEY lang_iso (lang_iso)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_log'
-CREATE TABLE phpbb_log (
- log_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- log_type tinyint(4) DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- reportee_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- log_ip varchar(40) DEFAULT '' NOT NULL,
- log_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- log_operation text NOT NULL,
- log_data mediumtext NOT NULL,
- PRIMARY KEY (log_id),
- KEY log_type (log_type),
- KEY log_time (log_time),
- KEY forum_id (forum_id),
- KEY topic_id (topic_id),
- KEY reportee_id (reportee_id),
- KEY user_id (user_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_login_attempts'
-CREATE TABLE phpbb_login_attempts (
- attempt_ip varchar(40) DEFAULT '' NOT NULL,
- attempt_browser varchar(150) DEFAULT '' NOT NULL,
- attempt_forwarded_for varchar(255) DEFAULT '' NOT NULL,
- attempt_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- username varchar(255) DEFAULT '0' NOT NULL,
- username_clean varchar(255) DEFAULT '0' NOT NULL,
- KEY att_ip (attempt_ip, attempt_time),
- KEY att_for (attempt_forwarded_for, attempt_time),
- KEY att_time (attempt_time),
- KEY user_id (user_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_moderator_cache'
-CREATE TABLE phpbb_moderator_cache (
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- username varchar(255) DEFAULT '' NOT NULL,
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_name varchar(255) DEFAULT '' NOT NULL,
- display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- KEY disp_idx (display_on_index),
- KEY forum_id (forum_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_modules'
-CREATE TABLE phpbb_modules (
- module_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- module_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- module_display tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- module_basename varchar(255) DEFAULT '' NOT NULL,
- module_class varchar(10) DEFAULT '' NOT NULL,
- parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- module_langname varchar(255) DEFAULT '' NOT NULL,
- module_mode varchar(255) DEFAULT '' NOT NULL,
- module_auth varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (module_id),
- KEY left_right_id (left_id, right_id),
- KEY module_enabled (module_enabled),
- KEY class_left_id (module_class, left_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_poll_options'
-CREATE TABLE phpbb_poll_options (
- poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poll_option_text text NOT NULL,
- poll_option_total mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- KEY poll_opt_id (poll_option_id),
- KEY topic_id (topic_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_poll_votes'
-CREATE TABLE phpbb_poll_votes (
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
- vote_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- vote_user_ip varchar(40) DEFAULT '' NOT NULL,
- KEY topic_id (topic_id),
- KEY vote_user_id (vote_user_id),
- KEY vote_user_ip (vote_user_ip)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_posts'
-CREATE TABLE phpbb_posts (
- post_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poster_ip varchar(40) DEFAULT '' NOT NULL,
- post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- post_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- post_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- post_username varchar(255) DEFAULT '' NOT NULL,
- post_subject varchar(255) DEFAULT '' NOT NULL COLLATE utf8_unicode_ci,
- post_text mediumtext NOT NULL,
- post_checksum varchar(32) DEFAULT '' NOT NULL,
- post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
- bbcode_uid varchar(8) DEFAULT '' NOT NULL,
- post_postcount tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- post_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- post_edit_reason varchar(255) DEFAULT '' NOT NULL,
- post_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- post_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- post_edit_locked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (post_id),
- KEY forum_id (forum_id),
- KEY topic_id (topic_id),
- KEY poster_ip (poster_ip),
- KEY poster_id (poster_id),
- KEY post_approved (post_approved),
- KEY post_username (post_username),
- KEY tid_post_time (topic_id, post_time)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_privmsgs'
-CREATE TABLE phpbb_privmsgs (
- msg_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- root_level mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- author_ip varchar(40) DEFAULT '' NOT NULL,
- message_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- message_subject varchar(255) DEFAULT '' NOT NULL,
- message_text mediumtext NOT NULL,
- message_edit_reason varchar(255) DEFAULT '' NOT NULL,
- message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- message_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
- bbcode_uid varchar(8) DEFAULT '' NOT NULL,
- message_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- message_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- to_address text NOT NULL,
- bcc_address text NOT NULL,
- message_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (msg_id),
- KEY author_ip (author_ip),
- KEY message_time (message_time),
- KEY author_id (author_id),
- KEY root_level (root_level)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_privmsgs_folder'
-CREATE TABLE phpbb_privmsgs_folder (
- folder_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- folder_name varchar(255) DEFAULT '' NOT NULL,
- pm_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (folder_id),
- KEY user_id (user_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_privmsgs_rules'
-CREATE TABLE phpbb_privmsgs_rules (
- rule_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_check mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_connection mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_string varchar(255) DEFAULT '' NOT NULL,
- rule_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_action mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rule_folder_id int(11) DEFAULT '0' NOT NULL,
- PRIMARY KEY (rule_id),
- KEY user_id (user_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_privmsgs_to'
-CREATE TABLE phpbb_privmsgs_to (
- msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- pm_deleted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- pm_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- pm_unread tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- pm_replied tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- pm_marked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- pm_forwarded tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- folder_id int(11) DEFAULT '0' NOT NULL,
- KEY msg_id (msg_id),
- KEY author_id (author_id),
- KEY usr_flder_id (user_id, folder_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_profile_fields'
-CREATE TABLE phpbb_profile_fields (
- field_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- field_name varchar(255) DEFAULT '' NOT NULL,
- field_type tinyint(4) DEFAULT '0' NOT NULL,
- field_ident varchar(20) DEFAULT '' NOT NULL,
- field_length varchar(20) DEFAULT '' NOT NULL,
- field_minlen varchar(255) DEFAULT '' NOT NULL,
- field_maxlen varchar(255) DEFAULT '' NOT NULL,
- field_novalue varchar(255) DEFAULT '' NOT NULL,
- field_default_value varchar(255) DEFAULT '' NOT NULL,
- field_validation varchar(20) DEFAULT '' NOT NULL,
- field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_on_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_hide tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_no_view tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- field_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (field_id),
- KEY fld_type (field_type),
- KEY fld_ordr (field_order)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_profile_fields_data'
-CREATE TABLE phpbb_profile_fields_data (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_profile_fields_lang'
-CREATE TABLE phpbb_profile_fields_lang (
- field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- field_type tinyint(4) DEFAULT '0' NOT NULL,
- lang_value varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (field_id, lang_id, option_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_profile_lang'
-CREATE TABLE phpbb_profile_lang (
- field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- lang_name varchar(255) DEFAULT '' NOT NULL,
- lang_explain text NOT NULL,
- lang_default_value varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (field_id, lang_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_ranks'
-CREATE TABLE phpbb_ranks (
- rank_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- rank_title varchar(255) DEFAULT '' NOT NULL,
- rank_min mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- rank_special tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- rank_image varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (rank_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_reports'
-CREATE TABLE phpbb_reports (
- report_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- reason_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- pm_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- report_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- report_text mediumtext NOT NULL,
- reported_post_text mediumtext NOT NULL,
- PRIMARY KEY (report_id),
- KEY post_id (post_id),
- KEY pm_id (pm_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_reports_reasons'
-CREATE TABLE phpbb_reports_reasons (
- reason_id smallint(4) UNSIGNED NOT NULL auto_increment,
- reason_title varchar(255) DEFAULT '' NOT NULL,
- reason_description mediumtext NOT NULL,
- reason_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (reason_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_search_results'
-CREATE TABLE phpbb_search_results (
- search_key varchar(32) DEFAULT '' NOT NULL,
- search_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- search_keywords mediumtext NOT NULL,
- search_authors mediumtext NOT NULL,
- PRIMARY KEY (search_key)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_search_wordlist'
-CREATE TABLE phpbb_search_wordlist (
- word_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- word_text varchar(255) DEFAULT '' NOT NULL,
- word_common tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- word_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (word_id),
- UNIQUE wrd_txt (word_text),
- KEY wrd_cnt (word_count)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_search_wordmatch'
-CREATE TABLE phpbb_search_wordmatch (
- post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- word_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- title_match tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- UNIQUE unq_mtch (word_id, post_id, title_match),
- KEY word_id (word_id),
- KEY post_id (post_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_sessions'
-CREATE TABLE phpbb_sessions (
- session_id char(32) DEFAULT '' NOT NULL,
- session_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- session_forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- session_last_visit int(11) UNSIGNED DEFAULT '0' NOT NULL,
- session_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
- session_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- session_ip varchar(40) DEFAULT '' NOT NULL,
- session_browser varchar(150) DEFAULT '' NOT NULL,
- session_forwarded_for varchar(255) DEFAULT '' NOT NULL,
- session_page varchar(255) DEFAULT '' NOT NULL,
- session_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- session_autologin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- session_admin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (session_id),
- KEY session_time (session_time),
- KEY session_user_id (session_user_id),
- KEY session_fid (session_forum_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_sessions_keys'
-CREATE TABLE phpbb_sessions_keys (
- key_id char(32) DEFAULT '' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- last_ip varchar(40) DEFAULT '' NOT NULL,
- last_login int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (key_id, user_id),
- KEY last_login (last_login)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_sitelist'
-CREATE TABLE phpbb_sitelist (
- site_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- site_ip varchar(40) DEFAULT '' NOT NULL,
- site_hostname varchar(255) DEFAULT '' NOT NULL,
- ip_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (site_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_smilies'
-CREATE TABLE phpbb_smilies (
- smiley_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- code varchar(50) DEFAULT '' NOT NULL,
- emotion varchar(50) DEFAULT '' NOT NULL,
- smiley_url varchar(50) DEFAULT '' NOT NULL,
- smiley_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- smiley_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- smiley_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- PRIMARY KEY (smiley_id),
- KEY display_on_post (display_on_posting)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_styles'
-CREATE TABLE phpbb_styles (
- style_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- style_name varchar(255) DEFAULT '' NOT NULL,
- style_copyright varchar(255) DEFAULT '' NOT NULL,
- style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- style_path varchar(100) DEFAULT '' NOT NULL,
- bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL,
- style_parent_id int(4) UNSIGNED DEFAULT '0' NOT NULL,
- style_parent_tree text NOT NULL,
- PRIMARY KEY (style_id),
- UNIQUE style_name (style_name)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_topics'
-CREATE TABLE phpbb_topics (
- topic_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- topic_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- topic_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- topic_title varchar(255) DEFAULT '' NOT NULL COLLATE utf8_unicode_ci,
- topic_poster mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_time_limit int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_views mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_replies mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_replies_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_status tinyint(3) DEFAULT '0' NOT NULL,
- topic_type tinyint(3) DEFAULT '0' NOT NULL,
- topic_first_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_first_poster_name varchar(255) DEFAULT '' NOT NULL,
- topic_first_poster_colour varchar(6) DEFAULT '' NOT NULL,
- topic_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_last_poster_name varchar(255) DEFAULT '' NOT NULL,
- topic_last_poster_colour varchar(6) DEFAULT '' NOT NULL,
- topic_last_post_subject varchar(255) DEFAULT '' NOT NULL,
- topic_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_last_view_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- topic_moved_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_bumped tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- topic_bumper mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- poll_title varchar(255) DEFAULT '' NOT NULL,
- poll_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
- poll_length int(11) UNSIGNED DEFAULT '0' NOT NULL,
- poll_max_options tinyint(4) DEFAULT '1' NOT NULL,
- poll_last_vote int(11) UNSIGNED DEFAULT '0' NOT NULL,
- poll_vote_change tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (topic_id),
- KEY forum_id (forum_id),
- KEY forum_id_type (forum_id, topic_type),
- KEY last_post_time (topic_last_post_time),
- KEY topic_approved (topic_approved),
- KEY forum_appr_last (forum_id, topic_approved, topic_last_post_id),
- KEY fid_time_moved (forum_id, topic_last_post_time, topic_moved_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_topics_track'
-CREATE TABLE phpbb_topics_track (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, topic_id),
- KEY topic_id (topic_id),
- KEY forum_id (forum_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_topics_posted'
-CREATE TABLE phpbb_topics_posted (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- topic_posted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, topic_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_topics_watch'
-CREATE TABLE phpbb_topics_watch (
- topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- KEY topic_id (topic_id),
- KEY user_id (user_id),
- KEY notify_stat (notify_status)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_user_group'
-CREATE TABLE phpbb_user_group (
- group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- group_leader tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_pending tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- KEY group_id (group_id),
- KEY user_id (user_id),
- KEY group_leader (group_leader)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_users'
-CREATE TABLE phpbb_users (
- user_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_type tinyint(2) DEFAULT '0' NOT NULL,
- group_id mediumint(8) UNSIGNED DEFAULT '3' NOT NULL,
- user_permissions mediumtext NOT NULL,
- user_perm_from mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_ip varchar(40) DEFAULT '' NOT NULL,
- user_regdate int(11) UNSIGNED DEFAULT '0' NOT NULL,
- username varchar(255) DEFAULT '' NOT NULL,
- username_clean varchar(255) DEFAULT '' NOT NULL,
- user_password varchar(40) DEFAULT '' NOT NULL,
- user_passchg int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_pass_convert tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_email varchar(100) DEFAULT '' NOT NULL,
- user_email_hash bigint(20) DEFAULT '0' NOT NULL,
- user_birthday varchar(10) DEFAULT '' NOT NULL,
- user_lastvisit int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_lastmark int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_lastpost_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_lastpage varchar(200) DEFAULT '' NOT NULL,
- user_last_confirm_key varchar(10) DEFAULT '' NOT NULL,
- user_last_search int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_warnings tinyint(4) DEFAULT '0' NOT NULL,
- user_last_warning int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_login_attempts tinyint(4) DEFAULT '0' NOT NULL,
- user_inactive_reason tinyint(2) DEFAULT '0' NOT NULL,
- user_inactive_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_lang varchar(30) DEFAULT '' NOT NULL,
- user_timezone varchar(100) DEFAULT 'UTC' NOT NULL,
- user_dateformat varchar(30) DEFAULT 'd M Y H:i' NOT NULL,
- user_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- user_colour varchar(6) DEFAULT '' NOT NULL,
- user_new_privmsg int(4) DEFAULT '0' NOT NULL,
- user_unread_privmsg int(4) DEFAULT '0' NOT NULL,
- user_last_privmsg int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_message_rules tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_full_folder int(11) DEFAULT '-3' NOT NULL,
- user_emailtime int(11) UNSIGNED DEFAULT '0' NOT NULL,
- user_topic_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_topic_sortby_type varchar(1) DEFAULT 't' NOT NULL,
- user_topic_sortby_dir varchar(1) DEFAULT 'd' NOT NULL,
- user_post_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_post_sortby_type varchar(1) DEFAULT 't' NOT NULL,
- user_post_sortby_dir varchar(1) DEFAULT 'a' NOT NULL,
- user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- user_notify_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_notify_type tinyint(4) DEFAULT '0' NOT NULL,
- user_allow_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_allow_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_allow_viewemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_allow_massemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_options int(11) UNSIGNED DEFAULT '230271' NOT NULL,
- user_avatar varchar(255) DEFAULT '' NOT NULL,
- user_avatar_type tinyint(2) DEFAULT '0' NOT NULL,
- user_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
- user_sig mediumtext NOT NULL,
- user_sig_bbcode_uid varchar(8) DEFAULT '' NOT NULL,
- user_sig_bbcode_bitfield varchar(255) DEFAULT '' 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 text NOT NULL,
- user_interests text NOT NULL,
- user_actkey varchar(32) DEFAULT '' NOT NULL,
- user_newpasswd varchar(40) DEFAULT '' NOT NULL,
- user_form_salt varchar(32) DEFAULT '' NOT NULL,
- user_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
- user_reminded tinyint(4) DEFAULT '0' NOT NULL,
- user_reminded_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id),
- KEY user_birthday (user_birthday),
- KEY user_email_hash (user_email_hash),
- KEY user_type (user_type),
- UNIQUE username_clean (username_clean)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_warnings'
-CREATE TABLE phpbb_warnings (
- warning_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- log_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- warning_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (warning_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_words'
-CREATE TABLE phpbb_words (
- word_id mediumint(8) UNSIGNED NOT NULL auto_increment,
- word varchar(255) DEFAULT '' NOT NULL,
- replacement varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (word_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
-# Table: 'phpbb_zebra'
-CREATE TABLE phpbb_zebra (
- user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- zebra_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- friend tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- foe tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- PRIMARY KEY (user_id, zebra_id)
-) CHARACTER SET `utf8` COLLATE `utf8_bin`;
-
-
+# DO NOT EDIT THIS FILE, IT IS GENERATED
+#
+# To change the contents of this file, edit
+# phpBB/develop/create_schema_files.php and
+# run it.
+# Table: 'phpbb_attachments'
+CREATE TABLE phpbb_attachments (
+ attach_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ post_msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ in_message tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ is_orphan tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ physical_filename varchar(255) DEFAULT '' NOT NULL,
+ real_filename varchar(255) DEFAULT '' NOT NULL,
+ download_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ attach_comment text NOT NULL,
+ extension varchar(100) DEFAULT '' NOT NULL,
+ mimetype varchar(100) DEFAULT '' NOT NULL,
+ filesize int(20) UNSIGNED DEFAULT '0' NOT NULL,
+ filetime int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ thumbnail tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (attach_id),
+ KEY filetime (filetime),
+ KEY post_msg_id (post_msg_id),
+ KEY topic_id (topic_id),
+ KEY poster_id (poster_id),
+ KEY is_orphan (is_orphan)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_acl_groups'
+CREATE TABLE phpbb_acl_groups (
+ group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_setting tinyint(2) DEFAULT '0' NOT NULL,
+ KEY group_id (group_id),
+ KEY auth_opt_id (auth_option_id),
+ KEY auth_role_id (auth_role_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_acl_options'
+CREATE TABLE phpbb_acl_options (
+ auth_option_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ auth_option varchar(50) DEFAULT '' NOT NULL,
+ is_global tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ is_local tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ founder_only tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (auth_option_id),
+ UNIQUE auth_option (auth_option)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_acl_roles'
+CREATE TABLE phpbb_acl_roles (
+ role_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ role_name varchar(255) DEFAULT '' NOT NULL,
+ role_description text NOT NULL,
+ role_type varchar(10) DEFAULT '' NOT NULL,
+ role_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (role_id),
+ KEY role_type (role_type),
+ KEY role_order (role_order)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_acl_roles_data'
+CREATE TABLE phpbb_acl_roles_data (
+ role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_setting tinyint(2) DEFAULT '0' NOT NULL,
+ PRIMARY KEY (role_id, auth_option_id),
+ KEY ath_op_id (auth_option_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_acl_users'
+CREATE TABLE phpbb_acl_users (
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ auth_setting tinyint(2) DEFAULT '0' NOT NULL,
+ KEY user_id (user_id),
+ KEY auth_option_id (auth_option_id),
+ KEY auth_role_id (auth_role_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_banlist'
+CREATE TABLE phpbb_banlist (
+ ban_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ ban_userid mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ ban_ip varchar(40) DEFAULT '' NOT NULL,
+ ban_email varchar(100) DEFAULT '' NOT NULL,
+ ban_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ ban_end int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ ban_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ ban_reason varchar(255) DEFAULT '' NOT NULL,
+ ban_give_reason varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (ban_id),
+ KEY ban_end (ban_end),
+ KEY ban_user (ban_userid, ban_exclude),
+ KEY ban_email (ban_email, ban_exclude),
+ KEY ban_ip (ban_ip, ban_exclude)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_bbcodes'
+CREATE TABLE phpbb_bbcodes (
+ bbcode_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ bbcode_tag varchar(16) DEFAULT '' NOT NULL,
+ bbcode_helpline varchar(255) DEFAULT '' NOT NULL,
+ display_on_posting tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ bbcode_match text NOT NULL,
+ bbcode_tpl mediumtext NOT NULL,
+ first_pass_match mediumtext NOT NULL,
+ first_pass_replace mediumtext NOT NULL,
+ second_pass_match mediumtext NOT NULL,
+ second_pass_replace mediumtext NOT NULL,
+ PRIMARY KEY (bbcode_id),
+ KEY display_on_post (display_on_posting)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_bookmarks'
+CREATE TABLE phpbb_bookmarks (
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (topic_id, user_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_bots'
+CREATE TABLE phpbb_bots (
+ bot_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ bot_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ bot_name varchar(255) DEFAULT '' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ bot_agent varchar(255) DEFAULT '' NOT NULL,
+ bot_ip varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (bot_id),
+ KEY bot_active (bot_active)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_config'
+CREATE TABLE phpbb_config (
+ config_name varchar(255) DEFAULT '' NOT NULL,
+ config_value varchar(255) DEFAULT '' NOT NULL,
+ is_dynamic tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (config_name),
+ KEY is_dynamic (is_dynamic)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_confirm'
+CREATE TABLE phpbb_confirm (
+ confirm_id char(32) DEFAULT '' NOT NULL,
+ session_id char(32) DEFAULT '' NOT NULL,
+ confirm_type tinyint(3) DEFAULT '0' NOT NULL,
+ code varchar(8) DEFAULT '' NOT NULL,
+ seed int(10) UNSIGNED DEFAULT '0' NOT NULL,
+ attempts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (session_id, confirm_id),
+ KEY confirm_type (confirm_type)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_disallow'
+CREATE TABLE phpbb_disallow (
+ disallow_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ disallow_username varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (disallow_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_drafts'
+CREATE TABLE phpbb_drafts (
+ draft_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ save_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ draft_subject varchar(255) DEFAULT '' NOT NULL,
+ draft_message mediumtext NOT NULL,
+ PRIMARY KEY (draft_id),
+ KEY save_time (save_time)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_ext'
+CREATE TABLE phpbb_ext (
+ ext_name varchar(255) DEFAULT '' NOT NULL,
+ ext_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ ext_state text NOT NULL,
+ UNIQUE ext_name (ext_name)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_extensions'
+CREATE TABLE phpbb_extensions (
+ extension_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ extension varchar(100) DEFAULT '' NOT NULL,
+ PRIMARY KEY (extension_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_extension_groups'
+CREATE TABLE phpbb_extension_groups (
+ group_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ group_name varchar(255) DEFAULT '' NOT NULL,
+ cat_id tinyint(2) DEFAULT '0' NOT NULL,
+ allow_group tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ download_mode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ upload_icon varchar(255) DEFAULT '' NOT NULL,
+ max_filesize int(20) UNSIGNED DEFAULT '0' NOT NULL,
+ allowed_forums text NOT NULL,
+ allow_in_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (group_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_forums'
+CREATE TABLE phpbb_forums (
+ forum_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_parents mediumtext NOT NULL,
+ forum_name varchar(255) DEFAULT '' NOT NULL,
+ forum_desc text NOT NULL,
+ forum_desc_bitfield varchar(255) DEFAULT '' NOT NULL,
+ forum_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
+ forum_desc_uid varchar(8) DEFAULT '' NOT NULL,
+ forum_link varchar(255) DEFAULT '' NOT NULL,
+ forum_password varchar(40) DEFAULT '' NOT NULL,
+ forum_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_image varchar(255) DEFAULT '' NOT NULL,
+ forum_rules text NOT NULL,
+ forum_rules_link varchar(255) DEFAULT '' NOT NULL,
+ forum_rules_bitfield varchar(255) DEFAULT '' NOT NULL,
+ forum_rules_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
+ forum_rules_uid varchar(8) DEFAULT '' NOT NULL,
+ forum_topics_per_page tinyint(4) DEFAULT '0' NOT NULL,
+ forum_type tinyint(4) DEFAULT '0' NOT NULL,
+ forum_status tinyint(4) DEFAULT '0' NOT NULL,
+ forum_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_topics mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_topics_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_last_post_subject varchar(255) DEFAULT '' NOT NULL,
+ forum_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_last_poster_name varchar(255) DEFAULT '' NOT NULL,
+ forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL,
+ forum_flags tinyint(4) DEFAULT '32' NOT NULL,
+ forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL,
+ display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ prune_next int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ prune_days mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ prune_viewed mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ prune_freq mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (forum_id),
+ KEY left_right_id (left_id, right_id),
+ KEY forum_lastpost_id (forum_last_post_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_forums_access'
+CREATE TABLE phpbb_forums_access (
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ session_id char(32) DEFAULT '' NOT NULL,
+ PRIMARY KEY (forum_id, user_id, session_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_forums_track'
+CREATE TABLE phpbb_forums_track (
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (user_id, forum_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_forums_watch'
+CREATE TABLE phpbb_forums_watch (
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ KEY forum_id (forum_id),
+ KEY user_id (user_id),
+ KEY notify_stat (notify_status)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_groups'
+CREATE TABLE phpbb_groups (
+ group_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ group_type tinyint(4) DEFAULT '1' NOT NULL,
+ group_founder_manage tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ group_skip_auth tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ group_name varchar(255) DEFAULT '' NOT NULL,
+ group_desc text NOT NULL,
+ group_desc_bitfield varchar(255) DEFAULT '' NOT NULL,
+ group_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL,
+ group_desc_uid varchar(8) DEFAULT '' NOT NULL,
+ group_display tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ group_avatar varchar(255) DEFAULT '' NOT NULL,
+ group_avatar_type tinyint(2) DEFAULT '0' NOT NULL,
+ group_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ group_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ group_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_colour varchar(6) DEFAULT '' NOT NULL,
+ group_sig_chars mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_max_recipients mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_legend mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_teampage mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (group_id),
+ KEY group_legend_name (group_legend, group_name)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_icons'
+CREATE TABLE phpbb_icons (
+ icons_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ icons_url varchar(255) DEFAULT '' NOT NULL,
+ icons_width tinyint(4) DEFAULT '0' NOT NULL,
+ icons_height tinyint(4) DEFAULT '0' NOT NULL,
+ icons_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ PRIMARY KEY (icons_id),
+ KEY display_on_posting (display_on_posting)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_lang'
+CREATE TABLE phpbb_lang (
+ lang_id tinyint(4) NOT NULL auto_increment,
+ lang_iso varchar(30) DEFAULT '' NOT NULL,
+ lang_dir varchar(30) DEFAULT '' NOT NULL,
+ lang_english_name varchar(100) DEFAULT '' NOT NULL,
+ lang_local_name varchar(255) DEFAULT '' NOT NULL,
+ lang_author varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (lang_id),
+ KEY lang_iso (lang_iso)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_log'
+CREATE TABLE phpbb_log (
+ log_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ log_type tinyint(4) DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ reportee_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ log_ip varchar(40) DEFAULT '' NOT NULL,
+ log_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ log_operation text NOT NULL,
+ log_data mediumtext NOT NULL,
+ PRIMARY KEY (log_id),
+ KEY log_type (log_type),
+ KEY log_time (log_time),
+ KEY forum_id (forum_id),
+ KEY topic_id (topic_id),
+ KEY reportee_id (reportee_id),
+ KEY user_id (user_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_login_attempts'
+CREATE TABLE phpbb_login_attempts (
+ attempt_ip varchar(40) DEFAULT '' NOT NULL,
+ attempt_browser varchar(150) DEFAULT '' NOT NULL,
+ attempt_forwarded_for varchar(255) DEFAULT '' NOT NULL,
+ attempt_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ username varchar(255) DEFAULT '0' NOT NULL,
+ username_clean varchar(255) DEFAULT '0' NOT NULL,
+ KEY att_ip (attempt_ip, attempt_time),
+ KEY att_for (attempt_forwarded_for, attempt_time),
+ KEY att_time (attempt_time),
+ KEY user_id (user_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_moderator_cache'
+CREATE TABLE phpbb_moderator_cache (
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ username varchar(255) DEFAULT '' NOT NULL,
+ group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_name varchar(255) DEFAULT '' NOT NULL,
+ display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ KEY disp_idx (display_on_index),
+ KEY forum_id (forum_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_modules'
+CREATE TABLE phpbb_modules (
+ module_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ module_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ module_display tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ module_basename varchar(255) DEFAULT '' NOT NULL,
+ module_class varchar(10) DEFAULT '' NOT NULL,
+ parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ module_langname varchar(255) DEFAULT '' NOT NULL,
+ module_mode varchar(255) DEFAULT '' NOT NULL,
+ module_auth varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (module_id),
+ KEY left_right_id (left_id, right_id),
+ KEY module_enabled (module_enabled),
+ KEY class_left_id (module_class, left_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_poll_options'
+CREATE TABLE phpbb_poll_options (
+ poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ poll_option_text text NOT NULL,
+ poll_option_total mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ KEY poll_opt_id (poll_option_id),
+ KEY topic_id (topic_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_poll_votes'
+CREATE TABLE phpbb_poll_votes (
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
+ vote_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ vote_user_ip varchar(40) DEFAULT '' NOT NULL,
+ KEY topic_id (topic_id),
+ KEY vote_user_id (vote_user_id),
+ KEY vote_user_ip (vote_user_ip)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_posts'
+CREATE TABLE phpbb_posts (
+ post_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ poster_ip varchar(40) DEFAULT '' NOT NULL,
+ post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ post_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ post_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ post_username varchar(255) DEFAULT '' NOT NULL,
+ post_subject varchar(255) DEFAULT '' NOT NULL COLLATE utf8_unicode_ci,
+ post_text mediumtext NOT NULL,
+ post_checksum varchar(32) DEFAULT '' NOT NULL,
+ post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
+ bbcode_uid varchar(8) DEFAULT '' NOT NULL,
+ post_postcount tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ post_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ post_edit_reason varchar(255) DEFAULT '' NOT NULL,
+ post_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ post_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ post_edit_locked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (post_id),
+ KEY forum_id (forum_id),
+ KEY topic_id (topic_id),
+ KEY poster_ip (poster_ip),
+ KEY poster_id (poster_id),
+ KEY post_approved (post_approved),
+ KEY post_username (post_username),
+ KEY tid_post_time (topic_id, post_time)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_privmsgs'
+CREATE TABLE phpbb_privmsgs (
+ msg_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ root_level mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ author_ip varchar(40) DEFAULT '' NOT NULL,
+ message_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ message_subject varchar(255) DEFAULT '' NOT NULL,
+ message_text mediumtext NOT NULL,
+ message_edit_reason varchar(255) DEFAULT '' NOT NULL,
+ message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ message_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
+ bbcode_uid varchar(8) DEFAULT '' NOT NULL,
+ message_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ message_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ to_address text NOT NULL,
+ bcc_address text NOT NULL,
+ message_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (msg_id),
+ KEY author_ip (author_ip),
+ KEY message_time (message_time),
+ KEY author_id (author_id),
+ KEY root_level (root_level)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_privmsgs_folder'
+CREATE TABLE phpbb_privmsgs_folder (
+ folder_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ folder_name varchar(255) DEFAULT '' NOT NULL,
+ pm_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (folder_id),
+ KEY user_id (user_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_privmsgs_rules'
+CREATE TABLE phpbb_privmsgs_rules (
+ rule_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ rule_check mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ rule_connection mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ rule_string varchar(255) DEFAULT '' NOT NULL,
+ rule_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ rule_group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ rule_action mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ rule_folder_id int(11) DEFAULT '0' NOT NULL,
+ PRIMARY KEY (rule_id),
+ KEY user_id (user_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_privmsgs_to'
+CREATE TABLE phpbb_privmsgs_to (
+ msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ pm_deleted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ pm_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ pm_unread tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ pm_replied tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ pm_marked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ pm_forwarded tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ folder_id int(11) DEFAULT '0' NOT NULL,
+ KEY msg_id (msg_id),
+ KEY author_id (author_id),
+ KEY usr_flder_id (user_id, folder_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_profile_fields'
+CREATE TABLE phpbb_profile_fields (
+ field_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ field_name varchar(255) DEFAULT '' NOT NULL,
+ field_type tinyint(4) DEFAULT '0' NOT NULL,
+ field_ident varchar(20) DEFAULT '' NOT NULL,
+ field_length varchar(20) DEFAULT '' NOT NULL,
+ field_minlen varchar(255) DEFAULT '' NOT NULL,
+ field_maxlen varchar(255) DEFAULT '' NOT NULL,
+ field_novalue varchar(255) DEFAULT '' NOT NULL,
+ field_default_value varchar(255) DEFAULT '' NOT NULL,
+ field_validation varchar(20) DEFAULT '' NOT NULL,
+ field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_on_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_hide tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_no_view tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (field_id),
+ KEY fld_type (field_type),
+ KEY fld_ordr (field_order)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_profile_fields_data'
+CREATE TABLE phpbb_profile_fields_data (
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (user_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_profile_fields_lang'
+CREATE TABLE phpbb_profile_fields_lang (
+ field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ field_type tinyint(4) DEFAULT '0' NOT NULL,
+ lang_value varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (field_id, lang_id, option_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_profile_lang'
+CREATE TABLE phpbb_profile_lang (
+ field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ lang_name varchar(255) DEFAULT '' NOT NULL,
+ lang_explain text NOT NULL,
+ lang_default_value varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (field_id, lang_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_ranks'
+CREATE TABLE phpbb_ranks (
+ rank_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ rank_title varchar(255) DEFAULT '' NOT NULL,
+ rank_min mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ rank_special tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ rank_image varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (rank_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_reports'
+CREATE TABLE phpbb_reports (
+ report_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ reason_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ pm_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ report_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ report_text mediumtext NOT NULL,
+ reported_post_text mediumtext NOT NULL,
+ PRIMARY KEY (report_id),
+ KEY post_id (post_id),
+ KEY pm_id (pm_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_reports_reasons'
+CREATE TABLE phpbb_reports_reasons (
+ reason_id smallint(4) UNSIGNED NOT NULL auto_increment,
+ reason_title varchar(255) DEFAULT '' NOT NULL,
+ reason_description mediumtext NOT NULL,
+ reason_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (reason_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_search_results'
+CREATE TABLE phpbb_search_results (
+ search_key varchar(32) DEFAULT '' NOT NULL,
+ search_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ search_keywords mediumtext NOT NULL,
+ search_authors mediumtext NOT NULL,
+ PRIMARY KEY (search_key)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_search_wordlist'
+CREATE TABLE phpbb_search_wordlist (
+ word_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ word_text varchar(255) DEFAULT '' NOT NULL,
+ word_common tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ word_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (word_id),
+ UNIQUE wrd_txt (word_text),
+ KEY wrd_cnt (word_count)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_search_wordmatch'
+CREATE TABLE phpbb_search_wordmatch (
+ post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ word_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ title_match tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ UNIQUE unq_mtch (word_id, post_id, title_match),
+ KEY word_id (word_id),
+ KEY post_id (post_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_sessions'
+CREATE TABLE phpbb_sessions (
+ session_id char(32) DEFAULT '' NOT NULL,
+ session_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ session_forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ session_last_visit int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ session_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ session_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ session_ip varchar(40) DEFAULT '' NOT NULL,
+ session_browser varchar(150) DEFAULT '' NOT NULL,
+ session_forwarded_for varchar(255) DEFAULT '' NOT NULL,
+ session_page varchar(255) DEFAULT '' NOT NULL,
+ session_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ session_autologin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ session_admin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (session_id),
+ KEY session_time (session_time),
+ KEY session_user_id (session_user_id),
+ KEY session_fid (session_forum_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_sessions_keys'
+CREATE TABLE phpbb_sessions_keys (
+ key_id char(32) DEFAULT '' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ last_ip varchar(40) DEFAULT '' NOT NULL,
+ last_login int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (key_id, user_id),
+ KEY last_login (last_login)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_sitelist'
+CREATE TABLE phpbb_sitelist (
+ site_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ site_ip varchar(40) DEFAULT '' NOT NULL,
+ site_hostname varchar(255) DEFAULT '' NOT NULL,
+ ip_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (site_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_smilies'
+CREATE TABLE phpbb_smilies (
+ smiley_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ code varchar(50) DEFAULT '' NOT NULL,
+ emotion varchar(50) DEFAULT '' NOT NULL,
+ smiley_url varchar(50) DEFAULT '' NOT NULL,
+ smiley_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ smiley_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ smiley_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ PRIMARY KEY (smiley_id),
+ KEY display_on_post (display_on_posting)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_styles'
+CREATE TABLE phpbb_styles (
+ style_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ style_name varchar(255) DEFAULT '' NOT NULL,
+ style_copyright varchar(255) DEFAULT '' NOT NULL,
+ style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ style_path varchar(100) DEFAULT '' NOT NULL,
+ bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL,
+ style_parent_id int(4) UNSIGNED DEFAULT '0' NOT NULL,
+ style_parent_tree text NOT NULL,
+ PRIMARY KEY (style_id),
+ UNIQUE style_name (style_name)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_topics'
+CREATE TABLE phpbb_topics (
+ topic_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ topic_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_title varchar(255) DEFAULT '' NOT NULL COLLATE utf8_unicode_ci,
+ topic_poster mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_time_limit int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_views mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_replies mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_replies_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_status tinyint(3) DEFAULT '0' NOT NULL,
+ topic_type tinyint(3) DEFAULT '0' NOT NULL,
+ topic_first_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_first_poster_name varchar(255) DEFAULT '' NOT NULL,
+ topic_first_poster_colour varchar(6) DEFAULT '' NOT NULL,
+ topic_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_last_poster_name varchar(255) DEFAULT '' NOT NULL,
+ topic_last_poster_colour varchar(6) DEFAULT '' NOT NULL,
+ topic_last_post_subject varchar(255) DEFAULT '' NOT NULL,
+ topic_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_last_view_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_moved_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_bumped tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_bumper mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ poll_title varchar(255) DEFAULT '' NOT NULL,
+ poll_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ poll_length int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ poll_max_options tinyint(4) DEFAULT '1' NOT NULL,
+ poll_last_vote int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ poll_vote_change tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (topic_id),
+ KEY forum_id (forum_id),
+ KEY forum_id_type (forum_id, topic_type),
+ KEY last_post_time (topic_last_post_time),
+ KEY topic_approved (topic_approved),
+ KEY forum_appr_last (forum_id, topic_approved, topic_last_post_id),
+ KEY fid_time_moved (forum_id, topic_last_post_time, topic_moved_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_topics_track'
+CREATE TABLE phpbb_topics_track (
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (user_id, topic_id),
+ KEY topic_id (topic_id),
+ KEY forum_id (forum_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_topics_posted'
+CREATE TABLE phpbb_topics_posted (
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ topic_posted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (user_id, topic_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_topics_watch'
+CREATE TABLE phpbb_topics_watch (
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ KEY topic_id (topic_id),
+ KEY user_id (user_id),
+ KEY notify_stat (notify_status)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_user_group'
+CREATE TABLE phpbb_user_group (
+ group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ group_leader tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ user_pending tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ KEY group_id (group_id),
+ KEY user_id (user_id),
+ KEY group_leader (group_leader)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_users'
+CREATE TABLE phpbb_users (
+ user_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ user_type tinyint(2) DEFAULT '0' NOT NULL,
+ group_id mediumint(8) UNSIGNED DEFAULT '3' NOT NULL,
+ user_permissions mediumtext NOT NULL,
+ user_perm_from mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_ip varchar(40) DEFAULT '' NOT NULL,
+ user_regdate int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ username varchar(255) DEFAULT '' NOT NULL,
+ username_clean varchar(255) DEFAULT '' NOT NULL,
+ user_password varchar(40) DEFAULT '' NOT NULL,
+ user_passchg int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_pass_convert tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ user_email varchar(100) DEFAULT '' NOT NULL,
+ user_email_hash bigint(20) DEFAULT '0' NOT NULL,
+ user_birthday varchar(10) DEFAULT '' NOT NULL,
+ user_lastvisit int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_lastmark int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_lastpost_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_lastpage varchar(200) DEFAULT '' NOT NULL,
+ user_last_confirm_key varchar(10) DEFAULT '' NOT NULL,
+ user_last_search int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_warnings tinyint(4) DEFAULT '0' NOT NULL,
+ user_last_warning int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_login_attempts tinyint(4) DEFAULT '0' NOT NULL,
+ user_inactive_reason tinyint(2) DEFAULT '0' NOT NULL,
+ user_inactive_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_lang varchar(30) DEFAULT '' NOT NULL,
+ user_timezone varchar(100) DEFAULT 'UTC' NOT NULL,
+ user_dateformat varchar(30) DEFAULT 'd M Y H:i' NOT NULL,
+ user_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_colour varchar(6) DEFAULT '' NOT NULL,
+ user_new_privmsg int(4) DEFAULT '0' NOT NULL,
+ user_unread_privmsg int(4) DEFAULT '0' NOT NULL,
+ user_last_privmsg int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_message_rules tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ user_full_folder int(11) DEFAULT '-3' NOT NULL,
+ user_emailtime int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ user_topic_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ user_topic_sortby_type varchar(1) DEFAULT 't' NOT NULL,
+ user_topic_sortby_dir varchar(1) DEFAULT 'd' NOT NULL,
+ user_post_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ user_post_sortby_type varchar(1) DEFAULT 't' NOT NULL,
+ user_post_sortby_dir varchar(1) DEFAULT 'a' NOT NULL,
+ user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ user_notify_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ user_notify_type tinyint(4) DEFAULT '0' NOT NULL,
+ user_allow_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ user_allow_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ user_allow_viewemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ user_allow_massemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ user_options int(11) UNSIGNED DEFAULT '230271' NOT NULL,
+ user_avatar varchar(255) DEFAULT '' NOT NULL,
+ user_avatar_type tinyint(2) DEFAULT '0' NOT NULL,
+ user_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ user_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
+ user_sig mediumtext NOT NULL,
+ user_sig_bbcode_uid varchar(8) DEFAULT '' NOT NULL,
+ user_sig_bbcode_bitfield varchar(255) DEFAULT '' 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 text NOT NULL,
+ user_interests text NOT NULL,
+ user_actkey varchar(32) DEFAULT '' NOT NULL,
+ user_newpasswd varchar(40) DEFAULT '' NOT NULL,
+ user_form_salt varchar(32) DEFAULT '' NOT NULL,
+ user_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ user_reminded tinyint(4) DEFAULT '0' NOT NULL,
+ user_reminded_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (user_id),
+ KEY user_birthday (user_birthday),
+ KEY user_email_hash (user_email_hash),
+ KEY user_type (user_type),
+ UNIQUE username_clean (username_clean)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_warnings'
+CREATE TABLE phpbb_warnings (
+ warning_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ log_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ warning_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (warning_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_words'
+CREATE TABLE phpbb_words (
+ word_id mediumint(8) UNSIGNED NOT NULL auto_increment,
+ word varchar(255) DEFAULT '' NOT NULL,
+ replacement varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (word_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
+
+
+# Table: 'phpbb_zebra'
+CREATE TABLE phpbb_zebra (
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ zebra_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ friend tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ foe tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ PRIMARY KEY (user_id, zebra_id)
+) CHARACTER SET `utf8` COLLATE `utf8_bin`;
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index 04155fe28b..02d8042ff7 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -1,1787 +1,1785 @@
-/*
- * DO NOT EDIT THIS FILE, IT IS GENERATED
- *
- * To change the contents of this file, edit
- * phpBB/develop/create_schema_files.php and
- * run it.
- */
-
-/*
- This first section is optional, however its probably the best method
- of running phpBB on Oracle. If you already have a tablespace and user created
- 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 before you run this script!!
-*/
-
-/*
-CREATE TABLESPACE "PHPBB"
- LOGGING
- DATAFILE 'E:\ORACLE\ORADATA\LOCAL\PHPBB.ora'
- SIZE 10M
- AUTOEXTEND ON NEXT 10M
- MAXSIZE 100M;
-
-CREATE USER "PHPBB"
- PROFILE "DEFAULT"
- IDENTIFIED BY "phpbb_password"
- DEFAULT TABLESPACE "PHPBB"
- QUOTA UNLIMITED ON "PHPBB"
- ACCOUNT UNLOCK;
-
-GRANT ANALYZE ANY TO "PHPBB";
-GRANT CREATE SEQUENCE TO "PHPBB";
-GRANT CREATE SESSION TO "PHPBB";
-GRANT CREATE TABLE TO "PHPBB";
-GRANT CREATE TRIGGER TO "PHPBB";
-GRANT CREATE VIEW TO "PHPBB";
-GRANT "CONNECT" TO "PHPBB";
-
-COMMIT;
-DISCONNECT;
-
-CONNECT phpbb/phpbb_password;
-*/
-/*
- Table: 'phpbb_attachments'
-*/
-CREATE TABLE phpbb_attachments (
- attach_id number(8) NOT NULL,
- post_msg_id number(8) DEFAULT '0' NOT NULL,
- topic_id number(8) DEFAULT '0' NOT NULL,
- in_message number(1) DEFAULT '0' NOT NULL,
- poster_id number(8) DEFAULT '0' NOT NULL,
- is_orphan number(1) DEFAULT '1' NOT NULL,
- physical_filename varchar2(255) DEFAULT '' ,
- real_filename varchar2(255) DEFAULT '' ,
- download_count number(8) DEFAULT '0' NOT NULL,
- attach_comment clob DEFAULT '' ,
- extension varchar2(100) DEFAULT '' ,
- mimetype varchar2(100) DEFAULT '' ,
- filesize number(20) DEFAULT '0' NOT NULL,
- filetime number(11) DEFAULT '0' NOT NULL,
- thumbnail number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_attachments PRIMARY KEY (attach_id)
-)
-/
-
-CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments (filetime)
-/
-CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments (post_msg_id)
-/
-CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments (topic_id)
-/
-CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id)
-/
-CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments (is_orphan)
-/
-
-CREATE SEQUENCE phpbb_attachments_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_attachments
-BEFORE INSERT ON phpbb_attachments
-FOR EACH ROW WHEN (
- new.attach_id IS NULL OR new.attach_id = 0
-)
-BEGIN
- SELECT phpbb_attachments_seq.nextval
- INTO :new.attach_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_acl_groups'
-*/
-CREATE TABLE phpbb_acl_groups (
- group_id number(8) DEFAULT '0' NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- auth_option_id number(8) DEFAULT '0' NOT NULL,
- auth_role_id number(8) DEFAULT '0' NOT NULL,
- auth_setting number(2) DEFAULT '0' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups (group_id)
-/
-CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups (auth_option_id)
-/
-CREATE INDEX phpbb_acl_groups_auth_role_id ON phpbb_acl_groups (auth_role_id)
-/
-
-/*
- Table: 'phpbb_acl_options'
-*/
-CREATE TABLE phpbb_acl_options (
- auth_option_id number(8) NOT NULL,
- auth_option varchar2(50) DEFAULT '' ,
- is_global number(1) DEFAULT '0' NOT NULL,
- is_local number(1) DEFAULT '0' NOT NULL,
- founder_only number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_acl_options PRIMARY KEY (auth_option_id),
- CONSTRAINT u_phpbb_auth_option UNIQUE (auth_option)
-)
-/
-
-
-CREATE SEQUENCE phpbb_acl_options_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_acl_options
-BEFORE INSERT ON phpbb_acl_options
-FOR EACH ROW WHEN (
- new.auth_option_id IS NULL OR new.auth_option_id = 0
-)
-BEGIN
- SELECT phpbb_acl_options_seq.nextval
- INTO :new.auth_option_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_acl_roles'
-*/
-CREATE TABLE phpbb_acl_roles (
- role_id number(8) NOT NULL,
- role_name varchar2(765) DEFAULT '' ,
- role_description clob DEFAULT '' ,
- role_type varchar2(10) DEFAULT '' ,
- role_order number(4) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_acl_roles PRIMARY KEY (role_id)
-)
-/
-
-CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles (role_type)
-/
-CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles (role_order)
-/
-
-CREATE SEQUENCE phpbb_acl_roles_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_acl_roles
-BEFORE INSERT ON phpbb_acl_roles
-FOR EACH ROW WHEN (
- new.role_id IS NULL OR new.role_id = 0
-)
-BEGIN
- SELECT phpbb_acl_roles_seq.nextval
- INTO :new.role_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_acl_roles_data'
-*/
-CREATE TABLE phpbb_acl_roles_data (
- role_id number(8) DEFAULT '0' NOT NULL,
- auth_option_id number(8) DEFAULT '0' NOT NULL,
- auth_setting number(2) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_acl_roles_data PRIMARY KEY (role_id, auth_option_id)
-)
-/
-
-CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id)
-/
-
-/*
- Table: 'phpbb_acl_users'
-*/
-CREATE TABLE phpbb_acl_users (
- user_id number(8) DEFAULT '0' NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- auth_option_id number(8) DEFAULT '0' NOT NULL,
- auth_role_id number(8) DEFAULT '0' NOT NULL,
- auth_setting number(2) DEFAULT '0' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users (user_id)
-/
-CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users (auth_option_id)
-/
-CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id)
-/
-
-/*
- Table: 'phpbb_banlist'
-*/
-CREATE TABLE phpbb_banlist (
- ban_id number(8) NOT NULL,
- ban_userid number(8) DEFAULT '0' NOT NULL,
- ban_ip varchar2(40) DEFAULT '' ,
- ban_email varchar2(300) DEFAULT '' ,
- ban_start number(11) DEFAULT '0' NOT NULL,
- ban_end number(11) DEFAULT '0' NOT NULL,
- ban_exclude number(1) DEFAULT '0' NOT NULL,
- ban_reason varchar2(765) DEFAULT '' ,
- ban_give_reason varchar2(765) DEFAULT '' ,
- CONSTRAINT pk_phpbb_banlist PRIMARY KEY (ban_id)
-)
-/
-
-CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end)
-/
-CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist (ban_userid, ban_exclude)
-/
-CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist (ban_email, ban_exclude)
-/
-CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist (ban_ip, ban_exclude)
-/
-
-CREATE SEQUENCE phpbb_banlist_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_banlist
-BEFORE INSERT ON phpbb_banlist
-FOR EACH ROW WHEN (
- new.ban_id IS NULL OR new.ban_id = 0
-)
-BEGIN
- SELECT phpbb_banlist_seq.nextval
- INTO :new.ban_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_bbcodes'
-*/
-CREATE TABLE phpbb_bbcodes (
- bbcode_id number(4) DEFAULT '0' NOT NULL,
- bbcode_tag varchar2(16) DEFAULT '' ,
- bbcode_helpline varchar2(765) DEFAULT '' ,
- display_on_posting number(1) DEFAULT '0' NOT NULL,
- bbcode_match clob DEFAULT '' ,
- bbcode_tpl clob DEFAULT '' ,
- first_pass_match clob DEFAULT '' ,
- first_pass_replace clob DEFAULT '' ,
- second_pass_match clob DEFAULT '' ,
- second_pass_replace clob DEFAULT '' ,
- CONSTRAINT pk_phpbb_bbcodes PRIMARY KEY (bbcode_id)
-)
-/
-
-CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting)
-/
-
-/*
- Table: 'phpbb_bookmarks'
-*/
-CREATE TABLE phpbb_bookmarks (
- topic_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_bookmarks PRIMARY KEY (topic_id, user_id)
-)
-/
-
-
-/*
- Table: 'phpbb_bots'
-*/
-CREATE TABLE phpbb_bots (
- bot_id number(8) NOT NULL,
- bot_active number(1) DEFAULT '1' NOT NULL,
- bot_name varchar2(765) DEFAULT '' ,
- user_id number(8) DEFAULT '0' NOT NULL,
- bot_agent varchar2(255) DEFAULT '' ,
- bot_ip varchar2(255) DEFAULT '' ,
- CONSTRAINT pk_phpbb_bots PRIMARY KEY (bot_id)
-)
-/
-
-CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active)
-/
-
-CREATE SEQUENCE phpbb_bots_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_bots
-BEFORE INSERT ON phpbb_bots
-FOR EACH ROW WHEN (
- new.bot_id IS NULL OR new.bot_id = 0
-)
-BEGIN
- SELECT phpbb_bots_seq.nextval
- INTO :new.bot_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_config'
-*/
-CREATE TABLE phpbb_config (
- config_name varchar2(255) DEFAULT '' ,
- config_value varchar2(765) DEFAULT '' ,
- is_dynamic number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_config PRIMARY KEY (config_name)
-)
-/
-
-CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic)
-/
-
-/*
- Table: 'phpbb_confirm'
-*/
-CREATE TABLE phpbb_confirm (
- confirm_id char(32) DEFAULT '' ,
- session_id char(32) DEFAULT '' ,
- confirm_type number(3) DEFAULT '0' NOT NULL,
- code varchar2(8) DEFAULT '' ,
- seed number(10) DEFAULT '0' NOT NULL,
- attempts number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_confirm PRIMARY KEY (session_id, confirm_id)
-)
-/
-
-CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm (confirm_type)
-/
-
-/*
- Table: 'phpbb_disallow'
-*/
-CREATE TABLE phpbb_disallow (
- disallow_id number(8) NOT NULL,
- disallow_username varchar2(765) DEFAULT '' ,
- CONSTRAINT pk_phpbb_disallow PRIMARY KEY (disallow_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_disallow_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_disallow
-BEFORE INSERT ON phpbb_disallow
-FOR EACH ROW WHEN (
- new.disallow_id IS NULL OR new.disallow_id = 0
-)
-BEGIN
- SELECT phpbb_disallow_seq.nextval
- INTO :new.disallow_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_drafts'
-*/
-CREATE TABLE phpbb_drafts (
- draft_id number(8) NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- topic_id number(8) DEFAULT '0' NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- save_time number(11) DEFAULT '0' NOT NULL,
- draft_subject varchar2(765) DEFAULT '' ,
- draft_message clob DEFAULT '' ,
- CONSTRAINT pk_phpbb_drafts PRIMARY KEY (draft_id)
-)
-/
-
-CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time)
-/
-
-CREATE SEQUENCE phpbb_drafts_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_drafts
-BEFORE INSERT ON phpbb_drafts
-FOR EACH ROW WHEN (
- new.draft_id IS NULL OR new.draft_id = 0
-)
-BEGIN
- SELECT phpbb_drafts_seq.nextval
- INTO :new.draft_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_ext'
-*/
-CREATE TABLE phpbb_ext (
- ext_name varchar2(255) DEFAULT '' ,
- ext_active number(1) DEFAULT '0' NOT NULL,
- ext_state clob DEFAULT '' ,
- CONSTRAINT u_phpbb_ext_name UNIQUE (ext_name)
-)
-/
-
-
-/*
- Table: 'phpbb_extensions'
-*/
-CREATE TABLE phpbb_extensions (
- extension_id number(8) NOT NULL,
- group_id number(8) DEFAULT '0' NOT NULL,
- extension varchar2(100) DEFAULT '' ,
- CONSTRAINT pk_phpbb_extensions PRIMARY KEY (extension_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_extensions_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_extensions
-BEFORE INSERT ON phpbb_extensions
-FOR EACH ROW WHEN (
- new.extension_id IS NULL OR new.extension_id = 0
-)
-BEGIN
- SELECT phpbb_extensions_seq.nextval
- INTO :new.extension_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_extension_groups'
-*/
-CREATE TABLE phpbb_extension_groups (
- group_id number(8) NOT NULL,
- group_name varchar2(765) DEFAULT '' ,
- cat_id number(2) DEFAULT '0' NOT NULL,
- allow_group number(1) DEFAULT '0' NOT NULL,
- download_mode number(1) DEFAULT '1' NOT NULL,
- upload_icon varchar2(255) DEFAULT '' ,
- max_filesize number(20) DEFAULT '0' NOT NULL,
- allowed_forums clob DEFAULT '' ,
- allow_in_pm number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_extension_groups PRIMARY KEY (group_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_extension_groups_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_extension_groups
-BEFORE INSERT ON phpbb_extension_groups
-FOR EACH ROW WHEN (
- new.group_id IS NULL OR new.group_id = 0
-)
-BEGIN
- SELECT phpbb_extension_groups_seq.nextval
- INTO :new.group_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_forums'
-*/
-CREATE TABLE phpbb_forums (
- forum_id number(8) NOT NULL,
- parent_id number(8) DEFAULT '0' NOT NULL,
- left_id number(8) DEFAULT '0' NOT NULL,
- right_id number(8) DEFAULT '0' NOT NULL,
- forum_parents clob DEFAULT '' ,
- forum_name varchar2(765) DEFAULT '' ,
- forum_desc clob DEFAULT '' ,
- forum_desc_bitfield varchar2(255) DEFAULT '' ,
- forum_desc_options number(11) DEFAULT '7' NOT NULL,
- forum_desc_uid varchar2(8) DEFAULT '' ,
- forum_link varchar2(765) DEFAULT '' ,
- forum_password varchar2(120) DEFAULT '' ,
- forum_style number(8) DEFAULT '0' NOT NULL,
- forum_image varchar2(255) DEFAULT '' ,
- forum_rules clob DEFAULT '' ,
- forum_rules_link varchar2(765) DEFAULT '' ,
- forum_rules_bitfield varchar2(255) DEFAULT '' ,
- forum_rules_options number(11) DEFAULT '7' NOT NULL,
- forum_rules_uid varchar2(8) DEFAULT '' ,
- forum_topics_per_page number(4) DEFAULT '0' NOT NULL,
- forum_type number(4) DEFAULT '0' NOT NULL,
- forum_status number(4) DEFAULT '0' NOT NULL,
- forum_posts number(8) DEFAULT '0' NOT NULL,
- forum_topics number(8) DEFAULT '0' NOT NULL,
- forum_topics_real number(8) DEFAULT '0' NOT NULL,
- forum_last_post_id number(8) DEFAULT '0' NOT NULL,
- forum_last_poster_id number(8) DEFAULT '0' NOT NULL,
- forum_last_post_subject varchar2(765) DEFAULT '' ,
- forum_last_post_time number(11) DEFAULT '0' NOT NULL,
- forum_last_poster_name varchar2(765) DEFAULT '' ,
- forum_last_poster_colour varchar2(6) DEFAULT '' ,
- forum_flags number(4) DEFAULT '32' NOT NULL,
- forum_options number(20) DEFAULT '0' NOT NULL,
- display_subforum_list number(1) DEFAULT '1' NOT NULL,
- display_on_index number(1) DEFAULT '1' NOT NULL,
- enable_indexing number(1) DEFAULT '1' NOT NULL,
- enable_icons number(1) DEFAULT '1' NOT NULL,
- enable_prune number(1) DEFAULT '0' NOT NULL,
- prune_next number(11) DEFAULT '0' NOT NULL,
- prune_days number(8) DEFAULT '0' NOT NULL,
- prune_viewed number(8) DEFAULT '0' NOT NULL,
- prune_freq number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_forums PRIMARY KEY (forum_id)
-)
-/
-
-CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums (left_id, right_id)
-/
-CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums (forum_last_post_id)
-/
-
-CREATE SEQUENCE phpbb_forums_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_forums
-BEFORE INSERT ON phpbb_forums
-FOR EACH ROW WHEN (
- new.forum_id IS NULL OR new.forum_id = 0
-)
-BEGIN
- SELECT phpbb_forums_seq.nextval
- INTO :new.forum_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_forums_access'
-*/
-CREATE TABLE phpbb_forums_access (
- forum_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- session_id char(32) DEFAULT '' ,
- CONSTRAINT pk_phpbb_forums_access PRIMARY KEY (forum_id, user_id, session_id)
-)
-/
-
-
-/*
- Table: 'phpbb_forums_track'
-*/
-CREATE TABLE phpbb_forums_track (
- user_id number(8) DEFAULT '0' NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- mark_time number(11) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_forums_track PRIMARY KEY (user_id, forum_id)
-)
-/
-
-
-/*
- Table: 'phpbb_forums_watch'
-*/
-CREATE TABLE phpbb_forums_watch (
- forum_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- notify_status number(1) DEFAULT '0' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch (forum_id)
-/
-CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch (user_id)
-/
-CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch (notify_status)
-/
-
-/*
- Table: 'phpbb_groups'
-*/
-CREATE TABLE phpbb_groups (
- group_id number(8) NOT NULL,
- group_type number(4) DEFAULT '1' NOT NULL,
- group_founder_manage number(1) DEFAULT '0' NOT NULL,
- group_skip_auth number(1) DEFAULT '0' NOT NULL,
- group_name varchar2(255) DEFAULT '' ,
- group_desc clob DEFAULT '' ,
- group_desc_bitfield varchar2(255) DEFAULT '' ,
- group_desc_options number(11) DEFAULT '7' NOT NULL,
- group_desc_uid varchar2(8) DEFAULT '' ,
- group_display number(1) DEFAULT '0' NOT NULL,
- group_avatar varchar2(255) DEFAULT '' ,
- group_avatar_type number(2) DEFAULT '0' NOT NULL,
- group_avatar_width number(4) DEFAULT '0' NOT NULL,
- group_avatar_height number(4) DEFAULT '0' NOT NULL,
- group_rank number(8) DEFAULT '0' NOT NULL,
- group_colour varchar2(6) DEFAULT '' ,
- group_sig_chars number(8) DEFAULT '0' NOT NULL,
- group_receive_pm number(1) DEFAULT '0' NOT NULL,
- group_message_limit number(8) DEFAULT '0' NOT NULL,
- group_max_recipients number(8) DEFAULT '0' NOT NULL,
- group_legend number(8) DEFAULT '0' NOT NULL,
- group_teampage number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_groups PRIMARY KEY (group_id)
-)
-/
-
-CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name)
-/
-
-CREATE SEQUENCE phpbb_groups_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_groups
-BEFORE INSERT ON phpbb_groups
-FOR EACH ROW WHEN (
- new.group_id IS NULL OR new.group_id = 0
-)
-BEGIN
- SELECT phpbb_groups_seq.nextval
- INTO :new.group_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_icons'
-*/
-CREATE TABLE phpbb_icons (
- icons_id number(8) NOT NULL,
- icons_url varchar2(255) DEFAULT '' ,
- icons_width number(4) DEFAULT '0' NOT NULL,
- icons_height number(4) DEFAULT '0' NOT NULL,
- icons_order number(8) DEFAULT '0' NOT NULL,
- display_on_posting number(1) DEFAULT '1' NOT NULL,
- CONSTRAINT pk_phpbb_icons PRIMARY KEY (icons_id)
-)
-/
-
-CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons (display_on_posting)
-/
-
-CREATE SEQUENCE phpbb_icons_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_icons
-BEFORE INSERT ON phpbb_icons
-FOR EACH ROW WHEN (
- new.icons_id IS NULL OR new.icons_id = 0
-)
-BEGIN
- SELECT phpbb_icons_seq.nextval
- INTO :new.icons_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_lang'
-*/
-CREATE TABLE phpbb_lang (
- lang_id number(4) NOT NULL,
- lang_iso varchar2(30) DEFAULT '' ,
- lang_dir varchar2(30) DEFAULT '' ,
- lang_english_name varchar2(300) DEFAULT '' ,
- lang_local_name varchar2(765) DEFAULT '' ,
- lang_author varchar2(765) DEFAULT '' ,
- CONSTRAINT pk_phpbb_lang PRIMARY KEY (lang_id)
-)
-/
-
-CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang (lang_iso)
-/
-
-CREATE SEQUENCE phpbb_lang_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_lang
-BEFORE INSERT ON phpbb_lang
-FOR EACH ROW WHEN (
- new.lang_id IS NULL OR new.lang_id = 0
-)
-BEGIN
- SELECT phpbb_lang_seq.nextval
- INTO :new.lang_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_log'
-*/
-CREATE TABLE phpbb_log (
- log_id number(8) NOT NULL,
- log_type number(4) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- topic_id number(8) DEFAULT '0' NOT NULL,
- reportee_id number(8) DEFAULT '0' NOT NULL,
- log_ip varchar2(40) DEFAULT '' ,
- log_time number(11) DEFAULT '0' NOT NULL,
- log_operation clob DEFAULT '' ,
- log_data clob DEFAULT '' ,
- CONSTRAINT pk_phpbb_log PRIMARY KEY (log_id)
-)
-/
-
-CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type)
-/
-CREATE INDEX phpbb_log_log_time ON phpbb_log (log_time)
-/
-CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id)
-/
-CREATE INDEX phpbb_log_topic_id ON phpbb_log (topic_id)
-/
-CREATE INDEX phpbb_log_reportee_id ON phpbb_log (reportee_id)
-/
-CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id)
-/
-
-CREATE SEQUENCE phpbb_log_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_log
-BEFORE INSERT ON phpbb_log
-FOR EACH ROW WHEN (
- new.log_id IS NULL OR new.log_id = 0
-)
-BEGIN
- SELECT phpbb_log_seq.nextval
- INTO :new.log_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_login_attempts'
-*/
-CREATE TABLE phpbb_login_attempts (
- attempt_ip varchar2(40) DEFAULT '' ,
- attempt_browser varchar2(150) DEFAULT '' ,
- attempt_forwarded_for varchar2(255) DEFAULT '' ,
- attempt_time number(11) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- username varchar2(765) DEFAULT '0' NOT NULL,
- username_clean varchar2(255) DEFAULT '0' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts (attempt_ip, attempt_time)
-/
-CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts (attempt_forwarded_for, attempt_time)
-/
-CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts (attempt_time)
-/
-CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts (user_id)
-/
-
-/*
- Table: 'phpbb_moderator_cache'
-*/
-CREATE TABLE phpbb_moderator_cache (
- forum_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- username varchar2(765) DEFAULT '' ,
- group_id number(8) DEFAULT '0' NOT NULL,
- group_name varchar2(765) DEFAULT '' ,
- display_on_index number(1) DEFAULT '1' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache (display_on_index)
-/
-CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache (forum_id)
-/
-
-/*
- Table: 'phpbb_modules'
-*/
-CREATE TABLE phpbb_modules (
- module_id number(8) NOT NULL,
- module_enabled number(1) DEFAULT '1' NOT NULL,
- module_display number(1) DEFAULT '1' NOT NULL,
- module_basename varchar2(255) DEFAULT '' ,
- module_class varchar2(10) DEFAULT '' ,
- parent_id number(8) DEFAULT '0' NOT NULL,
- left_id number(8) DEFAULT '0' NOT NULL,
- right_id number(8) DEFAULT '0' NOT NULL,
- module_langname varchar2(255) DEFAULT '' ,
- module_mode varchar2(255) DEFAULT '' ,
- module_auth varchar2(255) DEFAULT '' ,
- CONSTRAINT pk_phpbb_modules PRIMARY KEY (module_id)
-)
-/
-
-CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id)
-/
-CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled)
-/
-CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id)
-/
-
-CREATE SEQUENCE phpbb_modules_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_modules
-BEFORE INSERT ON phpbb_modules
-FOR EACH ROW WHEN (
- new.module_id IS NULL OR new.module_id = 0
-)
-BEGIN
- SELECT phpbb_modules_seq.nextval
- INTO :new.module_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_poll_options'
-*/
-CREATE TABLE phpbb_poll_options (
- poll_option_id number(4) DEFAULT '0' NOT NULL,
- topic_id number(8) DEFAULT '0' NOT NULL,
- poll_option_text clob DEFAULT '' ,
- poll_option_total number(8) DEFAULT '0' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options (poll_option_id)
-/
-CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options (topic_id)
-/
-
-/*
- Table: 'phpbb_poll_votes'
-*/
-CREATE TABLE phpbb_poll_votes (
- topic_id number(8) DEFAULT '0' NOT NULL,
- poll_option_id number(4) DEFAULT '0' NOT NULL,
- vote_user_id number(8) DEFAULT '0' NOT NULL,
- vote_user_ip varchar2(40) DEFAULT ''
-)
-/
-
-CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes (topic_id)
-/
-CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes (vote_user_id)
-/
-CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes (vote_user_ip)
-/
-
-/*
- Table: 'phpbb_posts'
-*/
-CREATE TABLE phpbb_posts (
- post_id number(8) NOT NULL,
- topic_id number(8) DEFAULT '0' NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- poster_id number(8) DEFAULT '0' NOT NULL,
- icon_id number(8) DEFAULT '0' NOT NULL,
- poster_ip varchar2(40) DEFAULT '' ,
- post_time number(11) DEFAULT '0' NOT NULL,
- post_approved number(1) DEFAULT '1' NOT NULL,
- post_reported number(1) DEFAULT '0' NOT NULL,
- enable_bbcode number(1) DEFAULT '1' NOT NULL,
- enable_smilies number(1) DEFAULT '1' NOT NULL,
- enable_magic_url number(1) DEFAULT '1' NOT NULL,
- enable_sig number(1) DEFAULT '1' NOT NULL,
- post_username varchar2(765) DEFAULT '' ,
- post_subject varchar2(765) DEFAULT '' ,
- post_text clob DEFAULT '' ,
- post_checksum varchar2(32) DEFAULT '' ,
- post_attachment number(1) DEFAULT '0' NOT NULL,
- bbcode_bitfield varchar2(255) DEFAULT '' ,
- bbcode_uid varchar2(8) DEFAULT '' ,
- post_postcount number(1) DEFAULT '1' NOT NULL,
- post_edit_time number(11) DEFAULT '0' NOT NULL,
- post_edit_reason varchar2(765) DEFAULT '' ,
- post_edit_user number(8) DEFAULT '0' NOT NULL,
- post_edit_count number(4) DEFAULT '0' NOT NULL,
- post_edit_locked number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_posts PRIMARY KEY (post_id)
-)
-/
-
-CREATE INDEX phpbb_posts_forum_id ON phpbb_posts (forum_id)
-/
-CREATE INDEX phpbb_posts_topic_id ON phpbb_posts (topic_id)
-/
-CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip)
-/
-CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id)
-/
-CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved)
-/
-CREATE INDEX phpbb_posts_post_username ON phpbb_posts (post_username)
-/
-CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time)
-/
-
-CREATE SEQUENCE phpbb_posts_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_posts
-BEFORE INSERT ON phpbb_posts
-FOR EACH ROW WHEN (
- new.post_id IS NULL OR new.post_id = 0
-)
-BEGIN
- SELECT phpbb_posts_seq.nextval
- INTO :new.post_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_privmsgs'
-*/
-CREATE TABLE phpbb_privmsgs (
- msg_id number(8) NOT NULL,
- root_level number(8) DEFAULT '0' NOT NULL,
- author_id number(8) DEFAULT '0' NOT NULL,
- icon_id number(8) DEFAULT '0' NOT NULL,
- author_ip varchar2(40) DEFAULT '' ,
- message_time number(11) DEFAULT '0' NOT NULL,
- enable_bbcode number(1) DEFAULT '1' NOT NULL,
- enable_smilies number(1) DEFAULT '1' NOT NULL,
- enable_magic_url number(1) DEFAULT '1' NOT NULL,
- enable_sig number(1) DEFAULT '1' NOT NULL,
- message_subject varchar2(765) DEFAULT '' ,
- message_text clob DEFAULT '' ,
- message_edit_reason varchar2(765) DEFAULT '' ,
- message_edit_user number(8) DEFAULT '0' NOT NULL,
- message_attachment number(1) DEFAULT '0' NOT NULL,
- bbcode_bitfield varchar2(255) DEFAULT '' ,
- bbcode_uid varchar2(8) DEFAULT '' ,
- message_edit_time number(11) DEFAULT '0' NOT NULL,
- message_edit_count number(4) DEFAULT '0' NOT NULL,
- to_address clob DEFAULT '' ,
- bcc_address clob DEFAULT '' ,
- message_reported number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_privmsgs PRIMARY KEY (msg_id)
-)
-/
-
-CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs (author_ip)
-/
-CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs (message_time)
-/
-CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs (author_id)
-/
-CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs (root_level)
-/
-
-CREATE SEQUENCE phpbb_privmsgs_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_privmsgs
-BEFORE INSERT ON phpbb_privmsgs
-FOR EACH ROW WHEN (
- new.msg_id IS NULL OR new.msg_id = 0
-)
-BEGIN
- SELECT phpbb_privmsgs_seq.nextval
- INTO :new.msg_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_privmsgs_folder'
-*/
-CREATE TABLE phpbb_privmsgs_folder (
- folder_id number(8) NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- folder_name varchar2(765) DEFAULT '' ,
- pm_count number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_privmsgs_folder PRIMARY KEY (folder_id)
-)
-/
-
-CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id)
-/
-
-CREATE SEQUENCE phpbb_privmsgs_folder_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_privmsgs_folder
-BEFORE INSERT ON phpbb_privmsgs_folder
-FOR EACH ROW WHEN (
- new.folder_id IS NULL OR new.folder_id = 0
-)
-BEGIN
- SELECT phpbb_privmsgs_folder_seq.nextval
- INTO :new.folder_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_privmsgs_rules'
-*/
-CREATE TABLE phpbb_privmsgs_rules (
- rule_id number(8) NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- rule_check number(8) DEFAULT '0' NOT NULL,
- rule_connection number(8) DEFAULT '0' NOT NULL,
- rule_string varchar2(765) DEFAULT '' ,
- rule_user_id number(8) DEFAULT '0' NOT NULL,
- rule_group_id number(8) DEFAULT '0' NOT NULL,
- rule_action number(8) DEFAULT '0' NOT NULL,
- rule_folder_id number(11) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_privmsgs_rules PRIMARY KEY (rule_id)
-)
-/
-
-CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules (user_id)
-/
-
-CREATE SEQUENCE phpbb_privmsgs_rules_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_privmsgs_rules
-BEFORE INSERT ON phpbb_privmsgs_rules
-FOR EACH ROW WHEN (
- new.rule_id IS NULL OR new.rule_id = 0
-)
-BEGIN
- SELECT phpbb_privmsgs_rules_seq.nextval
- INTO :new.rule_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_privmsgs_to'
-*/
-CREATE TABLE phpbb_privmsgs_to (
- msg_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- author_id number(8) DEFAULT '0' NOT NULL,
- pm_deleted number(1) DEFAULT '0' NOT NULL,
- pm_new number(1) DEFAULT '1' NOT NULL,
- pm_unread number(1) DEFAULT '1' NOT NULL,
- pm_replied number(1) DEFAULT '0' NOT NULL,
- pm_marked number(1) DEFAULT '0' NOT NULL,
- pm_forwarded number(1) DEFAULT '0' NOT NULL,
- folder_id number(11) DEFAULT '0' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id)
-/
-CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to (author_id)
-/
-CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folder_id)
-/
-
-/*
- Table: 'phpbb_profile_fields'
-*/
-CREATE TABLE phpbb_profile_fields (
- field_id number(8) NOT NULL,
- field_name varchar2(765) DEFAULT '' ,
- field_type number(4) DEFAULT '0' NOT NULL,
- field_ident varchar2(20) DEFAULT '' ,
- field_length varchar2(20) DEFAULT '' ,
- field_minlen varchar2(255) DEFAULT '' ,
- field_maxlen varchar2(255) DEFAULT '' ,
- field_novalue varchar2(765) DEFAULT '' ,
- field_default_value varchar2(765) DEFAULT '' ,
- field_validation varchar2(60) DEFAULT '' ,
- field_required number(1) DEFAULT '0' NOT NULL,
- field_show_novalue number(1) DEFAULT '0' NOT NULL,
- field_show_on_reg number(1) DEFAULT '0' NOT NULL,
- field_show_on_pm number(1) DEFAULT '0' NOT NULL,
- field_show_on_vt number(1) DEFAULT '0' NOT NULL,
- field_show_profile number(1) DEFAULT '0' NOT NULL,
- field_hide number(1) DEFAULT '0' NOT NULL,
- field_no_view number(1) DEFAULT '0' NOT NULL,
- field_active number(1) DEFAULT '0' NOT NULL,
- field_order number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_profile_fields PRIMARY KEY (field_id)
-)
-/
-
-CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields (field_type)
-/
-CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields (field_order)
-/
-
-CREATE SEQUENCE phpbb_profile_fields_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_profile_fields
-BEFORE INSERT ON phpbb_profile_fields
-FOR EACH ROW WHEN (
- new.field_id IS NULL OR new.field_id = 0
-)
-BEGIN
- SELECT phpbb_profile_fields_seq.nextval
- INTO :new.field_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_profile_fields_data'
-*/
-CREATE TABLE phpbb_profile_fields_data (
- user_id number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_profile_fields_data PRIMARY KEY (user_id)
-)
-/
-
-
-/*
- Table: 'phpbb_profile_fields_lang'
-*/
-CREATE TABLE phpbb_profile_fields_lang (
- field_id number(8) DEFAULT '0' NOT NULL,
- lang_id number(8) DEFAULT '0' NOT NULL,
- option_id number(8) DEFAULT '0' NOT NULL,
- field_type number(4) DEFAULT '0' NOT NULL,
- lang_value varchar2(765) DEFAULT '' ,
- CONSTRAINT pk_phpbb_profile_fields_lang PRIMARY KEY (field_id, lang_id, option_id)
-)
-/
-
-
-/*
- Table: 'phpbb_profile_lang'
-*/
-CREATE TABLE phpbb_profile_lang (
- field_id number(8) DEFAULT '0' NOT NULL,
- lang_id number(8) DEFAULT '0' NOT NULL,
- lang_name varchar2(765) DEFAULT '' ,
- lang_explain clob DEFAULT '' ,
- lang_default_value varchar2(765) DEFAULT '' ,
- CONSTRAINT pk_phpbb_profile_lang PRIMARY KEY (field_id, lang_id)
-)
-/
-
-
-/*
- Table: 'phpbb_ranks'
-*/
-CREATE TABLE phpbb_ranks (
- rank_id number(8) NOT NULL,
- rank_title varchar2(765) DEFAULT '' ,
- rank_min number(8) DEFAULT '0' NOT NULL,
- rank_special number(1) DEFAULT '0' NOT NULL,
- rank_image varchar2(255) DEFAULT '' ,
- CONSTRAINT pk_phpbb_ranks PRIMARY KEY (rank_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_ranks_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_ranks
-BEFORE INSERT ON phpbb_ranks
-FOR EACH ROW WHEN (
- new.rank_id IS NULL OR new.rank_id = 0
-)
-BEGIN
- SELECT phpbb_ranks_seq.nextval
- INTO :new.rank_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_reports'
-*/
-CREATE TABLE phpbb_reports (
- report_id number(8) NOT NULL,
- reason_id number(4) DEFAULT '0' NOT NULL,
- post_id number(8) DEFAULT '0' NOT NULL,
- pm_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- user_notify number(1) DEFAULT '0' NOT NULL,
- report_closed number(1) DEFAULT '0' NOT NULL,
- report_time number(11) DEFAULT '0' NOT NULL,
- report_text clob DEFAULT '' ,
- reported_post_text clob DEFAULT '' ,
- CONSTRAINT pk_phpbb_reports PRIMARY KEY (report_id)
-)
-/
-
-CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id)
-/
-CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id)
-/
-
-CREATE SEQUENCE phpbb_reports_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_reports
-BEFORE INSERT ON phpbb_reports
-FOR EACH ROW WHEN (
- new.report_id IS NULL OR new.report_id = 0
-)
-BEGIN
- SELECT phpbb_reports_seq.nextval
- INTO :new.report_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_reports_reasons'
-*/
-CREATE TABLE phpbb_reports_reasons (
- reason_id number(4) NOT NULL,
- reason_title varchar2(765) DEFAULT '' ,
- reason_description clob DEFAULT '' ,
- reason_order number(4) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_reports_reasons PRIMARY KEY (reason_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_reports_reasons_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_reports_reasons
-BEFORE INSERT ON phpbb_reports_reasons
-FOR EACH ROW WHEN (
- new.reason_id IS NULL OR new.reason_id = 0
-)
-BEGIN
- SELECT phpbb_reports_reasons_seq.nextval
- INTO :new.reason_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_search_results'
-*/
-CREATE TABLE phpbb_search_results (
- search_key varchar2(32) DEFAULT '' ,
- search_time number(11) DEFAULT '0' NOT NULL,
- search_keywords clob DEFAULT '' ,
- search_authors clob DEFAULT '' ,
- CONSTRAINT pk_phpbb_search_results PRIMARY KEY (search_key)
-)
-/
-
-
-/*
- Table: 'phpbb_search_wordlist'
-*/
-CREATE TABLE phpbb_search_wordlist (
- word_id number(8) NOT NULL,
- word_text varchar2(765) DEFAULT '' ,
- word_common number(1) DEFAULT '0' NOT NULL,
- word_count number(8) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_search_wordlist PRIMARY KEY (word_id),
- CONSTRAINT u_phpbb_wrd_txt UNIQUE (word_text)
-)
-/
-
-CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist (word_count)
-/
-
-CREATE SEQUENCE phpbb_search_wordlist_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_search_wordlist
-BEFORE INSERT ON phpbb_search_wordlist
-FOR EACH ROW WHEN (
- new.word_id IS NULL OR new.word_id = 0
-)
-BEGIN
- SELECT phpbb_search_wordlist_seq.nextval
- INTO :new.word_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_search_wordmatch'
-*/
-CREATE TABLE phpbb_search_wordmatch (
- post_id number(8) DEFAULT '0' NOT NULL,
- word_id number(8) DEFAULT '0' NOT NULL,
- title_match number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT u_phpbb_unq_mtch UNIQUE (word_id, post_id, title_match)
-)
-/
-
-CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id)
-/
-CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id)
-/
-
-/*
- Table: 'phpbb_sessions'
-*/
-CREATE TABLE phpbb_sessions (
- session_id char(32) DEFAULT '' ,
- session_user_id number(8) DEFAULT '0' NOT NULL,
- session_forum_id number(8) DEFAULT '0' NOT NULL,
- session_last_visit number(11) DEFAULT '0' NOT NULL,
- session_start number(11) DEFAULT '0' NOT NULL,
- session_time number(11) DEFAULT '0' NOT NULL,
- session_ip varchar2(40) DEFAULT '' ,
- session_browser varchar2(150) DEFAULT '' ,
- session_forwarded_for varchar2(255) DEFAULT '' ,
- session_page varchar2(765) DEFAULT '' ,
- session_viewonline number(1) DEFAULT '1' NOT NULL,
- session_autologin number(1) DEFAULT '0' NOT NULL,
- session_admin number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_sessions PRIMARY KEY (session_id)
-)
-/
-
-CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions (session_time)
-/
-CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions (session_user_id)
-/
-CREATE INDEX phpbb_sessions_session_fid ON phpbb_sessions (session_forum_id)
-/
-
-/*
- Table: 'phpbb_sessions_keys'
-*/
-CREATE TABLE phpbb_sessions_keys (
- key_id char(32) DEFAULT '' ,
- user_id number(8) DEFAULT '0' NOT NULL,
- last_ip varchar2(40) DEFAULT '' ,
- last_login number(11) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_sessions_keys PRIMARY KEY (key_id, user_id)
-)
-/
-
-CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login)
-/
-
-/*
- Table: 'phpbb_sitelist'
-*/
-CREATE TABLE phpbb_sitelist (
- site_id number(8) NOT NULL,
- site_ip varchar2(40) DEFAULT '' ,
- site_hostname varchar2(255) DEFAULT '' ,
- ip_exclude number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_sitelist PRIMARY KEY (site_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_sitelist_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_sitelist
-BEFORE INSERT ON phpbb_sitelist
-FOR EACH ROW WHEN (
- new.site_id IS NULL OR new.site_id = 0
-)
-BEGIN
- SELECT phpbb_sitelist_seq.nextval
- INTO :new.site_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_smilies'
-*/
-CREATE TABLE phpbb_smilies (
- smiley_id number(8) NOT NULL,
- code varchar2(150) DEFAULT '' ,
- emotion varchar2(150) DEFAULT '' ,
- smiley_url varchar2(50) DEFAULT '' ,
- smiley_width number(4) DEFAULT '0' NOT NULL,
- smiley_height number(4) DEFAULT '0' NOT NULL,
- smiley_order number(8) DEFAULT '0' NOT NULL,
- display_on_posting number(1) DEFAULT '1' NOT NULL,
- CONSTRAINT pk_phpbb_smilies PRIMARY KEY (smiley_id)
-)
-/
-
-CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting)
-/
-
-CREATE SEQUENCE phpbb_smilies_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_smilies
-BEFORE INSERT ON phpbb_smilies
-FOR EACH ROW WHEN (
- new.smiley_id IS NULL OR new.smiley_id = 0
-)
-BEGIN
- SELECT phpbb_smilies_seq.nextval
- INTO :new.smiley_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_styles'
-*/
-CREATE TABLE phpbb_styles (
- style_id number(8) NOT NULL,
- style_name varchar2(765) DEFAULT '' ,
- style_copyright varchar2(765) DEFAULT '' ,
- style_active number(1) DEFAULT '1' NOT NULL,
- style_path varchar2(100) DEFAULT '' ,
- bbcode_bitfield varchar2(255) DEFAULT 'kNg=' NOT NULL,
- style_parent_id number(4) DEFAULT '0' NOT NULL,
- style_parent_tree clob DEFAULT '' ,
- CONSTRAINT pk_phpbb_styles PRIMARY KEY (style_id),
- CONSTRAINT u_phpbb_style_name UNIQUE (style_name)
-)
-/
-
-
-CREATE SEQUENCE phpbb_styles_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_styles
-BEFORE INSERT ON phpbb_styles
-FOR EACH ROW WHEN (
- new.style_id IS NULL OR new.style_id = 0
-)
-BEGIN
- SELECT phpbb_styles_seq.nextval
- INTO :new.style_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_topics'
-*/
-CREATE TABLE phpbb_topics (
- topic_id number(8) NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- icon_id number(8) DEFAULT '0' NOT NULL,
- topic_attachment number(1) DEFAULT '0' NOT NULL,
- topic_approved number(1) DEFAULT '1' NOT NULL,
- topic_reported number(1) DEFAULT '0' NOT NULL,
- topic_title varchar2(765) DEFAULT '' ,
- topic_poster number(8) DEFAULT '0' NOT NULL,
- topic_time number(11) DEFAULT '0' NOT NULL,
- topic_time_limit number(11) DEFAULT '0' NOT NULL,
- topic_views number(8) DEFAULT '0' NOT NULL,
- topic_replies number(8) DEFAULT '0' NOT NULL,
- topic_replies_real number(8) DEFAULT '0' NOT NULL,
- topic_status number(3) DEFAULT '0' NOT NULL,
- topic_type number(3) DEFAULT '0' NOT NULL,
- topic_first_post_id number(8) DEFAULT '0' NOT NULL,
- topic_first_poster_name varchar2(765) DEFAULT '' ,
- topic_first_poster_colour varchar2(6) DEFAULT '' ,
- topic_last_post_id number(8) DEFAULT '0' NOT NULL,
- topic_last_poster_id number(8) DEFAULT '0' NOT NULL,
- topic_last_poster_name varchar2(765) DEFAULT '' ,
- topic_last_poster_colour varchar2(6) DEFAULT '' ,
- topic_last_post_subject varchar2(765) DEFAULT '' ,
- topic_last_post_time number(11) DEFAULT '0' NOT NULL,
- topic_last_view_time number(11) DEFAULT '0' NOT NULL,
- topic_moved_id number(8) DEFAULT '0' NOT NULL,
- topic_bumped number(1) DEFAULT '0' NOT NULL,
- topic_bumper number(8) DEFAULT '0' NOT NULL,
- poll_title varchar2(765) DEFAULT '' ,
- poll_start number(11) DEFAULT '0' NOT NULL,
- poll_length number(11) DEFAULT '0' NOT NULL,
- poll_max_options number(4) DEFAULT '1' NOT NULL,
- poll_last_vote number(11) DEFAULT '0' NOT NULL,
- poll_vote_change number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_topics PRIMARY KEY (topic_id)
-)
-/
-
-CREATE INDEX phpbb_topics_forum_id ON phpbb_topics (forum_id)
-/
-CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics (forum_id, topic_type)
-/
-CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics (topic_last_post_time)
-/
-CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics (topic_approved)
-/
-CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics (forum_id, topic_approved, topic_last_post_id)
-/
-CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id)
-/
-
-CREATE SEQUENCE phpbb_topics_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_topics
-BEFORE INSERT ON phpbb_topics
-FOR EACH ROW WHEN (
- new.topic_id IS NULL OR new.topic_id = 0
-)
-BEGIN
- SELECT phpbb_topics_seq.nextval
- INTO :new.topic_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_topics_track'
-*/
-CREATE TABLE phpbb_topics_track (
- user_id number(8) DEFAULT '0' NOT NULL,
- topic_id number(8) DEFAULT '0' NOT NULL,
- forum_id number(8) DEFAULT '0' NOT NULL,
- mark_time number(11) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_topics_track PRIMARY KEY (user_id, topic_id)
-)
-/
-
-CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id)
-/
-CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id)
-/
-
-/*
- Table: 'phpbb_topics_posted'
-*/
-CREATE TABLE phpbb_topics_posted (
- user_id number(8) DEFAULT '0' NOT NULL,
- topic_id number(8) DEFAULT '0' NOT NULL,
- topic_posted number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_topics_posted PRIMARY KEY (user_id, topic_id)
-)
-/
-
-
-/*
- Table: 'phpbb_topics_watch'
-*/
-CREATE TABLE phpbb_topics_watch (
- topic_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- notify_status number(1) DEFAULT '0' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch (topic_id)
-/
-CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch (user_id)
-/
-CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status)
-/
-
-/*
- Table: 'phpbb_user_group'
-*/
-CREATE TABLE phpbb_user_group (
- group_id number(8) DEFAULT '0' NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- group_leader number(1) DEFAULT '0' NOT NULL,
- user_pending number(1) DEFAULT '1' NOT NULL
-)
-/
-
-CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group (group_id)
-/
-CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group (user_id)
-/
-CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group (group_leader)
-/
-
-/*
- Table: 'phpbb_users'
-*/
-CREATE TABLE phpbb_users (
- user_id number(8) NOT NULL,
- user_type number(2) DEFAULT '0' NOT NULL,
- group_id number(8) DEFAULT '3' NOT NULL,
- user_permissions clob DEFAULT '' ,
- user_perm_from number(8) DEFAULT '0' NOT NULL,
- user_ip varchar2(40) DEFAULT '' ,
- user_regdate number(11) DEFAULT '0' NOT NULL,
- username varchar2(255) DEFAULT '' ,
- username_clean varchar2(255) DEFAULT '' ,
- user_password varchar2(120) DEFAULT '' ,
- user_passchg number(11) DEFAULT '0' NOT NULL,
- user_pass_convert number(1) DEFAULT '0' NOT NULL,
- user_email varchar2(300) DEFAULT '' ,
- user_email_hash number(20) DEFAULT '0' NOT NULL,
- user_birthday varchar2(10) DEFAULT '' ,
- user_lastvisit number(11) DEFAULT '0' NOT NULL,
- user_lastmark number(11) DEFAULT '0' NOT NULL,
- user_lastpost_time number(11) DEFAULT '0' NOT NULL,
- user_lastpage varchar2(600) DEFAULT '' ,
- user_last_confirm_key varchar2(10) DEFAULT '' ,
- user_last_search number(11) DEFAULT '0' NOT NULL,
- user_warnings number(4) DEFAULT '0' NOT NULL,
- user_last_warning number(11) DEFAULT '0' NOT NULL,
- user_login_attempts number(4) DEFAULT '0' NOT NULL,
- user_inactive_reason number(2) DEFAULT '0' NOT NULL,
- user_inactive_time number(11) DEFAULT '0' NOT NULL,
- user_posts number(8) DEFAULT '0' NOT NULL,
- user_lang varchar2(30) DEFAULT '' ,
- user_timezone varchar2(100) DEFAULT 'UTC' NOT NULL,
- user_dateformat varchar2(90) DEFAULT 'd M Y H:i' NOT NULL,
- user_style number(8) DEFAULT '0' NOT NULL,
- user_rank number(8) DEFAULT '0' NOT NULL,
- user_colour varchar2(6) DEFAULT '' ,
- user_new_privmsg number(4) DEFAULT '0' NOT NULL,
- user_unread_privmsg number(4) DEFAULT '0' NOT NULL,
- user_last_privmsg number(11) DEFAULT '0' NOT NULL,
- user_message_rules number(1) DEFAULT '0' NOT NULL,
- user_full_folder number(11) DEFAULT '-3' NOT NULL,
- user_emailtime number(11) DEFAULT '0' NOT NULL,
- user_topic_show_days number(4) DEFAULT '0' NOT NULL,
- user_topic_sortby_type varchar2(1) DEFAULT 't' NOT NULL,
- user_topic_sortby_dir varchar2(1) DEFAULT 'd' NOT NULL,
- user_post_show_days number(4) DEFAULT '0' NOT NULL,
- user_post_sortby_type varchar2(1) DEFAULT 't' NOT NULL,
- user_post_sortby_dir varchar2(1) DEFAULT 'a' NOT NULL,
- user_notify number(1) DEFAULT '0' NOT NULL,
- user_notify_pm number(1) DEFAULT '1' NOT NULL,
- user_notify_type number(4) DEFAULT '0' NOT NULL,
- user_allow_pm number(1) DEFAULT '1' NOT NULL,
- user_allow_viewonline number(1) DEFAULT '1' NOT NULL,
- user_allow_viewemail number(1) DEFAULT '1' NOT NULL,
- user_allow_massemail number(1) DEFAULT '1' NOT NULL,
- user_options number(11) DEFAULT '230271' NOT NULL,
- user_avatar varchar2(255) DEFAULT '' ,
- user_avatar_type 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_bbcode_uid varchar2(8) DEFAULT '' ,
- user_sig_bbcode_bitfield varchar2(255) DEFAULT '' ,
- user_from varchar2(300) DEFAULT '' ,
- user_icq varchar2(15) DEFAULT '' ,
- user_aim varchar2(765) DEFAULT '' ,
- user_yim varchar2(765) DEFAULT '' ,
- user_msnm varchar2(765) DEFAULT '' ,
- user_jabber varchar2(765) DEFAULT '' ,
- user_website varchar2(600) DEFAULT '' ,
- user_occ clob DEFAULT '' ,
- user_interests clob DEFAULT '' ,
- user_actkey varchar2(32) DEFAULT '' ,
- user_newpasswd varchar2(120) DEFAULT '' ,
- user_form_salt varchar2(96) DEFAULT '' ,
- user_new number(1) DEFAULT '1' NOT NULL,
- user_reminded number(4) DEFAULT '0' NOT NULL,
- user_reminded_time number(11) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_users PRIMARY KEY (user_id),
- CONSTRAINT u_phpbb_username_clean UNIQUE (username_clean)
-)
-/
-
-CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday)
-/
-CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash)
-/
-CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type)
-/
-
-CREATE SEQUENCE phpbb_users_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_users
-BEFORE INSERT ON phpbb_users
-FOR EACH ROW WHEN (
- new.user_id IS NULL OR new.user_id = 0
-)
-BEGIN
- SELECT phpbb_users_seq.nextval
- INTO :new.user_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_warnings'
-*/
-CREATE TABLE phpbb_warnings (
- warning_id number(8) NOT NULL,
- user_id number(8) DEFAULT '0' NOT NULL,
- post_id number(8) DEFAULT '0' NOT NULL,
- log_id number(8) DEFAULT '0' NOT NULL,
- warning_time number(11) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_warnings PRIMARY KEY (warning_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_warnings_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_warnings
-BEFORE INSERT ON phpbb_warnings
-FOR EACH ROW WHEN (
- new.warning_id IS NULL OR new.warning_id = 0
-)
-BEGIN
- SELECT phpbb_warnings_seq.nextval
- INTO :new.warning_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_words'
-*/
-CREATE TABLE phpbb_words (
- word_id number(8) NOT NULL,
- word varchar2(765) DEFAULT '' ,
- replacement varchar2(765) DEFAULT '' ,
- CONSTRAINT pk_phpbb_words PRIMARY KEY (word_id)
-)
-/
-
-
-CREATE SEQUENCE phpbb_words_seq
-/
-
-CREATE OR REPLACE TRIGGER t_phpbb_words
-BEFORE INSERT ON phpbb_words
-FOR EACH ROW WHEN (
- new.word_id IS NULL OR new.word_id = 0
-)
-BEGIN
- SELECT phpbb_words_seq.nextval
- INTO :new.word_id
- FROM dual;
-END;
-/
-
-
-/*
- Table: 'phpbb_zebra'
-*/
-CREATE TABLE phpbb_zebra (
- user_id number(8) DEFAULT '0' NOT NULL,
- zebra_id number(8) DEFAULT '0' NOT NULL,
- friend number(1) DEFAULT '0' NOT NULL,
- foe number(1) DEFAULT '0' NOT NULL,
- CONSTRAINT pk_phpbb_zebra PRIMARY KEY (user_id, zebra_id)
-)
-/
-
-
+/*
+ * DO NOT EDIT THIS FILE, IT IS GENERATED
+ *
+ * To change the contents of this file, edit
+ * phpBB/develop/create_schema_files.php and
+ * run it.
+ */
+
+/*
+ This first section is optional, however its probably the best method
+ of running phpBB on Oracle. If you already have a tablespace and user created
+ 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 before you run this script!!
+*/
+
+/*
+CREATE TABLESPACE "PHPBB"
+ LOGGING
+ DATAFILE 'E:\ORACLE\ORADATA\LOCAL\PHPBB.ora'
+ SIZE 10M
+ AUTOEXTEND ON NEXT 10M
+ MAXSIZE 100M;
+
+CREATE USER "PHPBB"
+ PROFILE "DEFAULT"
+ IDENTIFIED BY "phpbb_password"
+ DEFAULT TABLESPACE "PHPBB"
+ QUOTA UNLIMITED ON "PHPBB"
+ ACCOUNT UNLOCK;
+
+GRANT ANALYZE ANY TO "PHPBB";
+GRANT CREATE SEQUENCE TO "PHPBB";
+GRANT CREATE SESSION TO "PHPBB";
+GRANT CREATE TABLE TO "PHPBB";
+GRANT CREATE TRIGGER TO "PHPBB";
+GRANT CREATE VIEW TO "PHPBB";
+GRANT "CONNECT" TO "PHPBB";
+
+COMMIT;
+DISCONNECT;
+
+CONNECT phpbb/phpbb_password;
+*/
+/*
+ Table: 'phpbb_attachments'
+*/
+CREATE TABLE phpbb_attachments (
+ attach_id number(8) NOT NULL,
+ post_msg_id number(8) DEFAULT '0' NOT NULL,
+ topic_id number(8) DEFAULT '0' NOT NULL,
+ in_message number(1) DEFAULT '0' NOT NULL,
+ poster_id number(8) DEFAULT '0' NOT NULL,
+ is_orphan number(1) DEFAULT '1' NOT NULL,
+ physical_filename varchar2(255) DEFAULT '' ,
+ real_filename varchar2(255) DEFAULT '' ,
+ download_count number(8) DEFAULT '0' NOT NULL,
+ attach_comment clob DEFAULT '' ,
+ extension varchar2(100) DEFAULT '' ,
+ mimetype varchar2(100) DEFAULT '' ,
+ filesize number(20) DEFAULT '0' NOT NULL,
+ filetime number(11) DEFAULT '0' NOT NULL,
+ thumbnail number(1) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_attachments PRIMARY KEY (attach_id)
+)
+/
+
+CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments (filetime)
+/
+CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments (post_msg_id)
+/
+CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments (topic_id)
+/
+CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id)
+/
+CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments (is_orphan)
+/
+
+CREATE SEQUENCE phpbb_attachments_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_attachments
+BEFORE INSERT ON phpbb_attachments
+FOR EACH ROW WHEN (
+ new.attach_id IS NULL OR new.attach_id = 0
+)
+BEGIN
+ SELECT phpbb_attachments_seq.nextval
+ INTO :new.attach_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_acl_groups'
+*/
+CREATE TABLE phpbb_acl_groups (
+ group_id number(8) DEFAULT '0' NOT NULL,
+ forum_id number(8) DEFAULT '0' NOT NULL,
+ auth_option_id number(8) DEFAULT '0' NOT NULL,
+ auth_role_id number(8) DEFAULT '0' NOT NULL,
+ auth_setting number(2) DEFAULT '0' NOT NULL
+)
+/
+
+CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups (group_id)
+/
+CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups (auth_option_id)
+/
+CREATE INDEX phpbb_acl_groups_auth_role_id ON phpbb_acl_groups (auth_role_id)
+/
+
+/*
+ Table: 'phpbb_acl_options'
+*/
+CREATE TABLE phpbb_acl_options (
+ auth_option_id number(8) NOT NULL,
+ auth_option varchar2(50) DEFAULT '' ,
+ is_global number(1) DEFAULT '0' NOT NULL,
+ is_local number(1) DEFAULT '0' NOT NULL,
+ founder_only number(1) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_acl_options PRIMARY KEY (auth_option_id),
+ CONSTRAINT u_phpbb_auth_option UNIQUE (auth_option)
+)
+/
+
+
+CREATE SEQUENCE phpbb_acl_options_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_acl_options
+BEFORE INSERT ON phpbb_acl_options
+FOR EACH ROW WHEN (
+ new.auth_option_id IS NULL OR new.auth_option_id = 0
+)
+BEGIN
+ SELECT phpbb_acl_options_seq.nextval
+ INTO :new.auth_option_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_acl_roles'
+*/
+CREATE TABLE phpbb_acl_roles (
+ role_id number(8) NOT NULL,
+ role_name varchar2(765) DEFAULT '' ,
+ role_description clob DEFAULT '' ,
+ role_type varchar2(10) DEFAULT '' ,
+ role_order number(4) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_acl_roles PRIMARY KEY (role_id)
+)
+/
+
+CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles (role_type)
+/
+CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles (role_order)
+/
+
+CREATE SEQUENCE phpbb_acl_roles_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_acl_roles
+BEFORE INSERT ON phpbb_acl_roles
+FOR EACH ROW WHEN (
+ new.role_id IS NULL OR new.role_id = 0
+)
+BEGIN
+ SELECT phpbb_acl_roles_seq.nextval
+ INTO :new.role_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_acl_roles_data'
+*/
+CREATE TABLE phpbb_acl_roles_data (
+ role_id number(8) DEFAULT '0' NOT NULL,
+ auth_option_id number(8) DEFAULT '0' NOT NULL,
+ auth_setting number(2) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_acl_roles_data PRIMARY KEY (role_id, auth_option_id)
+)
+/
+
+CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id)
+/
+
+/*
+ Table: 'phpbb_acl_users'
+*/
+CREATE TABLE phpbb_acl_users (
+ user_id number(8) DEFAULT '0' NOT NULL,
+ forum_id number(8) DEFAULT '0' NOT NULL,
+ auth_option_id number(8) DEFAULT '0' NOT NULL,
+ auth_role_id number(8) DEFAULT '0' NOT NULL,
+ auth_setting number(2) DEFAULT '0' NOT NULL
+)
+/
+
+CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users (user_id)
+/
+CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users (auth_option_id)
+/
+CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id)
+/
+
+/*
+ Table: 'phpbb_banlist'
+*/
+CREATE TABLE phpbb_banlist (
+ ban_id number(8) NOT NULL,
+ ban_userid number(8) DEFAULT '0' NOT NULL,
+ ban_ip varchar2(40) DEFAULT '' ,
+ ban_email varchar2(300) DEFAULT '' ,
+ ban_start number(11) DEFAULT '0' NOT NULL,
+ ban_end number(11) DEFAULT '0' NOT NULL,
+ ban_exclude number(1) DEFAULT '0' NOT NULL,
+ ban_reason varchar2(765) DEFAULT '' ,
+ ban_give_reason varchar2(765) DEFAULT '' ,
+ CONSTRAINT pk_phpbb_banlist PRIMARY KEY (ban_id)
+)
+/
+
+CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end)
+/
+CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist (ban_userid, ban_exclude)
+/
+CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist (ban_email, ban_exclude)
+/
+CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist (ban_ip, ban_exclude)
+/
+
+CREATE SEQUENCE phpbb_banlist_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_banlist
+BEFORE INSERT ON phpbb_banlist
+FOR EACH ROW WHEN (
+ new.ban_id IS NULL OR new.ban_id = 0
+)
+BEGIN
+ SELECT phpbb_banlist_seq.nextval
+ INTO :new.ban_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_bbcodes'
+*/
+CREATE TABLE phpbb_bbcodes (
+ bbcode_id number(4) DEFAULT '0' NOT NULL,
+ bbcode_tag varchar2(16) DEFAULT '' ,
+ bbcode_helpline varchar2(765) DEFAULT '' ,
+ display_on_posting number(1) DEFAULT '0' NOT NULL,
+ bbcode_match clob DEFAULT '' ,
+ bbcode_tpl clob DEFAULT '' ,
+ first_pass_match clob DEFAULT '' ,
+ first_pass_replace clob DEFAULT '' ,
+ second_pass_match clob DEFAULT '' ,
+ second_pass_replace clob DEFAULT '' ,
+ CONSTRAINT pk_phpbb_bbcodes PRIMARY KEY (bbcode_id)
+)
+/
+
+CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting)
+/
+
+/*
+ Table: 'phpbb_bookmarks'
+*/
+CREATE TABLE phpbb_bookmarks (
+ topic_id number(8) DEFAULT '0' NOT NULL,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_bookmarks PRIMARY KEY (topic_id, user_id)
+)
+/
+
+
+/*
+ Table: 'phpbb_bots'
+*/
+CREATE TABLE phpbb_bots (
+ bot_id number(8) NOT NULL,
+ bot_active number(1) DEFAULT '1' NOT NULL,
+ bot_name varchar2(765) DEFAULT '' ,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ bot_agent varchar2(255) DEFAULT '' ,
+ bot_ip varchar2(255) DEFAULT '' ,
+ CONSTRAINT pk_phpbb_bots PRIMARY KEY (bot_id)
+)
+/
+
+CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active)
+/
+
+CREATE SEQUENCE phpbb_bots_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_bots
+BEFORE INSERT ON phpbb_bots
+FOR EACH ROW WHEN (
+ new.bot_id IS NULL OR new.bot_id = 0
+)
+BEGIN
+ SELECT phpbb_bots_seq.nextval
+ INTO :new.bot_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_config'
+*/
+CREATE TABLE phpbb_config (
+ config_name varchar2(255) DEFAULT '' ,
+ config_value varchar2(765) DEFAULT '' ,
+ is_dynamic number(1) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_config PRIMARY KEY (config_name)
+)
+/
+
+CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic)
+/
+
+/*
+ Table: 'phpbb_confirm'
+*/
+CREATE TABLE phpbb_confirm (
+ confirm_id char(32) DEFAULT '' ,
+ session_id char(32) DEFAULT '' ,
+ confirm_type number(3) DEFAULT '0' NOT NULL,
+ code varchar2(8) DEFAULT '' ,
+ seed number(10) DEFAULT '0' NOT NULL,
+ attempts number(8) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_confirm PRIMARY KEY (session_id, confirm_id)
+)
+/
+
+CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm (confirm_type)
+/
+
+/*
+ Table: 'phpbb_disallow'
+*/
+CREATE TABLE phpbb_disallow (
+ disallow_id number(8) NOT NULL,
+ disallow_username varchar2(765) DEFAULT '' ,
+ CONSTRAINT pk_phpbb_disallow PRIMARY KEY (disallow_id)
+)
+/
+
+
+CREATE SEQUENCE phpbb_disallow_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_disallow
+BEFORE INSERT ON phpbb_disallow
+FOR EACH ROW WHEN (
+ new.disallow_id IS NULL OR new.disallow_id = 0
+)
+BEGIN
+ SELECT phpbb_disallow_seq.nextval
+ INTO :new.disallow_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_drafts'
+*/
+CREATE TABLE phpbb_drafts (
+ draft_id number(8) NOT NULL,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ topic_id number(8) DEFAULT '0' NOT NULL,
+ forum_id number(8) DEFAULT '0' NOT NULL,
+ save_time number(11) DEFAULT '0' NOT NULL,
+ draft_subject varchar2(765) DEFAULT '' ,
+ draft_message clob DEFAULT '' ,
+ CONSTRAINT pk_phpbb_drafts PRIMARY KEY (draft_id)
+)
+/
+
+CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time)
+/
+
+CREATE SEQUENCE phpbb_drafts_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_drafts
+BEFORE INSERT ON phpbb_drafts
+FOR EACH ROW WHEN (
+ new.draft_id IS NULL OR new.draft_id = 0
+)
+BEGIN
+ SELECT phpbb_drafts_seq.nextval
+ INTO :new.draft_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_ext'
+*/
+CREATE TABLE phpbb_ext (
+ ext_name varchar2(255) DEFAULT '' ,
+ ext_active number(1) DEFAULT '0' NOT NULL,
+ ext_state clob DEFAULT '' ,
+ CONSTRAINT u_phpbb_ext_name UNIQUE (ext_name)
+)
+/
+
+
+/*
+ Table: 'phpbb_extensions'
+*/
+CREATE TABLE phpbb_extensions (
+ extension_id number(8) NOT NULL,
+ group_id number(8) DEFAULT '0' NOT NULL,
+ extension varchar2(100) DEFAULT '' ,
+ CONSTRAINT pk_phpbb_extensions PRIMARY KEY (extension_id)
+)
+/
+
+
+CREATE SEQUENCE phpbb_extensions_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_extensions
+BEFORE INSERT ON phpbb_extensions
+FOR EACH ROW WHEN (
+ new.extension_id IS NULL OR new.extension_id = 0
+)
+BEGIN
+ SELECT phpbb_extensions_seq.nextval
+ INTO :new.extension_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_extension_groups'
+*/
+CREATE TABLE phpbb_extension_groups (
+ group_id number(8) NOT NULL,
+ group_name varchar2(765) DEFAULT '' ,
+ cat_id number(2) DEFAULT '0' NOT NULL,
+ allow_group number(1) DEFAULT '0' NOT NULL,
+ download_mode number(1) DEFAULT '1' NOT NULL,
+ upload_icon varchar2(255) DEFAULT '' ,
+ max_filesize number(20) DEFAULT '0' NOT NULL,
+ allowed_forums clob DEFAULT '' ,
+ allow_in_pm number(1) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_extension_groups PRIMARY KEY (group_id)
+)
+/
+
+
+CREATE SEQUENCE phpbb_extension_groups_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_extension_groups
+BEFORE INSERT ON phpbb_extension_groups
+FOR EACH ROW WHEN (
+ new.group_id IS NULL OR new.group_id = 0
+)
+BEGIN
+ SELECT phpbb_extension_groups_seq.nextval
+ INTO :new.group_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_forums'
+*/
+CREATE TABLE phpbb_forums (
+ forum_id number(8) NOT NULL,
+ parent_id number(8) DEFAULT '0' NOT NULL,
+ left_id number(8) DEFAULT '0' NOT NULL,
+ right_id number(8) DEFAULT '0' NOT NULL,
+ forum_parents clob DEFAULT '' ,
+ forum_name varchar2(765) DEFAULT '' ,
+ forum_desc clob DEFAULT '' ,
+ forum_desc_bitfield varchar2(255) DEFAULT '' ,
+ forum_desc_options number(11) DEFAULT '7' NOT NULL,
+ forum_desc_uid varchar2(8) DEFAULT '' ,
+ forum_link varchar2(765) DEFAULT '' ,
+ forum_password varchar2(120) DEFAULT '' ,
+ forum_style number(8) DEFAULT '0' NOT NULL,
+ forum_image varchar2(255) DEFAULT '' ,
+ forum_rules clob DEFAULT '' ,
+ forum_rules_link varchar2(765) DEFAULT '' ,
+ forum_rules_bitfield varchar2(255) DEFAULT '' ,
+ forum_rules_options number(11) DEFAULT '7' NOT NULL,
+ forum_rules_uid varchar2(8) DEFAULT '' ,
+ forum_topics_per_page number(4) DEFAULT '0' NOT NULL,
+ forum_type number(4) DEFAULT '0' NOT NULL,
+ forum_status number(4) DEFAULT '0' NOT NULL,
+ forum_posts number(8) DEFAULT '0' NOT NULL,
+ forum_topics number(8) DEFAULT '0' NOT NULL,
+ forum_topics_real number(8) DEFAULT '0' NOT NULL,
+ forum_last_post_id number(8) DEFAULT '0' NOT NULL,
+ forum_last_poster_id number(8) DEFAULT '0' NOT NULL,
+ forum_last_post_subject varchar2(765) DEFAULT '' ,
+ forum_last_post_time number(11) DEFAULT '0' NOT NULL,
+ forum_last_poster_name varchar2(765) DEFAULT '' ,
+ forum_last_poster_colour varchar2(6) DEFAULT '' ,
+ forum_flags number(4) DEFAULT '32' NOT NULL,
+ forum_options number(20) DEFAULT '0' NOT NULL,
+ display_subforum_list number(1) DEFAULT '1' NOT NULL,
+ display_on_index number(1) DEFAULT '1' NOT NULL,
+ enable_indexing number(1) DEFAULT '1' NOT NULL,
+ enable_icons number(1) DEFAULT '1' NOT NULL,
+ enable_prune number(1) DEFAULT '0' NOT NULL,
+ prune_next number(11) DEFAULT '0' NOT NULL,
+ prune_days number(8) DEFAULT '0' NOT NULL,
+ prune_viewed number(8) DEFAULT '0' NOT NULL,
+ prune_freq number(8) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_forums PRIMARY KEY (forum_id)
+)
+/
+
+CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums (left_id, right_id)
+/
+CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums (forum_last_post_id)
+/
+
+CREATE SEQUENCE phpbb_forums_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_forums
+BEFORE INSERT ON phpbb_forums
+FOR EACH ROW WHEN (
+ new.forum_id IS NULL OR new.forum_id = 0
+)
+BEGIN
+ SELECT phpbb_forums_seq.nextval
+ INTO :new.forum_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_forums_access'
+*/
+CREATE TABLE phpbb_forums_access (
+ forum_id number(8) DEFAULT '0' NOT NULL,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ session_id char(32) DEFAULT '' ,
+ CONSTRAINT pk_phpbb_forums_access PRIMARY KEY (forum_id, user_id, session_id)
+)
+/
+
+
+/*
+ Table: 'phpbb_forums_track'
+*/
+CREATE TABLE phpbb_forums_track (
+ user_id number(8) DEFAULT '0' NOT NULL,
+ forum_id number(8) DEFAULT '0' NOT NULL,
+ mark_time number(11) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_forums_track PRIMARY KEY (user_id, forum_id)
+)
+/
+
+
+/*
+ Table: 'phpbb_forums_watch'
+*/
+CREATE TABLE phpbb_forums_watch (
+ forum_id number(8) DEFAULT '0' NOT NULL,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ notify_status number(1) DEFAULT '0' NOT NULL
+)
+/
+
+CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch (forum_id)
+/
+CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch (user_id)
+/
+CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch (notify_status)
+/
+
+/*
+ Table: 'phpbb_groups'
+*/
+CREATE TABLE phpbb_groups (
+ group_id number(8) NOT NULL,
+ group_type number(4) DEFAULT '1' NOT NULL,
+ group_founder_manage number(1) DEFAULT '0' NOT NULL,
+ group_skip_auth number(1) DEFAULT '0' NOT NULL,
+ group_name varchar2(255) DEFAULT '' ,
+ group_desc clob DEFAULT '' ,
+ group_desc_bitfield varchar2(255) DEFAULT '' ,
+ group_desc_options number(11) DEFAULT '7' NOT NULL,
+ group_desc_uid varchar2(8) DEFAULT '' ,
+ group_display number(1) DEFAULT '0' NOT NULL,
+ group_avatar varchar2(255) DEFAULT '' ,
+ group_avatar_type number(2) DEFAULT '0' NOT NULL,
+ group_avatar_width number(4) DEFAULT '0' NOT NULL,
+ group_avatar_height number(4) DEFAULT '0' NOT NULL,
+ group_rank number(8) DEFAULT '0' NOT NULL,
+ group_colour varchar2(6) DEFAULT '' ,
+ group_sig_chars number(8) DEFAULT '0' NOT NULL,
+ group_receive_pm number(1) DEFAULT '0' NOT NULL,
+ group_message_limit number(8) DEFAULT '0' NOT NULL,
+ group_max_recipients number(8) DEFAULT '0' NOT NULL,
+ group_legend number(8) DEFAULT '0' NOT NULL,
+ group_teampage number(8) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_groups PRIMARY KEY (group_id)
+)
+/
+
+CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name)
+/
+
+CREATE SEQUENCE phpbb_groups_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_groups
+BEFORE INSERT ON phpbb_groups
+FOR EACH ROW WHEN (
+ new.group_id IS NULL OR new.group_id = 0
+)
+BEGIN
+ SELECT phpbb_groups_seq.nextval
+ INTO :new.group_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_icons'
+*/
+CREATE TABLE phpbb_icons (
+ icons_id number(8) NOT NULL,
+ icons_url varchar2(255) DEFAULT '' ,
+ icons_width number(4) DEFAULT '0' NOT NULL,
+ icons_height number(4) DEFAULT '0' NOT NULL,
+ icons_order number(8) DEFAULT '0' NOT NULL,
+ display_on_posting number(1) DEFAULT '1' NOT NULL,
+ CONSTRAINT pk_phpbb_icons PRIMARY KEY (icons_id)
+)
+/
+
+CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons (display_on_posting)
+/
+
+CREATE SEQUENCE phpbb_icons_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_icons
+BEFORE INSERT ON phpbb_icons
+FOR EACH ROW WHEN (
+ new.icons_id IS NULL OR new.icons_id = 0
+)
+BEGIN
+ SELECT phpbb_icons_seq.nextval
+ INTO :new.icons_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_lang'
+*/
+CREATE TABLE phpbb_lang (
+ lang_id number(4) NOT NULL,
+ lang_iso varchar2(30) DEFAULT '' ,
+ lang_dir varchar2(30) DEFAULT '' ,
+ lang_english_name varchar2(300) DEFAULT '' ,
+ lang_local_name varchar2(765) DEFAULT '' ,
+ lang_author varchar2(765) DEFAULT '' ,
+ CONSTRAINT pk_phpbb_lang PRIMARY KEY (lang_id)
+)
+/
+
+CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang (lang_iso)
+/
+
+CREATE SEQUENCE phpbb_lang_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_lang
+BEFORE INSERT ON phpbb_lang
+FOR EACH ROW WHEN (
+ new.lang_id IS NULL OR new.lang_id = 0
+)
+BEGIN
+ SELECT phpbb_lang_seq.nextval
+ INTO :new.lang_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_log'
+*/
+CREATE TABLE phpbb_log (
+ log_id number(8) NOT NULL,
+ log_type number(4) DEFAULT '0' NOT NULL,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ forum_id number(8) DEFAULT '0' NOT NULL,
+ topic_id number(8) DEFAULT '0' NOT NULL,
+ reportee_id number(8) DEFAULT '0' NOT NULL,
+ log_ip varchar2(40) DEFAULT '' ,
+ log_time number(11) DEFAULT '0' NOT NULL,
+ log_operation clob DEFAULT '' ,
+ log_data clob DEFAULT '' ,
+ CONSTRAINT pk_phpbb_log PRIMARY KEY (log_id)
+)
+/
+
+CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type)
+/
+CREATE INDEX phpbb_log_log_time ON phpbb_log (log_time)
+/
+CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id)
+/
+CREATE INDEX phpbb_log_topic_id ON phpbb_log (topic_id)
+/
+CREATE INDEX phpbb_log_reportee_id ON phpbb_log (reportee_id)
+/
+CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id)
+/
+
+CREATE SEQUENCE phpbb_log_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_log
+BEFORE INSERT ON phpbb_log
+FOR EACH ROW WHEN (
+ new.log_id IS NULL OR new.log_id = 0
+)
+BEGIN
+ SELECT phpbb_log_seq.nextval
+ INTO :new.log_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_login_attempts'
+*/
+CREATE TABLE phpbb_login_attempts (
+ attempt_ip varchar2(40) DEFAULT '' ,
+ attempt_browser varchar2(150) DEFAULT '' ,
+ attempt_forwarded_for varchar2(255) DEFAULT '' ,
+ attempt_time number(11) DEFAULT '0' NOT NULL,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ username varchar2(765) DEFAULT '0' NOT NULL,
+ username_clean varchar2(255) DEFAULT '0' NOT NULL
+)
+/
+
+CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts (attempt_ip, attempt_time)
+/
+CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts (attempt_forwarded_for, attempt_time)
+/
+CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts (attempt_time)
+/
+CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts (user_id)
+/
+
+/*
+ Table: 'phpbb_moderator_cache'
+*/
+CREATE TABLE phpbb_moderator_cache (
+ forum_id number(8) DEFAULT '0' NOT NULL,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ username varchar2(765) DEFAULT '' ,
+ group_id number(8) DEFAULT '0' NOT NULL,
+ group_name varchar2(765) DEFAULT '' ,
+ display_on_index number(1) DEFAULT '1' NOT NULL
+)
+/
+
+CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache (display_on_index)
+/
+CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache (forum_id)
+/
+
+/*
+ Table: 'phpbb_modules'
+*/
+CREATE TABLE phpbb_modules (
+ module_id number(8) NOT NULL,
+ module_enabled number(1) DEFAULT '1' NOT NULL,
+ module_display number(1) DEFAULT '1' NOT NULL,
+ module_basename varchar2(255) DEFAULT '' ,
+ module_class varchar2(10) DEFAULT '' ,
+ parent_id number(8) DEFAULT '0' NOT NULL,
+ left_id number(8) DEFAULT '0' NOT NULL,
+ right_id number(8) DEFAULT '0' NOT NULL,
+ module_langname varchar2(255) DEFAULT '' ,
+ module_mode varchar2(255) DEFAULT '' ,
+ module_auth varchar2(255) DEFAULT '' ,
+ CONSTRAINT pk_phpbb_modules PRIMARY KEY (module_id)
+)
+/
+
+CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id)
+/
+CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled)
+/
+CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id)
+/
+
+CREATE SEQUENCE phpbb_modules_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_modules
+BEFORE INSERT ON phpbb_modules
+FOR EACH ROW WHEN (
+ new.module_id IS NULL OR new.module_id = 0
+)
+BEGIN
+ SELECT phpbb_modules_seq.nextval
+ INTO :new.module_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_poll_options'
+*/
+CREATE TABLE phpbb_poll_options (
+ poll_option_id number(4) DEFAULT '0' NOT NULL,
+ topic_id number(8) DEFAULT '0' NOT NULL,
+ poll_option_text clob DEFAULT '' ,
+ poll_option_total number(8) DEFAULT '0' NOT NULL
+)
+/
+
+CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options (poll_option_id)
+/
+CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options (topic_id)
+/
+
+/*
+ Table: 'phpbb_poll_votes'
+*/
+CREATE TABLE phpbb_poll_votes (
+ topic_id number(8) DEFAULT '0' NOT NULL,
+ poll_option_id number(4) DEFAULT '0' NOT NULL,
+ vote_user_id number(8) DEFAULT '0' NOT NULL,
+ vote_user_ip varchar2(40) DEFAULT ''
+)
+/
+
+CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes (topic_id)
+/
+CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes (vote_user_id)
+/
+CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes (vote_user_ip)
+/
+
+/*
+ Table: 'phpbb_posts'
+*/
+CREATE TABLE phpbb_posts (
+ post_id number(8) NOT NULL,
+ topic_id number(8) DEFAULT '0' NOT NULL,
+ forum_id number(8) DEFAULT '0' NOT NULL,
+ poster_id number(8) DEFAULT '0' NOT NULL,
+ icon_id number(8) DEFAULT '0' NOT NULL,
+ poster_ip varchar2(40) DEFAULT '' ,
+ post_time number(11) DEFAULT '0' NOT NULL,
+ post_approved number(1) DEFAULT '1' NOT NULL,
+ post_reported number(1) DEFAULT '0' NOT NULL,
+ enable_bbcode number(1) DEFAULT '1' NOT NULL,
+ enable_smilies number(1) DEFAULT '1' NOT NULL,
+ enable_magic_url number(1) DEFAULT '1' NOT NULL,
+ enable_sig number(1) DEFAULT '1' NOT NULL,
+ post_username varchar2(765) DEFAULT '' ,
+ post_subject varchar2(765) DEFAULT '' ,
+ post_text clob DEFAULT '' ,
+ post_checksum varchar2(32) DEFAULT '' ,
+ post_attachment number(1) DEFAULT '0' NOT NULL,
+ bbcode_bitfield varchar2(255) DEFAULT '' ,
+ bbcode_uid varchar2(8) DEFAULT '' ,
+ post_postcount number(1) DEFAULT '1' NOT NULL,
+ post_edit_time number(11) DEFAULT '0' NOT NULL,
+ post_edit_reason varchar2(765) DEFAULT '' ,
+ post_edit_user number(8) DEFAULT '0' NOT NULL,
+ post_edit_count number(4) DEFAULT '0' NOT NULL,
+ post_edit_locked number(1) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_posts PRIMARY KEY (post_id)
+)
+/
+
+CREATE INDEX phpbb_posts_forum_id ON phpbb_posts (forum_id)
+/
+CREATE INDEX phpbb_posts_topic_id ON phpbb_posts (topic_id)
+/
+CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip)
+/
+CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id)
+/
+CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved)
+/
+CREATE INDEX phpbb_posts_post_username ON phpbb_posts (post_username)
+/
+CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time)
+/
+
+CREATE SEQUENCE phpbb_posts_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_posts
+BEFORE INSERT ON phpbb_posts
+FOR EACH ROW WHEN (
+ new.post_id IS NULL OR new.post_id = 0
+)
+BEGIN
+ SELECT phpbb_posts_seq.nextval
+ INTO :new.post_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_privmsgs'
+*/
+CREATE TABLE phpbb_privmsgs (
+ msg_id number(8) NOT NULL,
+ root_level number(8) DEFAULT '0' NOT NULL,
+ author_id number(8) DEFAULT '0' NOT NULL,
+ icon_id number(8) DEFAULT '0' NOT NULL,
+ author_ip varchar2(40) DEFAULT '' ,
+ message_time number(11) DEFAULT '0' NOT NULL,
+ enable_bbcode number(1) DEFAULT '1' NOT NULL,
+ enable_smilies number(1) DEFAULT '1' NOT NULL,
+ enable_magic_url number(1) DEFAULT '1' NOT NULL,
+ enable_sig number(1) DEFAULT '1' NOT NULL,
+ message_subject varchar2(765) DEFAULT '' ,
+ message_text clob DEFAULT '' ,
+ message_edit_reason varchar2(765) DEFAULT '' ,
+ message_edit_user number(8) DEFAULT '0' NOT NULL,
+ message_attachment number(1) DEFAULT '0' NOT NULL,
+ bbcode_bitfield varchar2(255) DEFAULT '' ,
+ bbcode_uid varchar2(8) DEFAULT '' ,
+ message_edit_time number(11) DEFAULT '0' NOT NULL,
+ message_edit_count number(4) DEFAULT '0' NOT NULL,
+ to_address clob DEFAULT '' ,
+ bcc_address clob DEFAULT '' ,
+ message_reported number(1) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_privmsgs PRIMARY KEY (msg_id)
+)
+/
+
+CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs (author_ip)
+/
+CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs (message_time)
+/
+CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs (author_id)
+/
+CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs (root_level)
+/
+
+CREATE SEQUENCE phpbb_privmsgs_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_privmsgs
+BEFORE INSERT ON phpbb_privmsgs
+FOR EACH ROW WHEN (
+ new.msg_id IS NULL OR new.msg_id = 0
+)
+BEGIN
+ SELECT phpbb_privmsgs_seq.nextval
+ INTO :new.msg_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_privmsgs_folder'
+*/
+CREATE TABLE phpbb_privmsgs_folder (
+ folder_id number(8) NOT NULL,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ folder_name varchar2(765) DEFAULT '' ,
+ pm_count number(8) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_privmsgs_folder PRIMARY KEY (folder_id)
+)
+/
+
+CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id)
+/
+
+CREATE SEQUENCE phpbb_privmsgs_folder_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_privmsgs_folder
+BEFORE INSERT ON phpbb_privmsgs_folder
+FOR EACH ROW WHEN (
+ new.folder_id IS NULL OR new.folder_id = 0
+)
+BEGIN
+ SELECT phpbb_privmsgs_folder_seq.nextval
+ INTO :new.folder_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_privmsgs_rules'
+*/
+CREATE TABLE phpbb_privmsgs_rules (
+ rule_id number(8) NOT NULL,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ rule_check number(8) DEFAULT '0' NOT NULL,
+ rule_connection number(8) DEFAULT '0' NOT NULL,
+ rule_string varchar2(765) DEFAULT '' ,
+ rule_user_id number(8) DEFAULT '0' NOT NULL,
+ rule_group_id number(8) DEFAULT '0' NOT NULL,
+ rule_action number(8) DEFAULT '0' NOT NULL,
+ rule_folder_id number(11) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_privmsgs_rules PRIMARY KEY (rule_id)
+)
+/
+
+CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules (user_id)
+/
+
+CREATE SEQUENCE phpbb_privmsgs_rules_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_privmsgs_rules
+BEFORE INSERT ON phpbb_privmsgs_rules
+FOR EACH ROW WHEN (
+ new.rule_id IS NULL OR new.rule_id = 0
+)
+BEGIN
+ SELECT phpbb_privmsgs_rules_seq.nextval
+ INTO :new.rule_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_privmsgs_to'
+*/
+CREATE TABLE phpbb_privmsgs_to (
+ msg_id number(8) DEFAULT '0' NOT NULL,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ author_id number(8) DEFAULT '0' NOT NULL,
+ pm_deleted number(1) DEFAULT '0' NOT NULL,
+ pm_new number(1) DEFAULT '1' NOT NULL,
+ pm_unread number(1) DEFAULT '1' NOT NULL,
+ pm_replied number(1) DEFAULT '0' NOT NULL,
+ pm_marked number(1) DEFAULT '0' NOT NULL,
+ pm_forwarded number(1) DEFAULT '0' NOT NULL,
+ folder_id number(11) DEFAULT '0' NOT NULL
+)
+/
+
+CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id)
+/
+CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to (author_id)
+/
+CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folder_id)
+/
+
+/*
+ Table: 'phpbb_profile_fields'
+*/
+CREATE TABLE phpbb_profile_fields (
+ field_id number(8) NOT NULL,
+ field_name varchar2(765) DEFAULT '' ,
+ field_type number(4) DEFAULT '0' NOT NULL,
+ field_ident varchar2(20) DEFAULT '' ,
+ field_length varchar2(20) DEFAULT '' ,
+ field_minlen varchar2(255) DEFAULT '' ,
+ field_maxlen varchar2(255) DEFAULT '' ,
+ field_novalue varchar2(765) DEFAULT '' ,
+ field_default_value varchar2(765) DEFAULT '' ,
+ field_validation varchar2(60) DEFAULT '' ,
+ field_required number(1) DEFAULT '0' NOT NULL,
+ field_show_novalue number(1) DEFAULT '0' NOT NULL,
+ field_show_on_reg number(1) DEFAULT '0' NOT NULL,
+ field_show_on_pm number(1) DEFAULT '0' NOT NULL,
+ field_show_on_vt number(1) DEFAULT '0' NOT NULL,
+ field_show_profile number(1) DEFAULT '0' NOT NULL,
+ field_hide number(1) DEFAULT '0' NOT NULL,
+ field_no_view number(1) DEFAULT '0' NOT NULL,
+ field_active number(1) DEFAULT '0' NOT NULL,
+ field_order number(8) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_profile_fields PRIMARY KEY (field_id)
+)
+/
+
+CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields (field_type)
+/
+CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields (field_order)
+/
+
+CREATE SEQUENCE phpbb_profile_fields_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_profile_fields
+BEFORE INSERT ON phpbb_profile_fields
+FOR EACH ROW WHEN (
+ new.field_id IS NULL OR new.field_id = 0
+)
+BEGIN
+ SELECT phpbb_profile_fields_seq.nextval
+ INTO :new.field_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_profile_fields_data'
+*/
+CREATE TABLE phpbb_profile_fields_data (
+ user_id number(8) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_profile_fields_data PRIMARY KEY (user_id)
+)
+/
+
+
+/*
+ Table: 'phpbb_profile_fields_lang'
+*/
+CREATE TABLE phpbb_profile_fields_lang (
+ field_id number(8) DEFAULT '0' NOT NULL,
+ lang_id number(8) DEFAULT '0' NOT NULL,
+ option_id number(8) DEFAULT '0' NOT NULL,
+ field_type number(4) DEFAULT '0' NOT NULL,
+ lang_value varchar2(765) DEFAULT '' ,
+ CONSTRAINT pk_phpbb_profile_fields_lang PRIMARY KEY (field_id, lang_id, option_id)
+)
+/
+
+
+/*
+ Table: 'phpbb_profile_lang'
+*/
+CREATE TABLE phpbb_profile_lang (
+ field_id number(8) DEFAULT '0' NOT NULL,
+ lang_id number(8) DEFAULT '0' NOT NULL,
+ lang_name varchar2(765) DEFAULT '' ,
+ lang_explain clob DEFAULT '' ,
+ lang_default_value varchar2(765) DEFAULT '' ,
+ CONSTRAINT pk_phpbb_profile_lang PRIMARY KEY (field_id, lang_id)
+)
+/
+
+
+/*
+ Table: 'phpbb_ranks'
+*/
+CREATE TABLE phpbb_ranks (
+ rank_id number(8) NOT NULL,
+ rank_title varchar2(765) DEFAULT '' ,
+ rank_min number(8) DEFAULT '0' NOT NULL,
+ rank_special number(1) DEFAULT '0' NOT NULL,
+ rank_image varchar2(255) DEFAULT '' ,
+ CONSTRAINT pk_phpbb_ranks PRIMARY KEY (rank_id)
+)
+/
+
+
+CREATE SEQUENCE phpbb_ranks_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_ranks
+BEFORE INSERT ON phpbb_ranks
+FOR EACH ROW WHEN (
+ new.rank_id IS NULL OR new.rank_id = 0
+)
+BEGIN
+ SELECT phpbb_ranks_seq.nextval
+ INTO :new.rank_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_reports'
+*/
+CREATE TABLE phpbb_reports (
+ report_id number(8) NOT NULL,
+ reason_id number(4) DEFAULT '0' NOT NULL,
+ post_id number(8) DEFAULT '0' NOT NULL,
+ pm_id number(8) DEFAULT '0' NOT NULL,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ user_notify number(1) DEFAULT '0' NOT NULL,
+ report_closed number(1) DEFAULT '0' NOT NULL,
+ report_time number(11) DEFAULT '0' NOT NULL,
+ report_text clob DEFAULT '' ,
+ reported_post_text clob DEFAULT '' ,
+ CONSTRAINT pk_phpbb_reports PRIMARY KEY (report_id)
+)
+/
+
+CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id)
+/
+CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id)
+/
+
+CREATE SEQUENCE phpbb_reports_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_reports
+BEFORE INSERT ON phpbb_reports
+FOR EACH ROW WHEN (
+ new.report_id IS NULL OR new.report_id = 0
+)
+BEGIN
+ SELECT phpbb_reports_seq.nextval
+ INTO :new.report_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_reports_reasons'
+*/
+CREATE TABLE phpbb_reports_reasons (
+ reason_id number(4) NOT NULL,
+ reason_title varchar2(765) DEFAULT '' ,
+ reason_description clob DEFAULT '' ,
+ reason_order number(4) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_reports_reasons PRIMARY KEY (reason_id)
+)
+/
+
+
+CREATE SEQUENCE phpbb_reports_reasons_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_reports_reasons
+BEFORE INSERT ON phpbb_reports_reasons
+FOR EACH ROW WHEN (
+ new.reason_id IS NULL OR new.reason_id = 0
+)
+BEGIN
+ SELECT phpbb_reports_reasons_seq.nextval
+ INTO :new.reason_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_search_results'
+*/
+CREATE TABLE phpbb_search_results (
+ search_key varchar2(32) DEFAULT '' ,
+ search_time number(11) DEFAULT '0' NOT NULL,
+ search_keywords clob DEFAULT '' ,
+ search_authors clob DEFAULT '' ,
+ CONSTRAINT pk_phpbb_search_results PRIMARY KEY (search_key)
+)
+/
+
+
+/*
+ Table: 'phpbb_search_wordlist'
+*/
+CREATE TABLE phpbb_search_wordlist (
+ word_id number(8) NOT NULL,
+ word_text varchar2(765) DEFAULT '' ,
+ word_common number(1) DEFAULT '0' NOT NULL,
+ word_count number(8) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_search_wordlist PRIMARY KEY (word_id),
+ CONSTRAINT u_phpbb_wrd_txt UNIQUE (word_text)
+)
+/
+
+CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist (word_count)
+/
+
+CREATE SEQUENCE phpbb_search_wordlist_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_search_wordlist
+BEFORE INSERT ON phpbb_search_wordlist
+FOR EACH ROW WHEN (
+ new.word_id IS NULL OR new.word_id = 0
+)
+BEGIN
+ SELECT phpbb_search_wordlist_seq.nextval
+ INTO :new.word_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_search_wordmatch'
+*/
+CREATE TABLE phpbb_search_wordmatch (
+ post_id number(8) DEFAULT '0' NOT NULL,
+ word_id number(8) DEFAULT '0' NOT NULL,
+ title_match number(1) DEFAULT '0' NOT NULL,
+ CONSTRAINT u_phpbb_unq_mtch UNIQUE (word_id, post_id, title_match)
+)
+/
+
+CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id)
+/
+CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id)
+/
+
+/*
+ Table: 'phpbb_sessions'
+*/
+CREATE TABLE phpbb_sessions (
+ session_id char(32) DEFAULT '' ,
+ session_user_id number(8) DEFAULT '0' NOT NULL,
+ session_forum_id number(8) DEFAULT '0' NOT NULL,
+ session_last_visit number(11) DEFAULT '0' NOT NULL,
+ session_start number(11) DEFAULT '0' NOT NULL,
+ session_time number(11) DEFAULT '0' NOT NULL,
+ session_ip varchar2(40) DEFAULT '' ,
+ session_browser varchar2(150) DEFAULT '' ,
+ session_forwarded_for varchar2(255) DEFAULT '' ,
+ session_page varchar2(765) DEFAULT '' ,
+ session_viewonline number(1) DEFAULT '1' NOT NULL,
+ session_autologin number(1) DEFAULT '0' NOT NULL,
+ session_admin number(1) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_sessions PRIMARY KEY (session_id)
+)
+/
+
+CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions (session_time)
+/
+CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions (session_user_id)
+/
+CREATE INDEX phpbb_sessions_session_fid ON phpbb_sessions (session_forum_id)
+/
+
+/*
+ Table: 'phpbb_sessions_keys'
+*/
+CREATE TABLE phpbb_sessions_keys (
+ key_id char(32) DEFAULT '' ,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ last_ip varchar2(40) DEFAULT '' ,
+ last_login number(11) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_sessions_keys PRIMARY KEY (key_id, user_id)
+)
+/
+
+CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login)
+/
+
+/*
+ Table: 'phpbb_sitelist'
+*/
+CREATE TABLE phpbb_sitelist (
+ site_id number(8) NOT NULL,
+ site_ip varchar2(40) DEFAULT '' ,
+ site_hostname varchar2(255) DEFAULT '' ,
+ ip_exclude number(1) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_sitelist PRIMARY KEY (site_id)
+)
+/
+
+
+CREATE SEQUENCE phpbb_sitelist_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_sitelist
+BEFORE INSERT ON phpbb_sitelist
+FOR EACH ROW WHEN (
+ new.site_id IS NULL OR new.site_id = 0
+)
+BEGIN
+ SELECT phpbb_sitelist_seq.nextval
+ INTO :new.site_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_smilies'
+*/
+CREATE TABLE phpbb_smilies (
+ smiley_id number(8) NOT NULL,
+ code varchar2(150) DEFAULT '' ,
+ emotion varchar2(150) DEFAULT '' ,
+ smiley_url varchar2(50) DEFAULT '' ,
+ smiley_width number(4) DEFAULT '0' NOT NULL,
+ smiley_height number(4) DEFAULT '0' NOT NULL,
+ smiley_order number(8) DEFAULT '0' NOT NULL,
+ display_on_posting number(1) DEFAULT '1' NOT NULL,
+ CONSTRAINT pk_phpbb_smilies PRIMARY KEY (smiley_id)
+)
+/
+
+CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting)
+/
+
+CREATE SEQUENCE phpbb_smilies_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_smilies
+BEFORE INSERT ON phpbb_smilies
+FOR EACH ROW WHEN (
+ new.smiley_id IS NULL OR new.smiley_id = 0
+)
+BEGIN
+ SELECT phpbb_smilies_seq.nextval
+ INTO :new.smiley_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_styles'
+*/
+CREATE TABLE phpbb_styles (
+ style_id number(8) NOT NULL,
+ style_name varchar2(765) DEFAULT '' ,
+ style_copyright varchar2(765) DEFAULT '' ,
+ style_active number(1) DEFAULT '1' NOT NULL,
+ style_path varchar2(100) DEFAULT '' ,
+ bbcode_bitfield varchar2(255) DEFAULT 'kNg=' NOT NULL,
+ style_parent_id number(4) DEFAULT '0' NOT NULL,
+ style_parent_tree clob DEFAULT '' ,
+ CONSTRAINT pk_phpbb_styles PRIMARY KEY (style_id),
+ CONSTRAINT u_phpbb_style_name UNIQUE (style_name)
+)
+/
+
+
+CREATE SEQUENCE phpbb_styles_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_styles
+BEFORE INSERT ON phpbb_styles
+FOR EACH ROW WHEN (
+ new.style_id IS NULL OR new.style_id = 0
+)
+BEGIN
+ SELECT phpbb_styles_seq.nextval
+ INTO :new.style_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_topics'
+*/
+CREATE TABLE phpbb_topics (
+ topic_id number(8) NOT NULL,
+ forum_id number(8) DEFAULT '0' NOT NULL,
+ icon_id number(8) DEFAULT '0' NOT NULL,
+ topic_attachment number(1) DEFAULT '0' NOT NULL,
+ topic_approved number(1) DEFAULT '1' NOT NULL,
+ topic_reported number(1) DEFAULT '0' NOT NULL,
+ topic_title varchar2(765) DEFAULT '' ,
+ topic_poster number(8) DEFAULT '0' NOT NULL,
+ topic_time number(11) DEFAULT '0' NOT NULL,
+ topic_time_limit number(11) DEFAULT '0' NOT NULL,
+ topic_views number(8) DEFAULT '0' NOT NULL,
+ topic_replies number(8) DEFAULT '0' NOT NULL,
+ topic_replies_real number(8) DEFAULT '0' NOT NULL,
+ topic_status number(3) DEFAULT '0' NOT NULL,
+ topic_type number(3) DEFAULT '0' NOT NULL,
+ topic_first_post_id number(8) DEFAULT '0' NOT NULL,
+ topic_first_poster_name varchar2(765) DEFAULT '' ,
+ topic_first_poster_colour varchar2(6) DEFAULT '' ,
+ topic_last_post_id number(8) DEFAULT '0' NOT NULL,
+ topic_last_poster_id number(8) DEFAULT '0' NOT NULL,
+ topic_last_poster_name varchar2(765) DEFAULT '' ,
+ topic_last_poster_colour varchar2(6) DEFAULT '' ,
+ topic_last_post_subject varchar2(765) DEFAULT '' ,
+ topic_last_post_time number(11) DEFAULT '0' NOT NULL,
+ topic_last_view_time number(11) DEFAULT '0' NOT NULL,
+ topic_moved_id number(8) DEFAULT '0' NOT NULL,
+ topic_bumped number(1) DEFAULT '0' NOT NULL,
+ topic_bumper number(8) DEFAULT '0' NOT NULL,
+ poll_title varchar2(765) DEFAULT '' ,
+ poll_start number(11) DEFAULT '0' NOT NULL,
+ poll_length number(11) DEFAULT '0' NOT NULL,
+ poll_max_options number(4) DEFAULT '1' NOT NULL,
+ poll_last_vote number(11) DEFAULT '0' NOT NULL,
+ poll_vote_change number(1) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_topics PRIMARY KEY (topic_id)
+)
+/
+
+CREATE INDEX phpbb_topics_forum_id ON phpbb_topics (forum_id)
+/
+CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics (forum_id, topic_type)
+/
+CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics (topic_last_post_time)
+/
+CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics (topic_approved)
+/
+CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics (forum_id, topic_approved, topic_last_post_id)
+/
+CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id)
+/
+
+CREATE SEQUENCE phpbb_topics_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_topics
+BEFORE INSERT ON phpbb_topics
+FOR EACH ROW WHEN (
+ new.topic_id IS NULL OR new.topic_id = 0
+)
+BEGIN
+ SELECT phpbb_topics_seq.nextval
+ INTO :new.topic_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_topics_track'
+*/
+CREATE TABLE phpbb_topics_track (
+ user_id number(8) DEFAULT '0' NOT NULL,
+ topic_id number(8) DEFAULT '0' NOT NULL,
+ forum_id number(8) DEFAULT '0' NOT NULL,
+ mark_time number(11) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_topics_track PRIMARY KEY (user_id, topic_id)
+)
+/
+
+CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id)
+/
+CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id)
+/
+
+/*
+ Table: 'phpbb_topics_posted'
+*/
+CREATE TABLE phpbb_topics_posted (
+ user_id number(8) DEFAULT '0' NOT NULL,
+ topic_id number(8) DEFAULT '0' NOT NULL,
+ topic_posted number(1) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_topics_posted PRIMARY KEY (user_id, topic_id)
+)
+/
+
+
+/*
+ Table: 'phpbb_topics_watch'
+*/
+CREATE TABLE phpbb_topics_watch (
+ topic_id number(8) DEFAULT '0' NOT NULL,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ notify_status number(1) DEFAULT '0' NOT NULL
+)
+/
+
+CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch (topic_id)
+/
+CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch (user_id)
+/
+CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status)
+/
+
+/*
+ Table: 'phpbb_user_group'
+*/
+CREATE TABLE phpbb_user_group (
+ group_id number(8) DEFAULT '0' NOT NULL,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ group_leader number(1) DEFAULT '0' NOT NULL,
+ user_pending number(1) DEFAULT '1' NOT NULL
+)
+/
+
+CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group (group_id)
+/
+CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group (user_id)
+/
+CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group (group_leader)
+/
+
+/*
+ Table: 'phpbb_users'
+*/
+CREATE TABLE phpbb_users (
+ user_id number(8) NOT NULL,
+ user_type number(2) DEFAULT '0' NOT NULL,
+ group_id number(8) DEFAULT '3' NOT NULL,
+ user_permissions clob DEFAULT '' ,
+ user_perm_from number(8) DEFAULT '0' NOT NULL,
+ user_ip varchar2(40) DEFAULT '' ,
+ user_regdate number(11) DEFAULT '0' NOT NULL,
+ username varchar2(255) DEFAULT '' ,
+ username_clean varchar2(255) DEFAULT '' ,
+ user_password varchar2(120) DEFAULT '' ,
+ user_passchg number(11) DEFAULT '0' NOT NULL,
+ user_pass_convert number(1) DEFAULT '0' NOT NULL,
+ user_email varchar2(300) DEFAULT '' ,
+ user_email_hash number(20) DEFAULT '0' NOT NULL,
+ user_birthday varchar2(10) DEFAULT '' ,
+ user_lastvisit number(11) DEFAULT '0' NOT NULL,
+ user_lastmark number(11) DEFAULT '0' NOT NULL,
+ user_lastpost_time number(11) DEFAULT '0' NOT NULL,
+ user_lastpage varchar2(600) DEFAULT '' ,
+ user_last_confirm_key varchar2(10) DEFAULT '' ,
+ user_last_search number(11) DEFAULT '0' NOT NULL,
+ user_warnings number(4) DEFAULT '0' NOT NULL,
+ user_last_warning number(11) DEFAULT '0' NOT NULL,
+ user_login_attempts number(4) DEFAULT '0' NOT NULL,
+ user_inactive_reason number(2) DEFAULT '0' NOT NULL,
+ user_inactive_time number(11) DEFAULT '0' NOT NULL,
+ user_posts number(8) DEFAULT '0' NOT NULL,
+ user_lang varchar2(30) DEFAULT '' ,
+ user_timezone varchar2(100) DEFAULT 'UTC' NOT NULL,
+ user_dateformat varchar2(90) DEFAULT 'd M Y H:i' NOT NULL,
+ user_style number(8) DEFAULT '0' NOT NULL,
+ user_rank number(8) DEFAULT '0' NOT NULL,
+ user_colour varchar2(6) DEFAULT '' ,
+ user_new_privmsg number(4) DEFAULT '0' NOT NULL,
+ user_unread_privmsg number(4) DEFAULT '0' NOT NULL,
+ user_last_privmsg number(11) DEFAULT '0' NOT NULL,
+ user_message_rules number(1) DEFAULT '0' NOT NULL,
+ user_full_folder number(11) DEFAULT '-3' NOT NULL,
+ user_emailtime number(11) DEFAULT '0' NOT NULL,
+ user_topic_show_days number(4) DEFAULT '0' NOT NULL,
+ user_topic_sortby_type varchar2(1) DEFAULT 't' NOT NULL,
+ user_topic_sortby_dir varchar2(1) DEFAULT 'd' NOT NULL,
+ user_post_show_days number(4) DEFAULT '0' NOT NULL,
+ user_post_sortby_type varchar2(1) DEFAULT 't' NOT NULL,
+ user_post_sortby_dir varchar2(1) DEFAULT 'a' NOT NULL,
+ user_notify number(1) DEFAULT '0' NOT NULL,
+ user_notify_pm number(1) DEFAULT '1' NOT NULL,
+ user_notify_type number(4) DEFAULT '0' NOT NULL,
+ user_allow_pm number(1) DEFAULT '1' NOT NULL,
+ user_allow_viewonline number(1) DEFAULT '1' NOT NULL,
+ user_allow_viewemail number(1) DEFAULT '1' NOT NULL,
+ user_allow_massemail number(1) DEFAULT '1' NOT NULL,
+ user_options number(11) DEFAULT '230271' NOT NULL,
+ user_avatar varchar2(255) DEFAULT '' ,
+ user_avatar_type 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_bbcode_uid varchar2(8) DEFAULT '' ,
+ user_sig_bbcode_bitfield varchar2(255) DEFAULT '' ,
+ user_from varchar2(300) DEFAULT '' ,
+ user_icq varchar2(15) DEFAULT '' ,
+ user_aim varchar2(765) DEFAULT '' ,
+ user_yim varchar2(765) DEFAULT '' ,
+ user_msnm varchar2(765) DEFAULT '' ,
+ user_jabber varchar2(765) DEFAULT '' ,
+ user_website varchar2(600) DEFAULT '' ,
+ user_occ clob DEFAULT '' ,
+ user_interests clob DEFAULT '' ,
+ user_actkey varchar2(32) DEFAULT '' ,
+ user_newpasswd varchar2(120) DEFAULT '' ,
+ user_form_salt varchar2(96) DEFAULT '' ,
+ user_new number(1) DEFAULT '1' NOT NULL,
+ user_reminded number(4) DEFAULT '0' NOT NULL,
+ user_reminded_time number(11) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_users PRIMARY KEY (user_id),
+ CONSTRAINT u_phpbb_username_clean UNIQUE (username_clean)
+)
+/
+
+CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday)
+/
+CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash)
+/
+CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type)
+/
+
+CREATE SEQUENCE phpbb_users_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_users
+BEFORE INSERT ON phpbb_users
+FOR EACH ROW WHEN (
+ new.user_id IS NULL OR new.user_id = 0
+)
+BEGIN
+ SELECT phpbb_users_seq.nextval
+ INTO :new.user_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_warnings'
+*/
+CREATE TABLE phpbb_warnings (
+ warning_id number(8) NOT NULL,
+ user_id number(8) DEFAULT '0' NOT NULL,
+ post_id number(8) DEFAULT '0' NOT NULL,
+ log_id number(8) DEFAULT '0' NOT NULL,
+ warning_time number(11) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_warnings PRIMARY KEY (warning_id)
+)
+/
+
+
+CREATE SEQUENCE phpbb_warnings_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_warnings
+BEFORE INSERT ON phpbb_warnings
+FOR EACH ROW WHEN (
+ new.warning_id IS NULL OR new.warning_id = 0
+)
+BEGIN
+ SELECT phpbb_warnings_seq.nextval
+ INTO :new.warning_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_words'
+*/
+CREATE TABLE phpbb_words (
+ word_id number(8) NOT NULL,
+ word varchar2(765) DEFAULT '' ,
+ replacement varchar2(765) DEFAULT '' ,
+ CONSTRAINT pk_phpbb_words PRIMARY KEY (word_id)
+)
+/
+
+
+CREATE SEQUENCE phpbb_words_seq
+/
+
+CREATE OR REPLACE TRIGGER t_phpbb_words
+BEFORE INSERT ON phpbb_words
+FOR EACH ROW WHEN (
+ new.word_id IS NULL OR new.word_id = 0
+)
+BEGIN
+ SELECT phpbb_words_seq.nextval
+ INTO :new.word_id
+ FROM dual;
+END;
+/
+
+
+/*
+ Table: 'phpbb_zebra'
+*/
+CREATE TABLE phpbb_zebra (
+ user_id number(8) DEFAULT '0' NOT NULL,
+ zebra_id number(8) DEFAULT '0' NOT NULL,
+ friend number(1) DEFAULT '0' NOT NULL,
+ foe number(1) DEFAULT '0' NOT NULL,
+ CONSTRAINT pk_phpbb_zebra PRIMARY KEY (user_id, zebra_id)
+)
+/
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index 659a32bf19..e1678c9cc5 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -1,1240 +1,1236 @@
-/*
- * DO NOT EDIT THIS FILE, IT IS GENERATED
- *
- * To change the contents of this file, edit
- * phpBB/develop/create_schema_files.php and
- * run it.
- */
-
-BEGIN;
-
-/*
- Domain definition
-*/
-CREATE DOMAIN varchar_ci AS varchar(255) NOT NULL DEFAULT ''::character varying;
-
-/*
- Operation Functions
-*/
-CREATE FUNCTION _varchar_ci_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) = LOWER($2)' LANGUAGE SQL STRICT;
-CREATE FUNCTION _varchar_ci_not_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) != LOWER($2)' LANGUAGE SQL STRICT;
-CREATE FUNCTION _varchar_ci_less_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) < LOWER($2)' LANGUAGE SQL STRICT;
-CREATE FUNCTION _varchar_ci_less_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) <= LOWER($2)' LANGUAGE SQL STRICT;
-CREATE FUNCTION _varchar_ci_greater_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) > LOWER($2)' LANGUAGE SQL STRICT;
-CREATE FUNCTION _varchar_ci_greater_equals(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) >= LOWER($2)' LANGUAGE SQL STRICT;
-
-/*
- Operators
-*/
-CREATE OPERATOR <(
- PROCEDURE = _varchar_ci_less_than,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = >,
- NEGATOR = >=,
- RESTRICT = scalarltsel,
- JOIN = scalarltjoinsel);
-
-CREATE OPERATOR <=(
- PROCEDURE = _varchar_ci_less_equal,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = >=,
- NEGATOR = >,
- RESTRICT = scalarltsel,
- JOIN = scalarltjoinsel);
-
-CREATE OPERATOR >(
- PROCEDURE = _varchar_ci_greater_than,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = <,
- NEGATOR = <=,
- RESTRICT = scalargtsel,
- JOIN = scalargtjoinsel);
-
-CREATE OPERATOR >=(
- PROCEDURE = _varchar_ci_greater_equals,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = <=,
- NEGATOR = <,
- RESTRICT = scalargtsel,
- JOIN = scalargtjoinsel);
-
-CREATE OPERATOR <>(
- PROCEDURE = _varchar_ci_not_equal,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = <>,
- NEGATOR = =,
- RESTRICT = neqsel,
- JOIN = neqjoinsel);
-
-CREATE OPERATOR =(
- PROCEDURE = _varchar_ci_equal,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = =,
- NEGATOR = <>,
- RESTRICT = eqsel,
- JOIN = eqjoinsel,
- HASHES,
- MERGES,
- SORT1= <);
-
-/*
- Table: 'phpbb_attachments'
-*/
-CREATE SEQUENCE phpbb_attachments_seq;
-
-CREATE TABLE phpbb_attachments (
- attach_id INT4 DEFAULT nextval('phpbb_attachments_seq'),
- post_msg_id INT4 DEFAULT '0' NOT NULL CHECK (post_msg_id >= 0),
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- in_message INT2 DEFAULT '0' NOT NULL CHECK (in_message >= 0),
- poster_id INT4 DEFAULT '0' NOT NULL CHECK (poster_id >= 0),
- is_orphan INT2 DEFAULT '1' NOT NULL CHECK (is_orphan >= 0),
- physical_filename varchar(255) DEFAULT '' NOT NULL,
- real_filename varchar(255) DEFAULT '' NOT NULL,
- download_count INT4 DEFAULT '0' NOT NULL CHECK (download_count >= 0),
- attach_comment varchar(4000) DEFAULT '' NOT NULL,
- extension varchar(100) DEFAULT '' NOT NULL,
- mimetype varchar(100) DEFAULT '' NOT NULL,
- filesize INT4 DEFAULT '0' NOT NULL CHECK (filesize >= 0),
- filetime INT4 DEFAULT '0' NOT NULL CHECK (filetime >= 0),
- thumbnail INT2 DEFAULT '0' NOT NULL CHECK (thumbnail >= 0),
- PRIMARY KEY (attach_id)
-);
-
-CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments (filetime);
-CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments (post_msg_id);
-CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments (topic_id);
-CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id);
-CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments (is_orphan);
-
-/*
- Table: 'phpbb_acl_groups'
-*/
-CREATE TABLE phpbb_acl_groups (
- group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- auth_option_id INT4 DEFAULT '0' NOT NULL CHECK (auth_option_id >= 0),
- auth_role_id INT4 DEFAULT '0' NOT NULL CHECK (auth_role_id >= 0),
- auth_setting INT2 DEFAULT '0' NOT NULL
-);
-
-CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups (group_id);
-CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups (auth_option_id);
-CREATE INDEX phpbb_acl_groups_auth_role_id ON phpbb_acl_groups (auth_role_id);
-
-/*
- Table: 'phpbb_acl_options'
-*/
-CREATE SEQUENCE phpbb_acl_options_seq;
-
-CREATE TABLE phpbb_acl_options (
- auth_option_id INT4 DEFAULT nextval('phpbb_acl_options_seq'),
- auth_option varchar(50) DEFAULT '' NOT NULL,
- is_global INT2 DEFAULT '0' NOT NULL CHECK (is_global >= 0),
- is_local INT2 DEFAULT '0' NOT NULL CHECK (is_local >= 0),
- founder_only INT2 DEFAULT '0' NOT NULL CHECK (founder_only >= 0),
- PRIMARY KEY (auth_option_id)
-);
-
-CREATE UNIQUE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options (auth_option);
-
-/*
- Table: 'phpbb_acl_roles'
-*/
-CREATE SEQUENCE phpbb_acl_roles_seq;
-
-CREATE TABLE phpbb_acl_roles (
- role_id INT4 DEFAULT nextval('phpbb_acl_roles_seq'),
- role_name varchar(255) DEFAULT '' NOT NULL,
- role_description varchar(4000) DEFAULT '' NOT NULL,
- role_type varchar(10) DEFAULT '' NOT NULL,
- role_order INT2 DEFAULT '0' NOT NULL CHECK (role_order >= 0),
- PRIMARY KEY (role_id)
-);
-
-CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles (role_type);
-CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles (role_order);
-
-/*
- Table: 'phpbb_acl_roles_data'
-*/
-CREATE TABLE phpbb_acl_roles_data (
- role_id INT4 DEFAULT '0' NOT NULL CHECK (role_id >= 0),
- auth_option_id INT4 DEFAULT '0' NOT NULL CHECK (auth_option_id >= 0),
- auth_setting INT2 DEFAULT '0' NOT NULL,
- PRIMARY KEY (role_id, auth_option_id)
-);
-
-CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id);
-
-/*
- Table: 'phpbb_acl_users'
-*/
-CREATE TABLE phpbb_acl_users (
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- auth_option_id INT4 DEFAULT '0' NOT NULL CHECK (auth_option_id >= 0),
- auth_role_id INT4 DEFAULT '0' NOT NULL CHECK (auth_role_id >= 0),
- auth_setting INT2 DEFAULT '0' NOT NULL
-);
-
-CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users (user_id);
-CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users (auth_option_id);
-CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id);
-
-/*
- Table: 'phpbb_banlist'
-*/
-CREATE SEQUENCE phpbb_banlist_seq;
-
-CREATE TABLE phpbb_banlist (
- ban_id INT4 DEFAULT nextval('phpbb_banlist_seq'),
- ban_userid INT4 DEFAULT '0' NOT NULL CHECK (ban_userid >= 0),
- ban_ip varchar(40) DEFAULT '' NOT NULL,
- ban_email varchar(100) DEFAULT '' NOT NULL,
- ban_start INT4 DEFAULT '0' NOT NULL CHECK (ban_start >= 0),
- ban_end INT4 DEFAULT '0' NOT NULL CHECK (ban_end >= 0),
- ban_exclude INT2 DEFAULT '0' NOT NULL CHECK (ban_exclude >= 0),
- ban_reason varchar(255) DEFAULT '' NOT NULL,
- ban_give_reason varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (ban_id)
-);
-
-CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end);
-CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist (ban_userid, ban_exclude);
-CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist (ban_email, ban_exclude);
-CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist (ban_ip, ban_exclude);
-
-/*
- Table: 'phpbb_bbcodes'
-*/
-CREATE TABLE phpbb_bbcodes (
- bbcode_id INT2 DEFAULT '0' NOT NULL CHECK (bbcode_id >= 0),
- bbcode_tag varchar(16) DEFAULT '' NOT NULL,
- bbcode_helpline varchar(255) DEFAULT '' NOT NULL,
- display_on_posting INT2 DEFAULT '0' NOT NULL CHECK (display_on_posting >= 0),
- bbcode_match varchar(4000) DEFAULT '' NOT NULL,
- bbcode_tpl TEXT DEFAULT '' NOT NULL,
- first_pass_match TEXT DEFAULT '' NOT NULL,
- first_pass_replace TEXT DEFAULT '' NOT NULL,
- second_pass_match TEXT DEFAULT '' NOT NULL,
- second_pass_replace TEXT DEFAULT '' NOT NULL,
- PRIMARY KEY (bbcode_id)
-);
-
-CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting);
-
-/*
- Table: 'phpbb_bookmarks'
-*/
-CREATE TABLE phpbb_bookmarks (
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- PRIMARY KEY (topic_id, user_id)
-);
-
-
-/*
- Table: 'phpbb_bots'
-*/
-CREATE SEQUENCE phpbb_bots_seq;
-
-CREATE TABLE phpbb_bots (
- bot_id INT4 DEFAULT nextval('phpbb_bots_seq'),
- bot_active INT2 DEFAULT '1' NOT NULL CHECK (bot_active >= 0),
- bot_name varchar(255) DEFAULT '' NOT NULL,
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- bot_agent varchar(255) DEFAULT '' NOT NULL,
- bot_ip varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (bot_id)
-);
-
-CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active);
-
-/*
- Table: 'phpbb_config'
-*/
-CREATE TABLE phpbb_config (
- config_name varchar(255) DEFAULT '' NOT NULL,
- config_value varchar(255) DEFAULT '' NOT NULL,
- is_dynamic INT2 DEFAULT '0' NOT NULL CHECK (is_dynamic >= 0),
- PRIMARY KEY (config_name)
-);
-
-CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic);
-
-/*
- Table: 'phpbb_confirm'
-*/
-CREATE TABLE phpbb_confirm (
- confirm_id char(32) DEFAULT '' NOT NULL,
- session_id char(32) DEFAULT '' NOT NULL,
- confirm_type INT2 DEFAULT '0' NOT NULL,
- code varchar(8) DEFAULT '' NOT NULL,
- seed INT4 DEFAULT '0' NOT NULL CHECK (seed >= 0),
- attempts INT4 DEFAULT '0' NOT NULL CHECK (attempts >= 0),
- PRIMARY KEY (session_id, confirm_id)
-);
-
-CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm (confirm_type);
-
-/*
- Table: 'phpbb_disallow'
-*/
-CREATE SEQUENCE phpbb_disallow_seq;
-
-CREATE TABLE phpbb_disallow (
- disallow_id INT4 DEFAULT nextval('phpbb_disallow_seq'),
- disallow_username varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (disallow_id)
-);
-
-
-/*
- Table: 'phpbb_drafts'
-*/
-CREATE SEQUENCE phpbb_drafts_seq;
-
-CREATE TABLE phpbb_drafts (
- draft_id INT4 DEFAULT nextval('phpbb_drafts_seq'),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- save_time INT4 DEFAULT '0' NOT NULL CHECK (save_time >= 0),
- draft_subject varchar(255) DEFAULT '' NOT NULL,
- draft_message TEXT DEFAULT '' NOT NULL,
- PRIMARY KEY (draft_id)
-);
-
-CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time);
-
-/*
- Table: 'phpbb_ext'
-*/
-CREATE TABLE phpbb_ext (
- ext_name varchar(255) DEFAULT '' NOT NULL,
- ext_active INT2 DEFAULT '0' NOT NULL CHECK (ext_active >= 0),
- ext_state varchar(8000) DEFAULT '' NOT NULL
-);
-
-CREATE UNIQUE INDEX phpbb_ext_ext_name ON phpbb_ext (ext_name);
-
-/*
- Table: 'phpbb_extensions'
-*/
-CREATE SEQUENCE phpbb_extensions_seq;
-
-CREATE TABLE phpbb_extensions (
- extension_id INT4 DEFAULT nextval('phpbb_extensions_seq'),
- group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0),
- extension varchar(100) DEFAULT '' NOT NULL,
- PRIMARY KEY (extension_id)
-);
-
-
-/*
- Table: 'phpbb_extension_groups'
-*/
-CREATE SEQUENCE phpbb_extension_groups_seq;
-
-CREATE TABLE phpbb_extension_groups (
- group_id INT4 DEFAULT nextval('phpbb_extension_groups_seq'),
- group_name varchar(255) DEFAULT '' NOT NULL,
- cat_id INT2 DEFAULT '0' NOT NULL,
- allow_group INT2 DEFAULT '0' NOT NULL CHECK (allow_group >= 0),
- download_mode INT2 DEFAULT '1' NOT NULL CHECK (download_mode >= 0),
- upload_icon varchar(255) DEFAULT '' NOT NULL,
- max_filesize INT4 DEFAULT '0' NOT NULL CHECK (max_filesize >= 0),
- allowed_forums varchar(8000) DEFAULT '' NOT NULL,
- allow_in_pm INT2 DEFAULT '0' NOT NULL CHECK (allow_in_pm >= 0),
- PRIMARY KEY (group_id)
-);
-
-
-/*
- Table: 'phpbb_forums'
-*/
-CREATE SEQUENCE phpbb_forums_seq;
-
-CREATE TABLE phpbb_forums (
- forum_id INT4 DEFAULT nextval('phpbb_forums_seq'),
- parent_id INT4 DEFAULT '0' NOT NULL CHECK (parent_id >= 0),
- left_id INT4 DEFAULT '0' NOT NULL CHECK (left_id >= 0),
- right_id INT4 DEFAULT '0' NOT NULL CHECK (right_id >= 0),
- forum_parents TEXT DEFAULT '' NOT NULL,
- forum_name varchar(255) DEFAULT '' NOT NULL,
- forum_desc varchar(4000) DEFAULT '' NOT NULL,
- forum_desc_bitfield varchar(255) DEFAULT '' NOT NULL,
- forum_desc_options INT4 DEFAULT '7' NOT NULL CHECK (forum_desc_options >= 0),
- forum_desc_uid varchar(8) DEFAULT '' NOT NULL,
- forum_link varchar(255) DEFAULT '' NOT NULL,
- forum_password varchar(40) DEFAULT '' NOT NULL,
- forum_style INT4 DEFAULT '0' NOT NULL CHECK (forum_style >= 0),
- forum_image varchar(255) DEFAULT '' NOT NULL,
- forum_rules varchar(4000) DEFAULT '' NOT NULL,
- forum_rules_link varchar(255) DEFAULT '' NOT NULL,
- forum_rules_bitfield varchar(255) DEFAULT '' NOT NULL,
- forum_rules_options INT4 DEFAULT '7' NOT NULL CHECK (forum_rules_options >= 0),
- forum_rules_uid varchar(8) DEFAULT '' NOT NULL,
- forum_topics_per_page INT2 DEFAULT '0' NOT NULL,
- forum_type INT2 DEFAULT '0' NOT NULL,
- forum_status INT2 DEFAULT '0' NOT NULL,
- forum_posts INT4 DEFAULT '0' NOT NULL CHECK (forum_posts >= 0),
- forum_topics INT4 DEFAULT '0' NOT NULL CHECK (forum_topics >= 0),
- forum_topics_real INT4 DEFAULT '0' NOT NULL CHECK (forum_topics_real >= 0),
- forum_last_post_id INT4 DEFAULT '0' NOT NULL CHECK (forum_last_post_id >= 0),
- forum_last_poster_id INT4 DEFAULT '0' NOT NULL CHECK (forum_last_poster_id >= 0),
- forum_last_post_subject varchar(255) DEFAULT '' NOT NULL,
- forum_last_post_time INT4 DEFAULT '0' NOT NULL CHECK (forum_last_post_time >= 0),
- forum_last_poster_name varchar(255) DEFAULT '' NOT NULL,
- forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL,
- forum_flags INT2 DEFAULT '32' NOT NULL,
- forum_options INT4 DEFAULT '0' NOT NULL CHECK (forum_options >= 0),
- display_subforum_list INT2 DEFAULT '1' NOT NULL CHECK (display_subforum_list >= 0),
- display_on_index INT2 DEFAULT '1' NOT NULL CHECK (display_on_index >= 0),
- enable_indexing INT2 DEFAULT '1' NOT NULL CHECK (enable_indexing >= 0),
- enable_icons INT2 DEFAULT '1' NOT NULL CHECK (enable_icons >= 0),
- enable_prune INT2 DEFAULT '0' NOT NULL CHECK (enable_prune >= 0),
- prune_next INT4 DEFAULT '0' NOT NULL CHECK (prune_next >= 0),
- prune_days INT4 DEFAULT '0' NOT NULL CHECK (prune_days >= 0),
- prune_viewed INT4 DEFAULT '0' NOT NULL CHECK (prune_viewed >= 0),
- prune_freq INT4 DEFAULT '0' NOT NULL CHECK (prune_freq >= 0),
- PRIMARY KEY (forum_id)
-);
-
-CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums (left_id, right_id);
-CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums (forum_last_post_id);
-
-/*
- Table: 'phpbb_forums_access'
-*/
-CREATE TABLE phpbb_forums_access (
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- session_id char(32) DEFAULT '' NOT NULL,
- PRIMARY KEY (forum_id, user_id, session_id)
-);
-
-
-/*
- Table: 'phpbb_forums_track'
-*/
-CREATE TABLE phpbb_forums_track (
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- mark_time INT4 DEFAULT '0' NOT NULL CHECK (mark_time >= 0),
- PRIMARY KEY (user_id, forum_id)
-);
-
-
-/*
- Table: 'phpbb_forums_watch'
-*/
-CREATE TABLE phpbb_forums_watch (
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- notify_status INT2 DEFAULT '0' NOT NULL CHECK (notify_status >= 0)
-);
-
-CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch (forum_id);
-CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch (user_id);
-CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch (notify_status);
-
-/*
- Table: 'phpbb_groups'
-*/
-CREATE SEQUENCE phpbb_groups_seq;
-
-CREATE TABLE phpbb_groups (
- group_id INT4 DEFAULT nextval('phpbb_groups_seq'),
- group_type INT2 DEFAULT '1' NOT NULL,
- group_founder_manage INT2 DEFAULT '0' NOT NULL CHECK (group_founder_manage >= 0),
- group_skip_auth INT2 DEFAULT '0' NOT NULL CHECK (group_skip_auth >= 0),
- group_name varchar_ci DEFAULT '' NOT NULL,
- group_desc varchar(4000) DEFAULT '' NOT NULL,
- group_desc_bitfield varchar(255) DEFAULT '' NOT NULL,
- group_desc_options INT4 DEFAULT '7' NOT NULL CHECK (group_desc_options >= 0),
- group_desc_uid varchar(8) DEFAULT '' NOT NULL,
- group_display INT2 DEFAULT '0' NOT NULL CHECK (group_display >= 0),
- group_avatar varchar(255) DEFAULT '' NOT NULL,
- group_avatar_type INT2 DEFAULT '0' NOT NULL,
- group_avatar_width INT2 DEFAULT '0' NOT NULL CHECK (group_avatar_width >= 0),
- group_avatar_height INT2 DEFAULT '0' NOT NULL CHECK (group_avatar_height >= 0),
- group_rank INT4 DEFAULT '0' NOT NULL CHECK (group_rank >= 0),
- group_colour varchar(6) DEFAULT '' NOT NULL,
- group_sig_chars INT4 DEFAULT '0' NOT NULL CHECK (group_sig_chars >= 0),
- group_receive_pm INT2 DEFAULT '0' NOT NULL CHECK (group_receive_pm >= 0),
- group_message_limit INT4 DEFAULT '0' NOT NULL CHECK (group_message_limit >= 0),
- group_max_recipients INT4 DEFAULT '0' NOT NULL CHECK (group_max_recipients >= 0),
- group_legend INT4 DEFAULT '0' NOT NULL CHECK (group_legend >= 0),
- group_teampage INT4 DEFAULT '0' NOT NULL CHECK (group_teampage >= 0),
- PRIMARY KEY (group_id)
-);
-
-CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name);
-
-/*
- Table: 'phpbb_icons'
-*/
-CREATE SEQUENCE phpbb_icons_seq;
-
-CREATE TABLE phpbb_icons (
- icons_id INT4 DEFAULT nextval('phpbb_icons_seq'),
- icons_url varchar(255) DEFAULT '' NOT NULL,
- icons_width INT2 DEFAULT '0' NOT NULL,
- icons_height INT2 DEFAULT '0' NOT NULL,
- icons_order INT4 DEFAULT '0' NOT NULL CHECK (icons_order >= 0),
- display_on_posting INT2 DEFAULT '1' NOT NULL CHECK (display_on_posting >= 0),
- PRIMARY KEY (icons_id)
-);
-
-CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons (display_on_posting);
-
-/*
- Table: 'phpbb_lang'
-*/
-CREATE SEQUENCE phpbb_lang_seq;
-
-CREATE TABLE phpbb_lang (
- lang_id INT2 DEFAULT nextval('phpbb_lang_seq'),
- lang_iso varchar(30) DEFAULT '' NOT NULL,
- lang_dir varchar(30) DEFAULT '' NOT NULL,
- lang_english_name varchar(100) DEFAULT '' NOT NULL,
- lang_local_name varchar(255) DEFAULT '' NOT NULL,
- lang_author varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (lang_id)
-);
-
-CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang (lang_iso);
-
-/*
- Table: 'phpbb_log'
-*/
-CREATE SEQUENCE phpbb_log_seq;
-
-CREATE TABLE phpbb_log (
- log_id INT4 DEFAULT nextval('phpbb_log_seq'),
- log_type INT2 DEFAULT '0' NOT NULL,
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- reportee_id INT4 DEFAULT '0' NOT NULL CHECK (reportee_id >= 0),
- log_ip varchar(40) DEFAULT '' NOT NULL,
- log_time INT4 DEFAULT '0' NOT NULL CHECK (log_time >= 0),
- log_operation varchar(4000) DEFAULT '' NOT NULL,
- log_data TEXT DEFAULT '' NOT NULL,
- PRIMARY KEY (log_id)
-);
-
-CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type);
-CREATE INDEX phpbb_log_log_time ON phpbb_log (log_time);
-CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id);
-CREATE INDEX phpbb_log_topic_id ON phpbb_log (topic_id);
-CREATE INDEX phpbb_log_reportee_id ON phpbb_log (reportee_id);
-CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id);
-
-/*
- Table: 'phpbb_login_attempts'
-*/
-CREATE TABLE phpbb_login_attempts (
- attempt_ip varchar(40) DEFAULT '' NOT NULL,
- attempt_browser varchar(150) DEFAULT '' NOT NULL,
- attempt_forwarded_for varchar(255) DEFAULT '' NOT NULL,
- attempt_time INT4 DEFAULT '0' NOT NULL CHECK (attempt_time >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- username varchar(255) DEFAULT '0' NOT NULL,
- username_clean varchar_ci DEFAULT '0' NOT NULL
-);
-
-CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts (attempt_ip, attempt_time);
-CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts (attempt_forwarded_for, attempt_time);
-CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts (attempt_time);
-CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts (user_id);
-
-/*
- Table: 'phpbb_moderator_cache'
-*/
-CREATE TABLE phpbb_moderator_cache (
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- username varchar(255) DEFAULT '' NOT NULL,
- group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0),
- group_name varchar(255) DEFAULT '' NOT NULL,
- display_on_index INT2 DEFAULT '1' NOT NULL CHECK (display_on_index >= 0)
-);
-
-CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache (display_on_index);
-CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache (forum_id);
-
-/*
- Table: 'phpbb_modules'
-*/
-CREATE SEQUENCE phpbb_modules_seq;
-
-CREATE TABLE phpbb_modules (
- module_id INT4 DEFAULT nextval('phpbb_modules_seq'),
- module_enabled INT2 DEFAULT '1' NOT NULL CHECK (module_enabled >= 0),
- module_display INT2 DEFAULT '1' NOT NULL CHECK (module_display >= 0),
- module_basename varchar(255) DEFAULT '' NOT NULL,
- module_class varchar(10) DEFAULT '' NOT NULL,
- parent_id INT4 DEFAULT '0' NOT NULL CHECK (parent_id >= 0),
- left_id INT4 DEFAULT '0' NOT NULL CHECK (left_id >= 0),
- right_id INT4 DEFAULT '0' NOT NULL CHECK (right_id >= 0),
- module_langname varchar(255) DEFAULT '' NOT NULL,
- module_mode varchar(255) DEFAULT '' NOT NULL,
- module_auth varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (module_id)
-);
-
-CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id);
-CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled);
-CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id);
-
-/*
- Table: 'phpbb_poll_options'
-*/
-CREATE TABLE phpbb_poll_options (
- poll_option_id INT2 DEFAULT '0' NOT NULL,
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- poll_option_text varchar(4000) DEFAULT '' NOT NULL,
- poll_option_total INT4 DEFAULT '0' NOT NULL CHECK (poll_option_total >= 0)
-);
-
-CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options (poll_option_id);
-CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options (topic_id);
-
-/*
- Table: 'phpbb_poll_votes'
-*/
-CREATE TABLE phpbb_poll_votes (
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- poll_option_id INT2 DEFAULT '0' NOT NULL,
- vote_user_id INT4 DEFAULT '0' NOT NULL CHECK (vote_user_id >= 0),
- vote_user_ip varchar(40) DEFAULT '' NOT NULL
-);
-
-CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes (topic_id);
-CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes (vote_user_id);
-CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes (vote_user_ip);
-
-/*
- Table: 'phpbb_posts'
-*/
-CREATE SEQUENCE phpbb_posts_seq;
-
-CREATE TABLE phpbb_posts (
- post_id INT4 DEFAULT nextval('phpbb_posts_seq'),
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- poster_id INT4 DEFAULT '0' NOT NULL CHECK (poster_id >= 0),
- icon_id INT4 DEFAULT '0' NOT NULL CHECK (icon_id >= 0),
- poster_ip varchar(40) DEFAULT '' NOT NULL,
- post_time INT4 DEFAULT '0' NOT NULL CHECK (post_time >= 0),
- post_approved INT2 DEFAULT '1' NOT NULL CHECK (post_approved >= 0),
- post_reported INT2 DEFAULT '0' NOT NULL CHECK (post_reported >= 0),
- enable_bbcode INT2 DEFAULT '1' NOT NULL CHECK (enable_bbcode >= 0),
- enable_smilies INT2 DEFAULT '1' NOT NULL CHECK (enable_smilies >= 0),
- enable_magic_url INT2 DEFAULT '1' NOT NULL CHECK (enable_magic_url >= 0),
- enable_sig INT2 DEFAULT '1' NOT NULL CHECK (enable_sig >= 0),
- post_username varchar(255) DEFAULT '' NOT NULL,
- post_subject varchar(255) DEFAULT '' NOT NULL,
- post_text TEXT DEFAULT '' NOT NULL,
- post_checksum varchar(32) DEFAULT '' NOT NULL,
- post_attachment INT2 DEFAULT '0' NOT NULL CHECK (post_attachment >= 0),
- bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
- bbcode_uid varchar(8) DEFAULT '' NOT NULL,
- post_postcount INT2 DEFAULT '1' NOT NULL CHECK (post_postcount >= 0),
- post_edit_time INT4 DEFAULT '0' NOT NULL CHECK (post_edit_time >= 0),
- post_edit_reason varchar(255) DEFAULT '' NOT NULL,
- post_edit_user INT4 DEFAULT '0' NOT NULL CHECK (post_edit_user >= 0),
- post_edit_count INT2 DEFAULT '0' NOT NULL CHECK (post_edit_count >= 0),
- post_edit_locked INT2 DEFAULT '0' NOT NULL CHECK (post_edit_locked >= 0),
- PRIMARY KEY (post_id)
-);
-
-CREATE INDEX phpbb_posts_forum_id ON phpbb_posts (forum_id);
-CREATE INDEX phpbb_posts_topic_id ON phpbb_posts (topic_id);
-CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip);
-CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id);
-CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved);
-CREATE INDEX phpbb_posts_post_username ON phpbb_posts (post_username);
-CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time);
-
-/*
- Table: 'phpbb_privmsgs'
-*/
-CREATE SEQUENCE phpbb_privmsgs_seq;
-
-CREATE TABLE phpbb_privmsgs (
- msg_id INT4 DEFAULT nextval('phpbb_privmsgs_seq'),
- root_level INT4 DEFAULT '0' NOT NULL CHECK (root_level >= 0),
- author_id INT4 DEFAULT '0' NOT NULL CHECK (author_id >= 0),
- icon_id INT4 DEFAULT '0' NOT NULL CHECK (icon_id >= 0),
- author_ip varchar(40) DEFAULT '' NOT NULL,
- message_time INT4 DEFAULT '0' NOT NULL CHECK (message_time >= 0),
- enable_bbcode INT2 DEFAULT '1' NOT NULL CHECK (enable_bbcode >= 0),
- enable_smilies INT2 DEFAULT '1' NOT NULL CHECK (enable_smilies >= 0),
- enable_magic_url INT2 DEFAULT '1' NOT NULL CHECK (enable_magic_url >= 0),
- enable_sig INT2 DEFAULT '1' NOT NULL CHECK (enable_sig >= 0),
- message_subject varchar(255) DEFAULT '' NOT NULL,
- message_text TEXT DEFAULT '' NOT NULL,
- message_edit_reason varchar(255) DEFAULT '' NOT NULL,
- message_edit_user INT4 DEFAULT '0' NOT NULL CHECK (message_edit_user >= 0),
- message_attachment INT2 DEFAULT '0' NOT NULL CHECK (message_attachment >= 0),
- bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
- bbcode_uid varchar(8) DEFAULT '' NOT NULL,
- message_edit_time INT4 DEFAULT '0' NOT NULL CHECK (message_edit_time >= 0),
- message_edit_count INT2 DEFAULT '0' NOT NULL CHECK (message_edit_count >= 0),
- to_address varchar(4000) DEFAULT '' NOT NULL,
- bcc_address varchar(4000) DEFAULT '' NOT NULL,
- message_reported INT2 DEFAULT '0' NOT NULL CHECK (message_reported >= 0),
- PRIMARY KEY (msg_id)
-);
-
-CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs (author_ip);
-CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs (message_time);
-CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs (author_id);
-CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs (root_level);
-
-/*
- Table: 'phpbb_privmsgs_folder'
-*/
-CREATE SEQUENCE phpbb_privmsgs_folder_seq;
-
-CREATE TABLE phpbb_privmsgs_folder (
- folder_id INT4 DEFAULT nextval('phpbb_privmsgs_folder_seq'),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- folder_name varchar(255) DEFAULT '' NOT NULL,
- pm_count INT4 DEFAULT '0' NOT NULL CHECK (pm_count >= 0),
- PRIMARY KEY (folder_id)
-);
-
-CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id);
-
-/*
- Table: 'phpbb_privmsgs_rules'
-*/
-CREATE SEQUENCE phpbb_privmsgs_rules_seq;
-
-CREATE TABLE phpbb_privmsgs_rules (
- rule_id INT4 DEFAULT nextval('phpbb_privmsgs_rules_seq'),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- rule_check INT4 DEFAULT '0' NOT NULL CHECK (rule_check >= 0),
- rule_connection INT4 DEFAULT '0' NOT NULL CHECK (rule_connection >= 0),
- rule_string varchar(255) DEFAULT '' NOT NULL,
- rule_user_id INT4 DEFAULT '0' NOT NULL CHECK (rule_user_id >= 0),
- rule_group_id INT4 DEFAULT '0' NOT NULL CHECK (rule_group_id >= 0),
- rule_action INT4 DEFAULT '0' NOT NULL CHECK (rule_action >= 0),
- rule_folder_id INT4 DEFAULT '0' NOT NULL,
- PRIMARY KEY (rule_id)
-);
-
-CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules (user_id);
-
-/*
- Table: 'phpbb_privmsgs_to'
-*/
-CREATE TABLE phpbb_privmsgs_to (
- msg_id INT4 DEFAULT '0' NOT NULL CHECK (msg_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- author_id INT4 DEFAULT '0' NOT NULL CHECK (author_id >= 0),
- pm_deleted INT2 DEFAULT '0' NOT NULL CHECK (pm_deleted >= 0),
- pm_new INT2 DEFAULT '1' NOT NULL CHECK (pm_new >= 0),
- pm_unread INT2 DEFAULT '1' NOT NULL CHECK (pm_unread >= 0),
- pm_replied INT2 DEFAULT '0' NOT NULL CHECK (pm_replied >= 0),
- pm_marked INT2 DEFAULT '0' NOT NULL CHECK (pm_marked >= 0),
- pm_forwarded INT2 DEFAULT '0' NOT NULL CHECK (pm_forwarded >= 0),
- folder_id INT4 DEFAULT '0' NOT NULL
-);
-
-CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id);
-CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to (author_id);
-CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folder_id);
-
-/*
- Table: 'phpbb_profile_fields'
-*/
-CREATE SEQUENCE phpbb_profile_fields_seq;
-
-CREATE TABLE phpbb_profile_fields (
- field_id INT4 DEFAULT nextval('phpbb_profile_fields_seq'),
- field_name varchar(255) DEFAULT '' NOT NULL,
- field_type INT2 DEFAULT '0' NOT NULL,
- field_ident varchar(20) DEFAULT '' NOT NULL,
- field_length varchar(20) DEFAULT '' NOT NULL,
- field_minlen varchar(255) DEFAULT '' NOT NULL,
- field_maxlen varchar(255) DEFAULT '' NOT NULL,
- field_novalue varchar(255) DEFAULT '' NOT NULL,
- field_default_value varchar(255) DEFAULT '' NOT NULL,
- field_validation varchar(20) DEFAULT '' NOT NULL,
- field_required INT2 DEFAULT '0' NOT NULL CHECK (field_required >= 0),
- field_show_novalue INT2 DEFAULT '0' NOT NULL CHECK (field_show_novalue >= 0),
- field_show_on_reg INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_reg >= 0),
- field_show_on_pm INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_pm >= 0),
- field_show_on_vt INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_vt >= 0),
- field_show_profile INT2 DEFAULT '0' NOT NULL CHECK (field_show_profile >= 0),
- field_hide INT2 DEFAULT '0' NOT NULL CHECK (field_hide >= 0),
- field_no_view INT2 DEFAULT '0' NOT NULL CHECK (field_no_view >= 0),
- field_active INT2 DEFAULT '0' NOT NULL CHECK (field_active >= 0),
- field_order INT4 DEFAULT '0' NOT NULL CHECK (field_order >= 0),
- PRIMARY KEY (field_id)
-);
-
-CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields (field_type);
-CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields (field_order);
-
-/*
- Table: 'phpbb_profile_fields_data'
-*/
-CREATE TABLE phpbb_profile_fields_data (
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- PRIMARY KEY (user_id)
-);
-
-
-/*
- Table: 'phpbb_profile_fields_lang'
-*/
-CREATE TABLE phpbb_profile_fields_lang (
- field_id INT4 DEFAULT '0' NOT NULL CHECK (field_id >= 0),
- lang_id INT4 DEFAULT '0' NOT NULL CHECK (lang_id >= 0),
- option_id INT4 DEFAULT '0' NOT NULL CHECK (option_id >= 0),
- field_type INT2 DEFAULT '0' NOT NULL,
- lang_value varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (field_id, lang_id, option_id)
-);
-
-
-/*
- Table: 'phpbb_profile_lang'
-*/
-CREATE TABLE phpbb_profile_lang (
- field_id INT4 DEFAULT '0' NOT NULL CHECK (field_id >= 0),
- lang_id INT4 DEFAULT '0' NOT NULL CHECK (lang_id >= 0),
- lang_name varchar(255) DEFAULT '' NOT NULL,
- lang_explain varchar(4000) DEFAULT '' NOT NULL,
- lang_default_value varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (field_id, lang_id)
-);
-
-
-/*
- Table: 'phpbb_ranks'
-*/
-CREATE SEQUENCE phpbb_ranks_seq;
-
-CREATE TABLE phpbb_ranks (
- rank_id INT4 DEFAULT nextval('phpbb_ranks_seq'),
- rank_title varchar(255) DEFAULT '' NOT NULL,
- rank_min INT4 DEFAULT '0' NOT NULL CHECK (rank_min >= 0),
- rank_special INT2 DEFAULT '0' NOT NULL CHECK (rank_special >= 0),
- rank_image varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (rank_id)
-);
-
-
-/*
- Table: 'phpbb_reports'
-*/
-CREATE SEQUENCE phpbb_reports_seq;
-
-CREATE TABLE phpbb_reports (
- report_id INT4 DEFAULT nextval('phpbb_reports_seq'),
- reason_id INT2 DEFAULT '0' NOT NULL CHECK (reason_id >= 0),
- post_id INT4 DEFAULT '0' NOT NULL CHECK (post_id >= 0),
- pm_id INT4 DEFAULT '0' NOT NULL CHECK (pm_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- user_notify INT2 DEFAULT '0' NOT NULL CHECK (user_notify >= 0),
- report_closed INT2 DEFAULT '0' NOT NULL CHECK (report_closed >= 0),
- report_time INT4 DEFAULT '0' NOT NULL CHECK (report_time >= 0),
- report_text TEXT DEFAULT '' NOT NULL,
- reported_post_text TEXT DEFAULT '' NOT NULL,
- PRIMARY KEY (report_id)
-);
-
-CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id);
-CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id);
-
-/*
- Table: 'phpbb_reports_reasons'
-*/
-CREATE SEQUENCE phpbb_reports_reasons_seq;
-
-CREATE TABLE phpbb_reports_reasons (
- reason_id INT2 DEFAULT nextval('phpbb_reports_reasons_seq'),
- reason_title varchar(255) DEFAULT '' NOT NULL,
- reason_description TEXT DEFAULT '' NOT NULL,
- reason_order INT2 DEFAULT '0' NOT NULL CHECK (reason_order >= 0),
- PRIMARY KEY (reason_id)
-);
-
-
-/*
- Table: 'phpbb_search_results'
-*/
-CREATE TABLE phpbb_search_results (
- search_key varchar(32) DEFAULT '' NOT NULL,
- search_time INT4 DEFAULT '0' NOT NULL CHECK (search_time >= 0),
- search_keywords TEXT DEFAULT '' NOT NULL,
- search_authors TEXT DEFAULT '' NOT NULL,
- PRIMARY KEY (search_key)
-);
-
-
-/*
- Table: 'phpbb_search_wordlist'
-*/
-CREATE SEQUENCE phpbb_search_wordlist_seq;
-
-CREATE TABLE phpbb_search_wordlist (
- word_id INT4 DEFAULT nextval('phpbb_search_wordlist_seq'),
- word_text varchar(255) DEFAULT '' NOT NULL,
- word_common INT2 DEFAULT '0' NOT NULL CHECK (word_common >= 0),
- word_count INT4 DEFAULT '0' NOT NULL CHECK (word_count >= 0),
- PRIMARY KEY (word_id)
-);
-
-CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist (word_text);
-CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist (word_count);
-
-/*
- Table: 'phpbb_search_wordmatch'
-*/
-CREATE TABLE phpbb_search_wordmatch (
- post_id INT4 DEFAULT '0' NOT NULL CHECK (post_id >= 0),
- word_id INT4 DEFAULT '0' NOT NULL CHECK (word_id >= 0),
- title_match INT2 DEFAULT '0' NOT NULL CHECK (title_match >= 0)
-);
-
-CREATE UNIQUE INDEX phpbb_search_wordmatch_unq_mtch ON phpbb_search_wordmatch (word_id, post_id, title_match);
-CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id);
-CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id);
-
-/*
- Table: 'phpbb_sessions'
-*/
-CREATE TABLE phpbb_sessions (
- session_id char(32) DEFAULT '' NOT NULL,
- session_user_id INT4 DEFAULT '0' NOT NULL CHECK (session_user_id >= 0),
- session_forum_id INT4 DEFAULT '0' NOT NULL CHECK (session_forum_id >= 0),
- session_last_visit INT4 DEFAULT '0' NOT NULL CHECK (session_last_visit >= 0),
- session_start INT4 DEFAULT '0' NOT NULL CHECK (session_start >= 0),
- session_time INT4 DEFAULT '0' NOT NULL CHECK (session_time >= 0),
- session_ip varchar(40) DEFAULT '' NOT NULL,
- session_browser varchar(150) DEFAULT '' NOT NULL,
- session_forwarded_for varchar(255) DEFAULT '' NOT NULL,
- session_page varchar(255) DEFAULT '' NOT NULL,
- session_viewonline INT2 DEFAULT '1' NOT NULL CHECK (session_viewonline >= 0),
- session_autologin INT2 DEFAULT '0' NOT NULL CHECK (session_autologin >= 0),
- session_admin INT2 DEFAULT '0' NOT NULL CHECK (session_admin >= 0),
- PRIMARY KEY (session_id)
-);
-
-CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions (session_time);
-CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions (session_user_id);
-CREATE INDEX phpbb_sessions_session_fid ON phpbb_sessions (session_forum_id);
-
-/*
- Table: 'phpbb_sessions_keys'
-*/
-CREATE TABLE phpbb_sessions_keys (
- key_id char(32) DEFAULT '' NOT NULL,
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- last_ip varchar(40) DEFAULT '' NOT NULL,
- last_login INT4 DEFAULT '0' NOT NULL CHECK (last_login >= 0),
- PRIMARY KEY (key_id, user_id)
-);
-
-CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login);
-
-/*
- Table: 'phpbb_sitelist'
-*/
-CREATE SEQUENCE phpbb_sitelist_seq;
-
-CREATE TABLE phpbb_sitelist (
- site_id INT4 DEFAULT nextval('phpbb_sitelist_seq'),
- site_ip varchar(40) DEFAULT '' NOT NULL,
- site_hostname varchar(255) DEFAULT '' NOT NULL,
- ip_exclude INT2 DEFAULT '0' NOT NULL CHECK (ip_exclude >= 0),
- PRIMARY KEY (site_id)
-);
-
-
-/*
- Table: 'phpbb_smilies'
-*/
-CREATE SEQUENCE phpbb_smilies_seq;
-
-CREATE TABLE phpbb_smilies (
- smiley_id INT4 DEFAULT nextval('phpbb_smilies_seq'),
- code varchar(50) DEFAULT '' NOT NULL,
- emotion varchar(50) DEFAULT '' NOT NULL,
- smiley_url varchar(50) DEFAULT '' NOT NULL,
- smiley_width INT2 DEFAULT '0' NOT NULL CHECK (smiley_width >= 0),
- smiley_height INT2 DEFAULT '0' NOT NULL CHECK (smiley_height >= 0),
- smiley_order INT4 DEFAULT '0' NOT NULL CHECK (smiley_order >= 0),
- display_on_posting INT2 DEFAULT '1' NOT NULL CHECK (display_on_posting >= 0),
- PRIMARY KEY (smiley_id)
-);
-
-CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting);
-
-/*
- Table: 'phpbb_styles'
-*/
-CREATE SEQUENCE phpbb_styles_seq;
-
-CREATE TABLE phpbb_styles (
- style_id INT4 DEFAULT nextval('phpbb_styles_seq'),
- style_name varchar(255) DEFAULT '' NOT NULL,
- style_copyright varchar(255) DEFAULT '' NOT NULL,
- style_active INT2 DEFAULT '1' NOT NULL CHECK (style_active >= 0),
- style_path varchar(100) DEFAULT '' NOT NULL,
- bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL,
- style_parent_id INT4 DEFAULT '0' NOT NULL CHECK (style_parent_id >= 0),
- style_parent_tree varchar(8000) DEFAULT '' NOT NULL,
- PRIMARY KEY (style_id)
-);
-
-CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name);
-
-/*
- Table: 'phpbb_topics'
-*/
-CREATE SEQUENCE phpbb_topics_seq;
-
-CREATE TABLE phpbb_topics (
- topic_id INT4 DEFAULT nextval('phpbb_topics_seq'),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- icon_id INT4 DEFAULT '0' NOT NULL CHECK (icon_id >= 0),
- topic_attachment INT2 DEFAULT '0' NOT NULL CHECK (topic_attachment >= 0),
- topic_approved INT2 DEFAULT '1' NOT NULL CHECK (topic_approved >= 0),
- topic_reported INT2 DEFAULT '0' NOT NULL CHECK (topic_reported >= 0),
- topic_title varchar(255) DEFAULT '' NOT NULL,
- topic_poster INT4 DEFAULT '0' NOT NULL CHECK (topic_poster >= 0),
- topic_time INT4 DEFAULT '0' NOT NULL CHECK (topic_time >= 0),
- topic_time_limit INT4 DEFAULT '0' NOT NULL CHECK (topic_time_limit >= 0),
- topic_views INT4 DEFAULT '0' NOT NULL CHECK (topic_views >= 0),
- topic_replies INT4 DEFAULT '0' NOT NULL CHECK (topic_replies >= 0),
- topic_replies_real INT4 DEFAULT '0' NOT NULL CHECK (topic_replies_real >= 0),
- topic_status INT2 DEFAULT '0' NOT NULL,
- topic_type INT2 DEFAULT '0' NOT NULL,
- topic_first_post_id INT4 DEFAULT '0' NOT NULL CHECK (topic_first_post_id >= 0),
- topic_first_poster_name varchar(255) DEFAULT '' NOT NULL,
- topic_first_poster_colour varchar(6) DEFAULT '' NOT NULL,
- topic_last_post_id INT4 DEFAULT '0' NOT NULL CHECK (topic_last_post_id >= 0),
- topic_last_poster_id INT4 DEFAULT '0' NOT NULL CHECK (topic_last_poster_id >= 0),
- topic_last_poster_name varchar(255) DEFAULT '' NOT NULL,
- topic_last_poster_colour varchar(6) DEFAULT '' NOT NULL,
- topic_last_post_subject varchar(255) DEFAULT '' NOT NULL,
- topic_last_post_time INT4 DEFAULT '0' NOT NULL CHECK (topic_last_post_time >= 0),
- topic_last_view_time INT4 DEFAULT '0' NOT NULL CHECK (topic_last_view_time >= 0),
- topic_moved_id INT4 DEFAULT '0' NOT NULL CHECK (topic_moved_id >= 0),
- topic_bumped INT2 DEFAULT '0' NOT NULL CHECK (topic_bumped >= 0),
- topic_bumper INT4 DEFAULT '0' NOT NULL CHECK (topic_bumper >= 0),
- poll_title varchar(255) DEFAULT '' NOT NULL,
- poll_start INT4 DEFAULT '0' NOT NULL CHECK (poll_start >= 0),
- poll_length INT4 DEFAULT '0' NOT NULL CHECK (poll_length >= 0),
- poll_max_options INT2 DEFAULT '1' NOT NULL,
- poll_last_vote INT4 DEFAULT '0' NOT NULL CHECK (poll_last_vote >= 0),
- poll_vote_change INT2 DEFAULT '0' NOT NULL CHECK (poll_vote_change >= 0),
- PRIMARY KEY (topic_id)
-);
-
-CREATE INDEX phpbb_topics_forum_id ON phpbb_topics (forum_id);
-CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics (forum_id, topic_type);
-CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics (topic_last_post_time);
-CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics (topic_approved);
-CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics (forum_id, topic_approved, topic_last_post_id);
-CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id);
-
-/*
- Table: 'phpbb_topics_track'
-*/
-CREATE TABLE phpbb_topics_track (
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
- mark_time INT4 DEFAULT '0' NOT NULL CHECK (mark_time >= 0),
- PRIMARY KEY (user_id, topic_id)
-);
-
-CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id);
-CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id);
-
-/*
- Table: 'phpbb_topics_posted'
-*/
-CREATE TABLE phpbb_topics_posted (
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- topic_posted INT2 DEFAULT '0' NOT NULL CHECK (topic_posted >= 0),
- PRIMARY KEY (user_id, topic_id)
-);
-
-
-/*
- Table: 'phpbb_topics_watch'
-*/
-CREATE TABLE phpbb_topics_watch (
- topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- notify_status INT2 DEFAULT '0' NOT NULL CHECK (notify_status >= 0)
-);
-
-CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch (topic_id);
-CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch (user_id);
-CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status);
-
-/*
- Table: 'phpbb_user_group'
-*/
-CREATE TABLE phpbb_user_group (
- group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- group_leader INT2 DEFAULT '0' NOT NULL CHECK (group_leader >= 0),
- user_pending INT2 DEFAULT '1' NOT NULL CHECK (user_pending >= 0)
-);
-
-CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group (group_id);
-CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group (user_id);
-CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group (group_leader);
-
-/*
- Table: 'phpbb_users'
-*/
-CREATE SEQUENCE phpbb_users_seq;
-
-CREATE TABLE phpbb_users (
- user_id INT4 DEFAULT nextval('phpbb_users_seq'),
- user_type INT2 DEFAULT '0' NOT NULL,
- group_id INT4 DEFAULT '3' NOT NULL CHECK (group_id >= 0),
- user_permissions TEXT DEFAULT '' NOT NULL,
- user_perm_from INT4 DEFAULT '0' NOT NULL CHECK (user_perm_from >= 0),
- user_ip varchar(40) DEFAULT '' NOT NULL,
- user_regdate INT4 DEFAULT '0' NOT NULL CHECK (user_regdate >= 0),
- username varchar_ci DEFAULT '' NOT NULL,
- username_clean varchar_ci DEFAULT '' NOT NULL,
- user_password varchar(40) DEFAULT '' NOT NULL,
- user_passchg INT4 DEFAULT '0' NOT NULL CHECK (user_passchg >= 0),
- user_pass_convert INT2 DEFAULT '0' NOT NULL CHECK (user_pass_convert >= 0),
- user_email varchar(100) DEFAULT '' NOT NULL,
- user_email_hash INT8 DEFAULT '0' NOT NULL,
- user_birthday varchar(10) DEFAULT '' NOT NULL,
- user_lastvisit INT4 DEFAULT '0' NOT NULL CHECK (user_lastvisit >= 0),
- user_lastmark INT4 DEFAULT '0' NOT NULL CHECK (user_lastmark >= 0),
- user_lastpost_time INT4 DEFAULT '0' NOT NULL CHECK (user_lastpost_time >= 0),
- user_lastpage varchar(200) DEFAULT '' NOT NULL,
- user_last_confirm_key varchar(10) DEFAULT '' NOT NULL,
- user_last_search INT4 DEFAULT '0' NOT NULL CHECK (user_last_search >= 0),
- user_warnings INT2 DEFAULT '0' NOT NULL,
- user_last_warning INT4 DEFAULT '0' NOT NULL CHECK (user_last_warning >= 0),
- user_login_attempts INT2 DEFAULT '0' NOT NULL,
- user_inactive_reason INT2 DEFAULT '0' NOT NULL,
- user_inactive_time INT4 DEFAULT '0' NOT NULL CHECK (user_inactive_time >= 0),
- user_posts INT4 DEFAULT '0' NOT NULL CHECK (user_posts >= 0),
- user_lang varchar(30) DEFAULT '' NOT NULL,
- user_timezone varchar(100) DEFAULT 'UTC' NOT NULL,
- user_dateformat varchar(30) DEFAULT 'd M Y H:i' NOT NULL,
- user_style INT4 DEFAULT '0' NOT NULL CHECK (user_style >= 0),
- user_rank INT4 DEFAULT '0' NOT NULL CHECK (user_rank >= 0),
- user_colour varchar(6) DEFAULT '' NOT NULL,
- user_new_privmsg INT4 DEFAULT '0' NOT NULL,
- user_unread_privmsg INT4 DEFAULT '0' NOT NULL,
- user_last_privmsg INT4 DEFAULT '0' NOT NULL CHECK (user_last_privmsg >= 0),
- user_message_rules INT2 DEFAULT '0' NOT NULL CHECK (user_message_rules >= 0),
- user_full_folder INT4 DEFAULT '-3' NOT NULL,
- user_emailtime INT4 DEFAULT '0' NOT NULL CHECK (user_emailtime >= 0),
- user_topic_show_days INT2 DEFAULT '0' NOT NULL CHECK (user_topic_show_days >= 0),
- user_topic_sortby_type varchar(1) DEFAULT 't' NOT NULL,
- user_topic_sortby_dir varchar(1) DEFAULT 'd' NOT NULL,
- user_post_show_days INT2 DEFAULT '0' NOT NULL CHECK (user_post_show_days >= 0),
- user_post_sortby_type varchar(1) DEFAULT 't' NOT NULL,
- user_post_sortby_dir varchar(1) DEFAULT 'a' NOT NULL,
- user_notify INT2 DEFAULT '0' NOT NULL CHECK (user_notify >= 0),
- user_notify_pm INT2 DEFAULT '1' NOT NULL CHECK (user_notify_pm >= 0),
- user_notify_type INT2 DEFAULT '0' NOT NULL,
- user_allow_pm INT2 DEFAULT '1' NOT NULL CHECK (user_allow_pm >= 0),
- user_allow_viewonline INT2 DEFAULT '1' NOT NULL CHECK (user_allow_viewonline >= 0),
- user_allow_viewemail INT2 DEFAULT '1' NOT NULL CHECK (user_allow_viewemail >= 0),
- user_allow_massemail INT2 DEFAULT '1' NOT NULL CHECK (user_allow_massemail >= 0),
- user_options INT4 DEFAULT '230271' NOT NULL CHECK (user_options >= 0),
- user_avatar varchar(255) DEFAULT '' NOT NULL,
- user_avatar_type INT2 DEFAULT '0' NOT NULL,
- user_avatar_width INT2 DEFAULT '0' NOT NULL CHECK (user_avatar_width >= 0),
- user_avatar_height INT2 DEFAULT '0' NOT NULL CHECK (user_avatar_height >= 0),
- user_sig TEXT DEFAULT '' NOT NULL,
- user_sig_bbcode_uid varchar(8) DEFAULT '' NOT NULL,
- user_sig_bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
- user_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(4000) DEFAULT '' NOT NULL,
- user_interests varchar(4000) DEFAULT '' NOT NULL,
- user_actkey varchar(32) DEFAULT '' NOT NULL,
- user_newpasswd varchar(40) DEFAULT '' NOT NULL,
- user_form_salt varchar(32) DEFAULT '' NOT NULL,
- user_new INT2 DEFAULT '1' NOT NULL CHECK (user_new >= 0),
- user_reminded INT2 DEFAULT '0' NOT NULL,
- user_reminded_time INT4 DEFAULT '0' NOT NULL CHECK (user_reminded_time >= 0),
- PRIMARY KEY (user_id)
-);
-
-CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday);
-CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash);
-CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type);
-CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users (username_clean);
-
-/*
- Table: 'phpbb_warnings'
-*/
-CREATE SEQUENCE phpbb_warnings_seq;
-
-CREATE TABLE phpbb_warnings (
- warning_id INT4 DEFAULT nextval('phpbb_warnings_seq'),
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- post_id INT4 DEFAULT '0' NOT NULL CHECK (post_id >= 0),
- log_id INT4 DEFAULT '0' NOT NULL CHECK (log_id >= 0),
- warning_time INT4 DEFAULT '0' NOT NULL CHECK (warning_time >= 0),
- PRIMARY KEY (warning_id)
-);
-
-
-/*
- Table: 'phpbb_words'
-*/
-CREATE SEQUENCE phpbb_words_seq;
-
-CREATE TABLE phpbb_words (
- word_id INT4 DEFAULT nextval('phpbb_words_seq'),
- word varchar(255) DEFAULT '' NOT NULL,
- replacement varchar(255) DEFAULT '' NOT NULL,
- PRIMARY KEY (word_id)
-);
-
-
-/*
- Table: 'phpbb_zebra'
-*/
-CREATE TABLE phpbb_zebra (
- user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
- zebra_id INT4 DEFAULT '0' NOT NULL CHECK (zebra_id >= 0),
- friend INT2 DEFAULT '0' NOT NULL CHECK (friend >= 0),
- foe INT2 DEFAULT '0' NOT NULL CHECK (foe >= 0),
- PRIMARY KEY (user_id, zebra_id)
-);
-
-
-
-COMMIT; \ No newline at end of file
+/*
+ * DO NOT EDIT THIS FILE, IT IS GENERATED
+ *
+ * To change the contents of this file, edit
+ * phpBB/develop/create_schema_files.php and
+ * run it.
+ */
+
+BEGIN;
+
+/*
+ Domain definition
+*/
+CREATE DOMAIN varchar_ci AS varchar(255) NOT NULL DEFAULT ''::character varying;
+
+/*
+ Operation Functions
+*/
+CREATE FUNCTION _varchar_ci_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) = LOWER($2)' LANGUAGE SQL STRICT;
+CREATE FUNCTION _varchar_ci_not_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) != LOWER($2)' LANGUAGE SQL STRICT;
+CREATE FUNCTION _varchar_ci_less_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) < LOWER($2)' LANGUAGE SQL STRICT;
+CREATE FUNCTION _varchar_ci_less_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) <= LOWER($2)' LANGUAGE SQL STRICT;
+CREATE FUNCTION _varchar_ci_greater_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) > LOWER($2)' LANGUAGE SQL STRICT;
+CREATE FUNCTION _varchar_ci_greater_equals(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) >= LOWER($2)' LANGUAGE SQL STRICT;
+
+/*
+ Operators
+*/
+CREATE OPERATOR <(
+ PROCEDURE = _varchar_ci_less_than,
+ LEFTARG = varchar_ci,
+ RIGHTARG = varchar_ci,
+ COMMUTATOR = >,
+ NEGATOR = >=,
+ RESTRICT = scalarltsel,
+ JOIN = scalarltjoinsel);
+
+CREATE OPERATOR <=(
+ PROCEDURE = _varchar_ci_less_equal,
+ LEFTARG = varchar_ci,
+ RIGHTARG = varchar_ci,
+ COMMUTATOR = >=,
+ NEGATOR = >,
+ RESTRICT = scalarltsel,
+ JOIN = scalarltjoinsel);
+
+CREATE OPERATOR >(
+ PROCEDURE = _varchar_ci_greater_than,
+ LEFTARG = varchar_ci,
+ RIGHTARG = varchar_ci,
+ COMMUTATOR = <,
+ NEGATOR = <=,
+ RESTRICT = scalargtsel,
+ JOIN = scalargtjoinsel);
+
+CREATE OPERATOR >=(
+ PROCEDURE = _varchar_ci_greater_equals,
+ LEFTARG = varchar_ci,
+ RIGHTARG = varchar_ci,
+ COMMUTATOR = <=,
+ NEGATOR = <,
+ RESTRICT = scalargtsel,
+ JOIN = scalargtjoinsel);
+
+CREATE OPERATOR <>(
+ PROCEDURE = _varchar_ci_not_equal,
+ LEFTARG = varchar_ci,
+ RIGHTARG = varchar_ci,
+ COMMUTATOR = <>,
+ NEGATOR = =,
+ RESTRICT = neqsel,
+ JOIN = neqjoinsel);
+
+CREATE OPERATOR =(
+ PROCEDURE = _varchar_ci_equal,
+ LEFTARG = varchar_ci,
+ RIGHTARG = varchar_ci,
+ COMMUTATOR = =,
+ NEGATOR = <>,
+ RESTRICT = eqsel,
+ JOIN = eqjoinsel,
+ HASHES,
+ MERGES,
+ SORT1= <);
+
+/*
+ Table: 'phpbb_attachments'
+*/
+CREATE SEQUENCE phpbb_attachments_seq;
+
+CREATE TABLE phpbb_attachments (
+ attach_id INT4 DEFAULT nextval('phpbb_attachments_seq'),
+ post_msg_id INT4 DEFAULT '0' NOT NULL CHECK (post_msg_id >= 0),
+ topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+ in_message INT2 DEFAULT '0' NOT NULL CHECK (in_message >= 0),
+ poster_id INT4 DEFAULT '0' NOT NULL CHECK (poster_id >= 0),
+ is_orphan INT2 DEFAULT '1' NOT NULL CHECK (is_orphan >= 0),
+ physical_filename varchar(255) DEFAULT '' NOT NULL,
+ real_filename varchar(255) DEFAULT '' NOT NULL,
+ download_count INT4 DEFAULT '0' NOT NULL CHECK (download_count >= 0),
+ attach_comment varchar(4000) DEFAULT '' NOT NULL,
+ extension varchar(100) DEFAULT '' NOT NULL,
+ mimetype varchar(100) DEFAULT '' NOT NULL,
+ filesize INT4 DEFAULT '0' NOT NULL CHECK (filesize >= 0),
+ filetime INT4 DEFAULT '0' NOT NULL CHECK (filetime >= 0),
+ thumbnail INT2 DEFAULT '0' NOT NULL CHECK (thumbnail >= 0),
+ PRIMARY KEY (attach_id)
+);
+
+CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments (filetime);
+CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments (post_msg_id);
+CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments (topic_id);
+CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id);
+CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments (is_orphan);
+
+/*
+ Table: 'phpbb_acl_groups'
+*/
+CREATE TABLE phpbb_acl_groups (
+ group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0),
+ forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+ auth_option_id INT4 DEFAULT '0' NOT NULL CHECK (auth_option_id >= 0),
+ auth_role_id INT4 DEFAULT '0' NOT NULL CHECK (auth_role_id >= 0),
+ auth_setting INT2 DEFAULT '0' NOT NULL
+);
+
+CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups (group_id);
+CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups (auth_option_id);
+CREATE INDEX phpbb_acl_groups_auth_role_id ON phpbb_acl_groups (auth_role_id);
+
+/*
+ Table: 'phpbb_acl_options'
+*/
+CREATE SEQUENCE phpbb_acl_options_seq;
+
+CREATE TABLE phpbb_acl_options (
+ auth_option_id INT4 DEFAULT nextval('phpbb_acl_options_seq'),
+ auth_option varchar(50) DEFAULT '' NOT NULL,
+ is_global INT2 DEFAULT '0' NOT NULL CHECK (is_global >= 0),
+ is_local INT2 DEFAULT '0' NOT NULL CHECK (is_local >= 0),
+ founder_only INT2 DEFAULT '0' NOT NULL CHECK (founder_only >= 0),
+ PRIMARY KEY (auth_option_id)
+);
+
+CREATE UNIQUE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options (auth_option);
+
+/*
+ Table: 'phpbb_acl_roles'
+*/
+CREATE SEQUENCE phpbb_acl_roles_seq;
+
+CREATE TABLE phpbb_acl_roles (
+ role_id INT4 DEFAULT nextval('phpbb_acl_roles_seq'),
+ role_name varchar(255) DEFAULT '' NOT NULL,
+ role_description varchar(4000) DEFAULT '' NOT NULL,
+ role_type varchar(10) DEFAULT '' NOT NULL,
+ role_order INT2 DEFAULT '0' NOT NULL CHECK (role_order >= 0),
+ PRIMARY KEY (role_id)
+);
+
+CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles (role_type);
+CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles (role_order);
+
+/*
+ Table: 'phpbb_acl_roles_data'
+*/
+CREATE TABLE phpbb_acl_roles_data (
+ role_id INT4 DEFAULT '0' NOT NULL CHECK (role_id >= 0),
+ auth_option_id INT4 DEFAULT '0' NOT NULL CHECK (auth_option_id >= 0),
+ auth_setting INT2 DEFAULT '0' NOT NULL,
+ PRIMARY KEY (role_id, auth_option_id)
+);
+
+CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id);
+
+/*
+ Table: 'phpbb_acl_users'
+*/
+CREATE TABLE phpbb_acl_users (
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+ auth_option_id INT4 DEFAULT '0' NOT NULL CHECK (auth_option_id >= 0),
+ auth_role_id INT4 DEFAULT '0' NOT NULL CHECK (auth_role_id >= 0),
+ auth_setting INT2 DEFAULT '0' NOT NULL
+);
+
+CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users (user_id);
+CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users (auth_option_id);
+CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id);
+
+/*
+ Table: 'phpbb_banlist'
+*/
+CREATE SEQUENCE phpbb_banlist_seq;
+
+CREATE TABLE phpbb_banlist (
+ ban_id INT4 DEFAULT nextval('phpbb_banlist_seq'),
+ ban_userid INT4 DEFAULT '0' NOT NULL CHECK (ban_userid >= 0),
+ ban_ip varchar(40) DEFAULT '' NOT NULL,
+ ban_email varchar(100) DEFAULT '' NOT NULL,
+ ban_start INT4 DEFAULT '0' NOT NULL CHECK (ban_start >= 0),
+ ban_end INT4 DEFAULT '0' NOT NULL CHECK (ban_end >= 0),
+ ban_exclude INT2 DEFAULT '0' NOT NULL CHECK (ban_exclude >= 0),
+ ban_reason varchar(255) DEFAULT '' NOT NULL,
+ ban_give_reason varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (ban_id)
+);
+
+CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end);
+CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist (ban_userid, ban_exclude);
+CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist (ban_email, ban_exclude);
+CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist (ban_ip, ban_exclude);
+
+/*
+ Table: 'phpbb_bbcodes'
+*/
+CREATE TABLE phpbb_bbcodes (
+ bbcode_id INT2 DEFAULT '0' NOT NULL CHECK (bbcode_id >= 0),
+ bbcode_tag varchar(16) DEFAULT '' NOT NULL,
+ bbcode_helpline varchar(255) DEFAULT '' NOT NULL,
+ display_on_posting INT2 DEFAULT '0' NOT NULL CHECK (display_on_posting >= 0),
+ bbcode_match varchar(4000) DEFAULT '' NOT NULL,
+ bbcode_tpl TEXT DEFAULT '' NOT NULL,
+ first_pass_match TEXT DEFAULT '' NOT NULL,
+ first_pass_replace TEXT DEFAULT '' NOT NULL,
+ second_pass_match TEXT DEFAULT '' NOT NULL,
+ second_pass_replace TEXT DEFAULT '' NOT NULL,
+ PRIMARY KEY (bbcode_id)
+);
+
+CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting);
+
+/*
+ Table: 'phpbb_bookmarks'
+*/
+CREATE TABLE phpbb_bookmarks (
+ topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ PRIMARY KEY (topic_id, user_id)
+);
+
+
+/*
+ Table: 'phpbb_bots'
+*/
+CREATE SEQUENCE phpbb_bots_seq;
+
+CREATE TABLE phpbb_bots (
+ bot_id INT4 DEFAULT nextval('phpbb_bots_seq'),
+ bot_active INT2 DEFAULT '1' NOT NULL CHECK (bot_active >= 0),
+ bot_name varchar(255) DEFAULT '' NOT NULL,
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ bot_agent varchar(255) DEFAULT '' NOT NULL,
+ bot_ip varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (bot_id)
+);
+
+CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active);
+
+/*
+ Table: 'phpbb_config'
+*/
+CREATE TABLE phpbb_config (
+ config_name varchar(255) DEFAULT '' NOT NULL,
+ config_value varchar(255) DEFAULT '' NOT NULL,
+ is_dynamic INT2 DEFAULT '0' NOT NULL CHECK (is_dynamic >= 0),
+ PRIMARY KEY (config_name)
+);
+
+CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic);
+
+/*
+ Table: 'phpbb_confirm'
+*/
+CREATE TABLE phpbb_confirm (
+ confirm_id char(32) DEFAULT '' NOT NULL,
+ session_id char(32) DEFAULT '' NOT NULL,
+ confirm_type INT2 DEFAULT '0' NOT NULL,
+ code varchar(8) DEFAULT '' NOT NULL,
+ seed INT4 DEFAULT '0' NOT NULL CHECK (seed >= 0),
+ attempts INT4 DEFAULT '0' NOT NULL CHECK (attempts >= 0),
+ PRIMARY KEY (session_id, confirm_id)
+);
+
+CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm (confirm_type);
+
+/*
+ Table: 'phpbb_disallow'
+*/
+CREATE SEQUENCE phpbb_disallow_seq;
+
+CREATE TABLE phpbb_disallow (
+ disallow_id INT4 DEFAULT nextval('phpbb_disallow_seq'),
+ disallow_username varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (disallow_id)
+);
+
+
+/*
+ Table: 'phpbb_drafts'
+*/
+CREATE SEQUENCE phpbb_drafts_seq;
+
+CREATE TABLE phpbb_drafts (
+ draft_id INT4 DEFAULT nextval('phpbb_drafts_seq'),
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+ forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+ save_time INT4 DEFAULT '0' NOT NULL CHECK (save_time >= 0),
+ draft_subject varchar(255) DEFAULT '' NOT NULL,
+ draft_message TEXT DEFAULT '' NOT NULL,
+ PRIMARY KEY (draft_id)
+);
+
+CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time);
+
+/*
+ Table: 'phpbb_ext'
+*/
+CREATE TABLE phpbb_ext (
+ ext_name varchar(255) DEFAULT '' NOT NULL,
+ ext_active INT2 DEFAULT '0' NOT NULL CHECK (ext_active >= 0),
+ ext_state varchar(8000) DEFAULT '' NOT NULL
+);
+
+CREATE UNIQUE INDEX phpbb_ext_ext_name ON phpbb_ext (ext_name);
+
+/*
+ Table: 'phpbb_extensions'
+*/
+CREATE SEQUENCE phpbb_extensions_seq;
+
+CREATE TABLE phpbb_extensions (
+ extension_id INT4 DEFAULT nextval('phpbb_extensions_seq'),
+ group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0),
+ extension varchar(100) DEFAULT '' NOT NULL,
+ PRIMARY KEY (extension_id)
+);
+
+
+/*
+ Table: 'phpbb_extension_groups'
+*/
+CREATE SEQUENCE phpbb_extension_groups_seq;
+
+CREATE TABLE phpbb_extension_groups (
+ group_id INT4 DEFAULT nextval('phpbb_extension_groups_seq'),
+ group_name varchar(255) DEFAULT '' NOT NULL,
+ cat_id INT2 DEFAULT '0' NOT NULL,
+ allow_group INT2 DEFAULT '0' NOT NULL CHECK (allow_group >= 0),
+ download_mode INT2 DEFAULT '1' NOT NULL CHECK (download_mode >= 0),
+ upload_icon varchar(255) DEFAULT '' NOT NULL,
+ max_filesize INT4 DEFAULT '0' NOT NULL CHECK (max_filesize >= 0),
+ allowed_forums varchar(8000) DEFAULT '' NOT NULL,
+ allow_in_pm INT2 DEFAULT '0' NOT NULL CHECK (allow_in_pm >= 0),
+ PRIMARY KEY (group_id)
+);
+
+
+/*
+ Table: 'phpbb_forums'
+*/
+CREATE SEQUENCE phpbb_forums_seq;
+
+CREATE TABLE phpbb_forums (
+ forum_id INT4 DEFAULT nextval('phpbb_forums_seq'),
+ parent_id INT4 DEFAULT '0' NOT NULL CHECK (parent_id >= 0),
+ left_id INT4 DEFAULT '0' NOT NULL CHECK (left_id >= 0),
+ right_id INT4 DEFAULT '0' NOT NULL CHECK (right_id >= 0),
+ forum_parents TEXT DEFAULT '' NOT NULL,
+ forum_name varchar(255) DEFAULT '' NOT NULL,
+ forum_desc varchar(4000) DEFAULT '' NOT NULL,
+ forum_desc_bitfield varchar(255) DEFAULT '' NOT NULL,
+ forum_desc_options INT4 DEFAULT '7' NOT NULL CHECK (forum_desc_options >= 0),
+ forum_desc_uid varchar(8) DEFAULT '' NOT NULL,
+ forum_link varchar(255) DEFAULT '' NOT NULL,
+ forum_password varchar(40) DEFAULT '' NOT NULL,
+ forum_style INT4 DEFAULT '0' NOT NULL CHECK (forum_style >= 0),
+ forum_image varchar(255) DEFAULT '' NOT NULL,
+ forum_rules varchar(4000) DEFAULT '' NOT NULL,
+ forum_rules_link varchar(255) DEFAULT '' NOT NULL,
+ forum_rules_bitfield varchar(255) DEFAULT '' NOT NULL,
+ forum_rules_options INT4 DEFAULT '7' NOT NULL CHECK (forum_rules_options >= 0),
+ forum_rules_uid varchar(8) DEFAULT '' NOT NULL,
+ forum_topics_per_page INT2 DEFAULT '0' NOT NULL,
+ forum_type INT2 DEFAULT '0' NOT NULL,
+ forum_status INT2 DEFAULT '0' NOT NULL,
+ forum_posts INT4 DEFAULT '0' NOT NULL CHECK (forum_posts >= 0),
+ forum_topics INT4 DEFAULT '0' NOT NULL CHECK (forum_topics >= 0),
+ forum_topics_real INT4 DEFAULT '0' NOT NULL CHECK (forum_topics_real >= 0),
+ forum_last_post_id INT4 DEFAULT '0' NOT NULL CHECK (forum_last_post_id >= 0),
+ forum_last_poster_id INT4 DEFAULT '0' NOT NULL CHECK (forum_last_poster_id >= 0),
+ forum_last_post_subject varchar(255) DEFAULT '' NOT NULL,
+ forum_last_post_time INT4 DEFAULT '0' NOT NULL CHECK (forum_last_post_time >= 0),
+ forum_last_poster_name varchar(255) DEFAULT '' NOT NULL,
+ forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL,
+ forum_flags INT2 DEFAULT '32' NOT NULL,
+ forum_options INT4 DEFAULT '0' NOT NULL CHECK (forum_options >= 0),
+ display_subforum_list INT2 DEFAULT '1' NOT NULL CHECK (display_subforum_list >= 0),
+ display_on_index INT2 DEFAULT '1' NOT NULL CHECK (display_on_index >= 0),
+ enable_indexing INT2 DEFAULT '1' NOT NULL CHECK (enable_indexing >= 0),
+ enable_icons INT2 DEFAULT '1' NOT NULL CHECK (enable_icons >= 0),
+ enable_prune INT2 DEFAULT '0' NOT NULL CHECK (enable_prune >= 0),
+ prune_next INT4 DEFAULT '0' NOT NULL CHECK (prune_next >= 0),
+ prune_days INT4 DEFAULT '0' NOT NULL CHECK (prune_days >= 0),
+ prune_viewed INT4 DEFAULT '0' NOT NULL CHECK (prune_viewed >= 0),
+ prune_freq INT4 DEFAULT '0' NOT NULL CHECK (prune_freq >= 0),
+ PRIMARY KEY (forum_id)
+);
+
+CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums (left_id, right_id);
+CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums (forum_last_post_id);
+
+/*
+ Table: 'phpbb_forums_access'
+*/
+CREATE TABLE phpbb_forums_access (
+ forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ session_id char(32) DEFAULT '' NOT NULL,
+ PRIMARY KEY (forum_id, user_id, session_id)
+);
+
+
+/*
+ Table: 'phpbb_forums_track'
+*/
+CREATE TABLE phpbb_forums_track (
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+ mark_time INT4 DEFAULT '0' NOT NULL CHECK (mark_time >= 0),
+ PRIMARY KEY (user_id, forum_id)
+);
+
+
+/*
+ Table: 'phpbb_forums_watch'
+*/
+CREATE TABLE phpbb_forums_watch (
+ forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ notify_status INT2 DEFAULT '0' NOT NULL CHECK (notify_status >= 0)
+);
+
+CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch (forum_id);
+CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch (user_id);
+CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch (notify_status);
+
+/*
+ Table: 'phpbb_groups'
+*/
+CREATE SEQUENCE phpbb_groups_seq;
+
+CREATE TABLE phpbb_groups (
+ group_id INT4 DEFAULT nextval('phpbb_groups_seq'),
+ group_type INT2 DEFAULT '1' NOT NULL,
+ group_founder_manage INT2 DEFAULT '0' NOT NULL CHECK (group_founder_manage >= 0),
+ group_skip_auth INT2 DEFAULT '0' NOT NULL CHECK (group_skip_auth >= 0),
+ group_name varchar_ci DEFAULT '' NOT NULL,
+ group_desc varchar(4000) DEFAULT '' NOT NULL,
+ group_desc_bitfield varchar(255) DEFAULT '' NOT NULL,
+ group_desc_options INT4 DEFAULT '7' NOT NULL CHECK (group_desc_options >= 0),
+ group_desc_uid varchar(8) DEFAULT '' NOT NULL,
+ group_display INT2 DEFAULT '0' NOT NULL CHECK (group_display >= 0),
+ group_avatar varchar(255) DEFAULT '' NOT NULL,
+ group_avatar_type INT2 DEFAULT '0' NOT NULL,
+ group_avatar_width INT2 DEFAULT '0' NOT NULL CHECK (group_avatar_width >= 0),
+ group_avatar_height INT2 DEFAULT '0' NOT NULL CHECK (group_avatar_height >= 0),
+ group_rank INT4 DEFAULT '0' NOT NULL CHECK (group_rank >= 0),
+ group_colour varchar(6) DEFAULT '' NOT NULL,
+ group_sig_chars INT4 DEFAULT '0' NOT NULL CHECK (group_sig_chars >= 0),
+ group_receive_pm INT2 DEFAULT '0' NOT NULL CHECK (group_receive_pm >= 0),
+ group_message_limit INT4 DEFAULT '0' NOT NULL CHECK (group_message_limit >= 0),
+ group_max_recipients INT4 DEFAULT '0' NOT NULL CHECK (group_max_recipients >= 0),
+ group_legend INT4 DEFAULT '0' NOT NULL CHECK (group_legend >= 0),
+ group_teampage INT4 DEFAULT '0' NOT NULL CHECK (group_teampage >= 0),
+ PRIMARY KEY (group_id)
+);
+
+CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name);
+
+/*
+ Table: 'phpbb_icons'
+*/
+CREATE SEQUENCE phpbb_icons_seq;
+
+CREATE TABLE phpbb_icons (
+ icons_id INT4 DEFAULT nextval('phpbb_icons_seq'),
+ icons_url varchar(255) DEFAULT '' NOT NULL,
+ icons_width INT2 DEFAULT '0' NOT NULL,
+ icons_height INT2 DEFAULT '0' NOT NULL,
+ icons_order INT4 DEFAULT '0' NOT NULL CHECK (icons_order >= 0),
+ display_on_posting INT2 DEFAULT '1' NOT NULL CHECK (display_on_posting >= 0),
+ PRIMARY KEY (icons_id)
+);
+
+CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons (display_on_posting);
+
+/*
+ Table: 'phpbb_lang'
+*/
+CREATE SEQUENCE phpbb_lang_seq;
+
+CREATE TABLE phpbb_lang (
+ lang_id INT2 DEFAULT nextval('phpbb_lang_seq'),
+ lang_iso varchar(30) DEFAULT '' NOT NULL,
+ lang_dir varchar(30) DEFAULT '' NOT NULL,
+ lang_english_name varchar(100) DEFAULT '' NOT NULL,
+ lang_local_name varchar(255) DEFAULT '' NOT NULL,
+ lang_author varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (lang_id)
+);
+
+CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang (lang_iso);
+
+/*
+ Table: 'phpbb_log'
+*/
+CREATE SEQUENCE phpbb_log_seq;
+
+CREATE TABLE phpbb_log (
+ log_id INT4 DEFAULT nextval('phpbb_log_seq'),
+ log_type INT2 DEFAULT '0' NOT NULL,
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+ topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+ reportee_id INT4 DEFAULT '0' NOT NULL CHECK (reportee_id >= 0),
+ log_ip varchar(40) DEFAULT '' NOT NULL,
+ log_time INT4 DEFAULT '0' NOT NULL CHECK (log_time >= 0),
+ log_operation varchar(4000) DEFAULT '' NOT NULL,
+ log_data TEXT DEFAULT '' NOT NULL,
+ PRIMARY KEY (log_id)
+);
+
+CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type);
+CREATE INDEX phpbb_log_log_time ON phpbb_log (log_time);
+CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id);
+CREATE INDEX phpbb_log_topic_id ON phpbb_log (topic_id);
+CREATE INDEX phpbb_log_reportee_id ON phpbb_log (reportee_id);
+CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id);
+
+/*
+ Table: 'phpbb_login_attempts'
+*/
+CREATE TABLE phpbb_login_attempts (
+ attempt_ip varchar(40) DEFAULT '' NOT NULL,
+ attempt_browser varchar(150) DEFAULT '' NOT NULL,
+ attempt_forwarded_for varchar(255) DEFAULT '' NOT NULL,
+ attempt_time INT4 DEFAULT '0' NOT NULL CHECK (attempt_time >= 0),
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ username varchar(255) DEFAULT '0' NOT NULL,
+ username_clean varchar_ci DEFAULT '0' NOT NULL
+);
+
+CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts (attempt_ip, attempt_time);
+CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts (attempt_forwarded_for, attempt_time);
+CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts (attempt_time);
+CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts (user_id);
+
+/*
+ Table: 'phpbb_moderator_cache'
+*/
+CREATE TABLE phpbb_moderator_cache (
+ forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ username varchar(255) DEFAULT '' NOT NULL,
+ group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0),
+ group_name varchar(255) DEFAULT '' NOT NULL,
+ display_on_index INT2 DEFAULT '1' NOT NULL CHECK (display_on_index >= 0)
+);
+
+CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache (display_on_index);
+CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache (forum_id);
+
+/*
+ Table: 'phpbb_modules'
+*/
+CREATE SEQUENCE phpbb_modules_seq;
+
+CREATE TABLE phpbb_modules (
+ module_id INT4 DEFAULT nextval('phpbb_modules_seq'),
+ module_enabled INT2 DEFAULT '1' NOT NULL CHECK (module_enabled >= 0),
+ module_display INT2 DEFAULT '1' NOT NULL CHECK (module_display >= 0),
+ module_basename varchar(255) DEFAULT '' NOT NULL,
+ module_class varchar(10) DEFAULT '' NOT NULL,
+ parent_id INT4 DEFAULT '0' NOT NULL CHECK (parent_id >= 0),
+ left_id INT4 DEFAULT '0' NOT NULL CHECK (left_id >= 0),
+ right_id INT4 DEFAULT '0' NOT NULL CHECK (right_id >= 0),
+ module_langname varchar(255) DEFAULT '' NOT NULL,
+ module_mode varchar(255) DEFAULT '' NOT NULL,
+ module_auth varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (module_id)
+);
+
+CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id);
+CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled);
+CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id);
+
+/*
+ Table: 'phpbb_poll_options'
+*/
+CREATE TABLE phpbb_poll_options (
+ poll_option_id INT2 DEFAULT '0' NOT NULL,
+ topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+ poll_option_text varchar(4000) DEFAULT '' NOT NULL,
+ poll_option_total INT4 DEFAULT '0' NOT NULL CHECK (poll_option_total >= 0)
+);
+
+CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options (poll_option_id);
+CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options (topic_id);
+
+/*
+ Table: 'phpbb_poll_votes'
+*/
+CREATE TABLE phpbb_poll_votes (
+ topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+ poll_option_id INT2 DEFAULT '0' NOT NULL,
+ vote_user_id INT4 DEFAULT '0' NOT NULL CHECK (vote_user_id >= 0),
+ vote_user_ip varchar(40) DEFAULT '' NOT NULL
+);
+
+CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes (topic_id);
+CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes (vote_user_id);
+CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes (vote_user_ip);
+
+/*
+ Table: 'phpbb_posts'
+*/
+CREATE SEQUENCE phpbb_posts_seq;
+
+CREATE TABLE phpbb_posts (
+ post_id INT4 DEFAULT nextval('phpbb_posts_seq'),
+ topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+ forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+ poster_id INT4 DEFAULT '0' NOT NULL CHECK (poster_id >= 0),
+ icon_id INT4 DEFAULT '0' NOT NULL CHECK (icon_id >= 0),
+ poster_ip varchar(40) DEFAULT '' NOT NULL,
+ post_time INT4 DEFAULT '0' NOT NULL CHECK (post_time >= 0),
+ post_approved INT2 DEFAULT '1' NOT NULL CHECK (post_approved >= 0),
+ post_reported INT2 DEFAULT '0' NOT NULL CHECK (post_reported >= 0),
+ enable_bbcode INT2 DEFAULT '1' NOT NULL CHECK (enable_bbcode >= 0),
+ enable_smilies INT2 DEFAULT '1' NOT NULL CHECK (enable_smilies >= 0),
+ enable_magic_url INT2 DEFAULT '1' NOT NULL CHECK (enable_magic_url >= 0),
+ enable_sig INT2 DEFAULT '1' NOT NULL CHECK (enable_sig >= 0),
+ post_username varchar(255) DEFAULT '' NOT NULL,
+ post_subject varchar(255) DEFAULT '' NOT NULL,
+ post_text TEXT DEFAULT '' NOT NULL,
+ post_checksum varchar(32) DEFAULT '' NOT NULL,
+ post_attachment INT2 DEFAULT '0' NOT NULL CHECK (post_attachment >= 0),
+ bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
+ bbcode_uid varchar(8) DEFAULT '' NOT NULL,
+ post_postcount INT2 DEFAULT '1' NOT NULL CHECK (post_postcount >= 0),
+ post_edit_time INT4 DEFAULT '0' NOT NULL CHECK (post_edit_time >= 0),
+ post_edit_reason varchar(255) DEFAULT '' NOT NULL,
+ post_edit_user INT4 DEFAULT '0' NOT NULL CHECK (post_edit_user >= 0),
+ post_edit_count INT2 DEFAULT '0' NOT NULL CHECK (post_edit_count >= 0),
+ post_edit_locked INT2 DEFAULT '0' NOT NULL CHECK (post_edit_locked >= 0),
+ PRIMARY KEY (post_id)
+);
+
+CREATE INDEX phpbb_posts_forum_id ON phpbb_posts (forum_id);
+CREATE INDEX phpbb_posts_topic_id ON phpbb_posts (topic_id);
+CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip);
+CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id);
+CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved);
+CREATE INDEX phpbb_posts_post_username ON phpbb_posts (post_username);
+CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time);
+
+/*
+ Table: 'phpbb_privmsgs'
+*/
+CREATE SEQUENCE phpbb_privmsgs_seq;
+
+CREATE TABLE phpbb_privmsgs (
+ msg_id INT4 DEFAULT nextval('phpbb_privmsgs_seq'),
+ root_level INT4 DEFAULT '0' NOT NULL CHECK (root_level >= 0),
+ author_id INT4 DEFAULT '0' NOT NULL CHECK (author_id >= 0),
+ icon_id INT4 DEFAULT '0' NOT NULL CHECK (icon_id >= 0),
+ author_ip varchar(40) DEFAULT '' NOT NULL,
+ message_time INT4 DEFAULT '0' NOT NULL CHECK (message_time >= 0),
+ enable_bbcode INT2 DEFAULT '1' NOT NULL CHECK (enable_bbcode >= 0),
+ enable_smilies INT2 DEFAULT '1' NOT NULL CHECK (enable_smilies >= 0),
+ enable_magic_url INT2 DEFAULT '1' NOT NULL CHECK (enable_magic_url >= 0),
+ enable_sig INT2 DEFAULT '1' NOT NULL CHECK (enable_sig >= 0),
+ message_subject varchar(255) DEFAULT '' NOT NULL,
+ message_text TEXT DEFAULT '' NOT NULL,
+ message_edit_reason varchar(255) DEFAULT '' NOT NULL,
+ message_edit_user INT4 DEFAULT '0' NOT NULL CHECK (message_edit_user >= 0),
+ message_attachment INT2 DEFAULT '0' NOT NULL CHECK (message_attachment >= 0),
+ bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
+ bbcode_uid varchar(8) DEFAULT '' NOT NULL,
+ message_edit_time INT4 DEFAULT '0' NOT NULL CHECK (message_edit_time >= 0),
+ message_edit_count INT2 DEFAULT '0' NOT NULL CHECK (message_edit_count >= 0),
+ to_address varchar(4000) DEFAULT '' NOT NULL,
+ bcc_address varchar(4000) DEFAULT '' NOT NULL,
+ message_reported INT2 DEFAULT '0' NOT NULL CHECK (message_reported >= 0),
+ PRIMARY KEY (msg_id)
+);
+
+CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs (author_ip);
+CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs (message_time);
+CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs (author_id);
+CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs (root_level);
+
+/*
+ Table: 'phpbb_privmsgs_folder'
+*/
+CREATE SEQUENCE phpbb_privmsgs_folder_seq;
+
+CREATE TABLE phpbb_privmsgs_folder (
+ folder_id INT4 DEFAULT nextval('phpbb_privmsgs_folder_seq'),
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ folder_name varchar(255) DEFAULT '' NOT NULL,
+ pm_count INT4 DEFAULT '0' NOT NULL CHECK (pm_count >= 0),
+ PRIMARY KEY (folder_id)
+);
+
+CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id);
+
+/*
+ Table: 'phpbb_privmsgs_rules'
+*/
+CREATE SEQUENCE phpbb_privmsgs_rules_seq;
+
+CREATE TABLE phpbb_privmsgs_rules (
+ rule_id INT4 DEFAULT nextval('phpbb_privmsgs_rules_seq'),
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ rule_check INT4 DEFAULT '0' NOT NULL CHECK (rule_check >= 0),
+ rule_connection INT4 DEFAULT '0' NOT NULL CHECK (rule_connection >= 0),
+ rule_string varchar(255) DEFAULT '' NOT NULL,
+ rule_user_id INT4 DEFAULT '0' NOT NULL CHECK (rule_user_id >= 0),
+ rule_group_id INT4 DEFAULT '0' NOT NULL CHECK (rule_group_id >= 0),
+ rule_action INT4 DEFAULT '0' NOT NULL CHECK (rule_action >= 0),
+ rule_folder_id INT4 DEFAULT '0' NOT NULL,
+ PRIMARY KEY (rule_id)
+);
+
+CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules (user_id);
+
+/*
+ Table: 'phpbb_privmsgs_to'
+*/
+CREATE TABLE phpbb_privmsgs_to (
+ msg_id INT4 DEFAULT '0' NOT NULL CHECK (msg_id >= 0),
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ author_id INT4 DEFAULT '0' NOT NULL CHECK (author_id >= 0),
+ pm_deleted INT2 DEFAULT '0' NOT NULL CHECK (pm_deleted >= 0),
+ pm_new INT2 DEFAULT '1' NOT NULL CHECK (pm_new >= 0),
+ pm_unread INT2 DEFAULT '1' NOT NULL CHECK (pm_unread >= 0),
+ pm_replied INT2 DEFAULT '0' NOT NULL CHECK (pm_replied >= 0),
+ pm_marked INT2 DEFAULT '0' NOT NULL CHECK (pm_marked >= 0),
+ pm_forwarded INT2 DEFAULT '0' NOT NULL CHECK (pm_forwarded >= 0),
+ folder_id INT4 DEFAULT '0' NOT NULL
+);
+
+CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id);
+CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to (author_id);
+CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folder_id);
+
+/*
+ Table: 'phpbb_profile_fields'
+*/
+CREATE SEQUENCE phpbb_profile_fields_seq;
+
+CREATE TABLE phpbb_profile_fields (
+ field_id INT4 DEFAULT nextval('phpbb_profile_fields_seq'),
+ field_name varchar(255) DEFAULT '' NOT NULL,
+ field_type INT2 DEFAULT '0' NOT NULL,
+ field_ident varchar(20) DEFAULT '' NOT NULL,
+ field_length varchar(20) DEFAULT '' NOT NULL,
+ field_minlen varchar(255) DEFAULT '' NOT NULL,
+ field_maxlen varchar(255) DEFAULT '' NOT NULL,
+ field_novalue varchar(255) DEFAULT '' NOT NULL,
+ field_default_value varchar(255) DEFAULT '' NOT NULL,
+ field_validation varchar(20) DEFAULT '' NOT NULL,
+ field_required INT2 DEFAULT '0' NOT NULL CHECK (field_required >= 0),
+ field_show_novalue INT2 DEFAULT '0' NOT NULL CHECK (field_show_novalue >= 0),
+ field_show_on_reg INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_reg >= 0),
+ field_show_on_pm INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_pm >= 0),
+ field_show_on_vt INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_vt >= 0),
+ field_show_profile INT2 DEFAULT '0' NOT NULL CHECK (field_show_profile >= 0),
+ field_hide INT2 DEFAULT '0' NOT NULL CHECK (field_hide >= 0),
+ field_no_view INT2 DEFAULT '0' NOT NULL CHECK (field_no_view >= 0),
+ field_active INT2 DEFAULT '0' NOT NULL CHECK (field_active >= 0),
+ field_order INT4 DEFAULT '0' NOT NULL CHECK (field_order >= 0),
+ PRIMARY KEY (field_id)
+);
+
+CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields (field_type);
+CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields (field_order);
+
+/*
+ Table: 'phpbb_profile_fields_data'
+*/
+CREATE TABLE phpbb_profile_fields_data (
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ PRIMARY KEY (user_id)
+);
+
+
+/*
+ Table: 'phpbb_profile_fields_lang'
+*/
+CREATE TABLE phpbb_profile_fields_lang (
+ field_id INT4 DEFAULT '0' NOT NULL CHECK (field_id >= 0),
+ lang_id INT4 DEFAULT '0' NOT NULL CHECK (lang_id >= 0),
+ option_id INT4 DEFAULT '0' NOT NULL CHECK (option_id >= 0),
+ field_type INT2 DEFAULT '0' NOT NULL,
+ lang_value varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (field_id, lang_id, option_id)
+);
+
+
+/*
+ Table: 'phpbb_profile_lang'
+*/
+CREATE TABLE phpbb_profile_lang (
+ field_id INT4 DEFAULT '0' NOT NULL CHECK (field_id >= 0),
+ lang_id INT4 DEFAULT '0' NOT NULL CHECK (lang_id >= 0),
+ lang_name varchar(255) DEFAULT '' NOT NULL,
+ lang_explain varchar(4000) DEFAULT '' NOT NULL,
+ lang_default_value varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (field_id, lang_id)
+);
+
+
+/*
+ Table: 'phpbb_ranks'
+*/
+CREATE SEQUENCE phpbb_ranks_seq;
+
+CREATE TABLE phpbb_ranks (
+ rank_id INT4 DEFAULT nextval('phpbb_ranks_seq'),
+ rank_title varchar(255) DEFAULT '' NOT NULL,
+ rank_min INT4 DEFAULT '0' NOT NULL CHECK (rank_min >= 0),
+ rank_special INT2 DEFAULT '0' NOT NULL CHECK (rank_special >= 0),
+ rank_image varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (rank_id)
+);
+
+
+/*
+ Table: 'phpbb_reports'
+*/
+CREATE SEQUENCE phpbb_reports_seq;
+
+CREATE TABLE phpbb_reports (
+ report_id INT4 DEFAULT nextval('phpbb_reports_seq'),
+ reason_id INT2 DEFAULT '0' NOT NULL CHECK (reason_id >= 0),
+ post_id INT4 DEFAULT '0' NOT NULL CHECK (post_id >= 0),
+ pm_id INT4 DEFAULT '0' NOT NULL CHECK (pm_id >= 0),
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ user_notify INT2 DEFAULT '0' NOT NULL CHECK (user_notify >= 0),
+ report_closed INT2 DEFAULT '0' NOT NULL CHECK (report_closed >= 0),
+ report_time INT4 DEFAULT '0' NOT NULL CHECK (report_time >= 0),
+ report_text TEXT DEFAULT '' NOT NULL,
+ reported_post_text TEXT DEFAULT '' NOT NULL,
+ PRIMARY KEY (report_id)
+);
+
+CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id);
+CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id);
+
+/*
+ Table: 'phpbb_reports_reasons'
+*/
+CREATE SEQUENCE phpbb_reports_reasons_seq;
+
+CREATE TABLE phpbb_reports_reasons (
+ reason_id INT2 DEFAULT nextval('phpbb_reports_reasons_seq'),
+ reason_title varchar(255) DEFAULT '' NOT NULL,
+ reason_description TEXT DEFAULT '' NOT NULL,
+ reason_order INT2 DEFAULT '0' NOT NULL CHECK (reason_order >= 0),
+ PRIMARY KEY (reason_id)
+);
+
+
+/*
+ Table: 'phpbb_search_results'
+*/
+CREATE TABLE phpbb_search_results (
+ search_key varchar(32) DEFAULT '' NOT NULL,
+ search_time INT4 DEFAULT '0' NOT NULL CHECK (search_time >= 0),
+ search_keywords TEXT DEFAULT '' NOT NULL,
+ search_authors TEXT DEFAULT '' NOT NULL,
+ PRIMARY KEY (search_key)
+);
+
+
+/*
+ Table: 'phpbb_search_wordlist'
+*/
+CREATE SEQUENCE phpbb_search_wordlist_seq;
+
+CREATE TABLE phpbb_search_wordlist (
+ word_id INT4 DEFAULT nextval('phpbb_search_wordlist_seq'),
+ word_text varchar(255) DEFAULT '' NOT NULL,
+ word_common INT2 DEFAULT '0' NOT NULL CHECK (word_common >= 0),
+ word_count INT4 DEFAULT '0' NOT NULL CHECK (word_count >= 0),
+ PRIMARY KEY (word_id)
+);
+
+CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist (word_text);
+CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist (word_count);
+
+/*
+ Table: 'phpbb_search_wordmatch'
+*/
+CREATE TABLE phpbb_search_wordmatch (
+ post_id INT4 DEFAULT '0' NOT NULL CHECK (post_id >= 0),
+ word_id INT4 DEFAULT '0' NOT NULL CHECK (word_id >= 0),
+ title_match INT2 DEFAULT '0' NOT NULL CHECK (title_match >= 0)
+);
+
+CREATE UNIQUE INDEX phpbb_search_wordmatch_unq_mtch ON phpbb_search_wordmatch (word_id, post_id, title_match);
+CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id);
+CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id);
+
+/*
+ Table: 'phpbb_sessions'
+*/
+CREATE TABLE phpbb_sessions (
+ session_id char(32) DEFAULT '' NOT NULL,
+ session_user_id INT4 DEFAULT '0' NOT NULL CHECK (session_user_id >= 0),
+ session_forum_id INT4 DEFAULT '0' NOT NULL CHECK (session_forum_id >= 0),
+ session_last_visit INT4 DEFAULT '0' NOT NULL CHECK (session_last_visit >= 0),
+ session_start INT4 DEFAULT '0' NOT NULL CHECK (session_start >= 0),
+ session_time INT4 DEFAULT '0' NOT NULL CHECK (session_time >= 0),
+ session_ip varchar(40) DEFAULT '' NOT NULL,
+ session_browser varchar(150) DEFAULT '' NOT NULL,
+ session_forwarded_for varchar(255) DEFAULT '' NOT NULL,
+ session_page varchar(255) DEFAULT '' NOT NULL,
+ session_viewonline INT2 DEFAULT '1' NOT NULL CHECK (session_viewonline >= 0),
+ session_autologin INT2 DEFAULT '0' NOT NULL CHECK (session_autologin >= 0),
+ session_admin INT2 DEFAULT '0' NOT NULL CHECK (session_admin >= 0),
+ PRIMARY KEY (session_id)
+);
+
+CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions (session_time);
+CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions (session_user_id);
+CREATE INDEX phpbb_sessions_session_fid ON phpbb_sessions (session_forum_id);
+
+/*
+ Table: 'phpbb_sessions_keys'
+*/
+CREATE TABLE phpbb_sessions_keys (
+ key_id char(32) DEFAULT '' NOT NULL,
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ last_ip varchar(40) DEFAULT '' NOT NULL,
+ last_login INT4 DEFAULT '0' NOT NULL CHECK (last_login >= 0),
+ PRIMARY KEY (key_id, user_id)
+);
+
+CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login);
+
+/*
+ Table: 'phpbb_sitelist'
+*/
+CREATE SEQUENCE phpbb_sitelist_seq;
+
+CREATE TABLE phpbb_sitelist (
+ site_id INT4 DEFAULT nextval('phpbb_sitelist_seq'),
+ site_ip varchar(40) DEFAULT '' NOT NULL,
+ site_hostname varchar(255) DEFAULT '' NOT NULL,
+ ip_exclude INT2 DEFAULT '0' NOT NULL CHECK (ip_exclude >= 0),
+ PRIMARY KEY (site_id)
+);
+
+
+/*
+ Table: 'phpbb_smilies'
+*/
+CREATE SEQUENCE phpbb_smilies_seq;
+
+CREATE TABLE phpbb_smilies (
+ smiley_id INT4 DEFAULT nextval('phpbb_smilies_seq'),
+ code varchar(50) DEFAULT '' NOT NULL,
+ emotion varchar(50) DEFAULT '' NOT NULL,
+ smiley_url varchar(50) DEFAULT '' NOT NULL,
+ smiley_width INT2 DEFAULT '0' NOT NULL CHECK (smiley_width >= 0),
+ smiley_height INT2 DEFAULT '0' NOT NULL CHECK (smiley_height >= 0),
+ smiley_order INT4 DEFAULT '0' NOT NULL CHECK (smiley_order >= 0),
+ display_on_posting INT2 DEFAULT '1' NOT NULL CHECK (display_on_posting >= 0),
+ PRIMARY KEY (smiley_id)
+);
+
+CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting);
+
+/*
+ Table: 'phpbb_styles'
+*/
+CREATE SEQUENCE phpbb_styles_seq;
+
+CREATE TABLE phpbb_styles (
+ style_id INT4 DEFAULT nextval('phpbb_styles_seq'),
+ style_name varchar(255) DEFAULT '' NOT NULL,
+ style_copyright varchar(255) DEFAULT '' NOT NULL,
+ style_active INT2 DEFAULT '1' NOT NULL CHECK (style_active >= 0),
+ style_path varchar(100) DEFAULT '' NOT NULL,
+ bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL,
+ style_parent_id INT4 DEFAULT '0' NOT NULL CHECK (style_parent_id >= 0),
+ style_parent_tree varchar(8000) DEFAULT '' NOT NULL,
+ PRIMARY KEY (style_id)
+);
+
+CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name);
+
+/*
+ Table: 'phpbb_topics'
+*/
+CREATE SEQUENCE phpbb_topics_seq;
+
+CREATE TABLE phpbb_topics (
+ topic_id INT4 DEFAULT nextval('phpbb_topics_seq'),
+ forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+ icon_id INT4 DEFAULT '0' NOT NULL CHECK (icon_id >= 0),
+ topic_attachment INT2 DEFAULT '0' NOT NULL CHECK (topic_attachment >= 0),
+ topic_approved INT2 DEFAULT '1' NOT NULL CHECK (topic_approved >= 0),
+ topic_reported INT2 DEFAULT '0' NOT NULL CHECK (topic_reported >= 0),
+ topic_title varchar(255) DEFAULT '' NOT NULL,
+ topic_poster INT4 DEFAULT '0' NOT NULL CHECK (topic_poster >= 0),
+ topic_time INT4 DEFAULT '0' NOT NULL CHECK (topic_time >= 0),
+ topic_time_limit INT4 DEFAULT '0' NOT NULL CHECK (topic_time_limit >= 0),
+ topic_views INT4 DEFAULT '0' NOT NULL CHECK (topic_views >= 0),
+ topic_replies INT4 DEFAULT '0' NOT NULL CHECK (topic_replies >= 0),
+ topic_replies_real INT4 DEFAULT '0' NOT NULL CHECK (topic_replies_real >= 0),
+ topic_status INT2 DEFAULT '0' NOT NULL,
+ topic_type INT2 DEFAULT '0' NOT NULL,
+ topic_first_post_id INT4 DEFAULT '0' NOT NULL CHECK (topic_first_post_id >= 0),
+ topic_first_poster_name varchar(255) DEFAULT '' NOT NULL,
+ topic_first_poster_colour varchar(6) DEFAULT '' NOT NULL,
+ topic_last_post_id INT4 DEFAULT '0' NOT NULL CHECK (topic_last_post_id >= 0),
+ topic_last_poster_id INT4 DEFAULT '0' NOT NULL CHECK (topic_last_poster_id >= 0),
+ topic_last_poster_name varchar(255) DEFAULT '' NOT NULL,
+ topic_last_poster_colour varchar(6) DEFAULT '' NOT NULL,
+ topic_last_post_subject varchar(255) DEFAULT '' NOT NULL,
+ topic_last_post_time INT4 DEFAULT '0' NOT NULL CHECK (topic_last_post_time >= 0),
+ topic_last_view_time INT4 DEFAULT '0' NOT NULL CHECK (topic_last_view_time >= 0),
+ topic_moved_id INT4 DEFAULT '0' NOT NULL CHECK (topic_moved_id >= 0),
+ topic_bumped INT2 DEFAULT '0' NOT NULL CHECK (topic_bumped >= 0),
+ topic_bumper INT4 DEFAULT '0' NOT NULL CHECK (topic_bumper >= 0),
+ poll_title varchar(255) DEFAULT '' NOT NULL,
+ poll_start INT4 DEFAULT '0' NOT NULL CHECK (poll_start >= 0),
+ poll_length INT4 DEFAULT '0' NOT NULL CHECK (poll_length >= 0),
+ poll_max_options INT2 DEFAULT '1' NOT NULL,
+ poll_last_vote INT4 DEFAULT '0' NOT NULL CHECK (poll_last_vote >= 0),
+ poll_vote_change INT2 DEFAULT '0' NOT NULL CHECK (poll_vote_change >= 0),
+ PRIMARY KEY (topic_id)
+);
+
+CREATE INDEX phpbb_topics_forum_id ON phpbb_topics (forum_id);
+CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics (forum_id, topic_type);
+CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics (topic_last_post_time);
+CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics (topic_approved);
+CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics (forum_id, topic_approved, topic_last_post_id);
+CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id);
+
+/*
+ Table: 'phpbb_topics_track'
+*/
+CREATE TABLE phpbb_topics_track (
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+ forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+ mark_time INT4 DEFAULT '0' NOT NULL CHECK (mark_time >= 0),
+ PRIMARY KEY (user_id, topic_id)
+);
+
+CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id);
+CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id);
+
+/*
+ Table: 'phpbb_topics_posted'
+*/
+CREATE TABLE phpbb_topics_posted (
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+ topic_posted INT2 DEFAULT '0' NOT NULL CHECK (topic_posted >= 0),
+ PRIMARY KEY (user_id, topic_id)
+);
+
+
+/*
+ Table: 'phpbb_topics_watch'
+*/
+CREATE TABLE phpbb_topics_watch (
+ topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ notify_status INT2 DEFAULT '0' NOT NULL CHECK (notify_status >= 0)
+);
+
+CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch (topic_id);
+CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch (user_id);
+CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status);
+
+/*
+ Table: 'phpbb_user_group'
+*/
+CREATE TABLE phpbb_user_group (
+ group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0),
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ group_leader INT2 DEFAULT '0' NOT NULL CHECK (group_leader >= 0),
+ user_pending INT2 DEFAULT '1' NOT NULL CHECK (user_pending >= 0)
+);
+
+CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group (group_id);
+CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group (user_id);
+CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group (group_leader);
+
+/*
+ Table: 'phpbb_users'
+*/
+CREATE SEQUENCE phpbb_users_seq;
+
+CREATE TABLE phpbb_users (
+ user_id INT4 DEFAULT nextval('phpbb_users_seq'),
+ user_type INT2 DEFAULT '0' NOT NULL,
+ group_id INT4 DEFAULT '3' NOT NULL CHECK (group_id >= 0),
+ user_permissions TEXT DEFAULT '' NOT NULL,
+ user_perm_from INT4 DEFAULT '0' NOT NULL CHECK (user_perm_from >= 0),
+ user_ip varchar(40) DEFAULT '' NOT NULL,
+ user_regdate INT4 DEFAULT '0' NOT NULL CHECK (user_regdate >= 0),
+ username varchar_ci DEFAULT '' NOT NULL,
+ username_clean varchar_ci DEFAULT '' NOT NULL,
+ user_password varchar(40) DEFAULT '' NOT NULL,
+ user_passchg INT4 DEFAULT '0' NOT NULL CHECK (user_passchg >= 0),
+ user_pass_convert INT2 DEFAULT '0' NOT NULL CHECK (user_pass_convert >= 0),
+ user_email varchar(100) DEFAULT '' NOT NULL,
+ user_email_hash INT8 DEFAULT '0' NOT NULL,
+ user_birthday varchar(10) DEFAULT '' NOT NULL,
+ user_lastvisit INT4 DEFAULT '0' NOT NULL CHECK (user_lastvisit >= 0),
+ user_lastmark INT4 DEFAULT '0' NOT NULL CHECK (user_lastmark >= 0),
+ user_lastpost_time INT4 DEFAULT '0' NOT NULL CHECK (user_lastpost_time >= 0),
+ user_lastpage varchar(200) DEFAULT '' NOT NULL,
+ user_last_confirm_key varchar(10) DEFAULT '' NOT NULL,
+ user_last_search INT4 DEFAULT '0' NOT NULL CHECK (user_last_search >= 0),
+ user_warnings INT2 DEFAULT '0' NOT NULL,
+ user_last_warning INT4 DEFAULT '0' NOT NULL CHECK (user_last_warning >= 0),
+ user_login_attempts INT2 DEFAULT '0' NOT NULL,
+ user_inactive_reason INT2 DEFAULT '0' NOT NULL,
+ user_inactive_time INT4 DEFAULT '0' NOT NULL CHECK (user_inactive_time >= 0),
+ user_posts INT4 DEFAULT '0' NOT NULL CHECK (user_posts >= 0),
+ user_lang varchar(30) DEFAULT '' NOT NULL,
+ user_timezone varchar(100) DEFAULT 'UTC' NOT NULL,
+ user_dateformat varchar(30) DEFAULT 'd M Y H:i' NOT NULL,
+ user_style INT4 DEFAULT '0' NOT NULL CHECK (user_style >= 0),
+ user_rank INT4 DEFAULT '0' NOT NULL CHECK (user_rank >= 0),
+ user_colour varchar(6) DEFAULT '' NOT NULL,
+ user_new_privmsg INT4 DEFAULT '0' NOT NULL,
+ user_unread_privmsg INT4 DEFAULT '0' NOT NULL,
+ user_last_privmsg INT4 DEFAULT '0' NOT NULL CHECK (user_last_privmsg >= 0),
+ user_message_rules INT2 DEFAULT '0' NOT NULL CHECK (user_message_rules >= 0),
+ user_full_folder INT4 DEFAULT '-3' NOT NULL,
+ user_emailtime INT4 DEFAULT '0' NOT NULL CHECK (user_emailtime >= 0),
+ user_topic_show_days INT2 DEFAULT '0' NOT NULL CHECK (user_topic_show_days >= 0),
+ user_topic_sortby_type varchar(1) DEFAULT 't' NOT NULL,
+ user_topic_sortby_dir varchar(1) DEFAULT 'd' NOT NULL,
+ user_post_show_days INT2 DEFAULT '0' NOT NULL CHECK (user_post_show_days >= 0),
+ user_post_sortby_type varchar(1) DEFAULT 't' NOT NULL,
+ user_post_sortby_dir varchar(1) DEFAULT 'a' NOT NULL,
+ user_notify INT2 DEFAULT '0' NOT NULL CHECK (user_notify >= 0),
+ user_notify_pm INT2 DEFAULT '1' NOT NULL CHECK (user_notify_pm >= 0),
+ user_notify_type INT2 DEFAULT '0' NOT NULL,
+ user_allow_pm INT2 DEFAULT '1' NOT NULL CHECK (user_allow_pm >= 0),
+ user_allow_viewonline INT2 DEFAULT '1' NOT NULL CHECK (user_allow_viewonline >= 0),
+ user_allow_viewemail INT2 DEFAULT '1' NOT NULL CHECK (user_allow_viewemail >= 0),
+ user_allow_massemail INT2 DEFAULT '1' NOT NULL CHECK (user_allow_massemail >= 0),
+ user_options INT4 DEFAULT '230271' NOT NULL CHECK (user_options >= 0),
+ user_avatar varchar(255) DEFAULT '' NOT NULL,
+ user_avatar_type INT2 DEFAULT '0' NOT NULL,
+ user_avatar_width INT2 DEFAULT '0' NOT NULL CHECK (user_avatar_width >= 0),
+ user_avatar_height INT2 DEFAULT '0' NOT NULL CHECK (user_avatar_height >= 0),
+ user_sig TEXT DEFAULT '' NOT NULL,
+ user_sig_bbcode_uid varchar(8) DEFAULT '' NOT NULL,
+ user_sig_bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
+ user_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(4000) DEFAULT '' NOT NULL,
+ user_interests varchar(4000) DEFAULT '' NOT NULL,
+ user_actkey varchar(32) DEFAULT '' NOT NULL,
+ user_newpasswd varchar(40) DEFAULT '' NOT NULL,
+ user_form_salt varchar(32) DEFAULT '' NOT NULL,
+ user_new INT2 DEFAULT '1' NOT NULL CHECK (user_new >= 0),
+ user_reminded INT2 DEFAULT '0' NOT NULL,
+ user_reminded_time INT4 DEFAULT '0' NOT NULL CHECK (user_reminded_time >= 0),
+ PRIMARY KEY (user_id)
+);
+
+CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday);
+CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash);
+CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type);
+CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users (username_clean);
+
+/*
+ Table: 'phpbb_warnings'
+*/
+CREATE SEQUENCE phpbb_warnings_seq;
+
+CREATE TABLE phpbb_warnings (
+ warning_id INT4 DEFAULT nextval('phpbb_warnings_seq'),
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ post_id INT4 DEFAULT '0' NOT NULL CHECK (post_id >= 0),
+ log_id INT4 DEFAULT '0' NOT NULL CHECK (log_id >= 0),
+ warning_time INT4 DEFAULT '0' NOT NULL CHECK (warning_time >= 0),
+ PRIMARY KEY (warning_id)
+);
+
+
+/*
+ Table: 'phpbb_words'
+*/
+CREATE SEQUENCE phpbb_words_seq;
+
+CREATE TABLE phpbb_words (
+ word_id INT4 DEFAULT nextval('phpbb_words_seq'),
+ word varchar(255) DEFAULT '' NOT NULL,
+ replacement varchar(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY (word_id)
+);
+
+
+/*
+ Table: 'phpbb_zebra'
+*/
+CREATE TABLE phpbb_zebra (
+ user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+ zebra_id INT4 DEFAULT '0' NOT NULL CHECK (zebra_id >= 0),
+ friend INT2 DEFAULT '0' NOT NULL CHECK (friend >= 0),
+ foe INT2 DEFAULT '0' NOT NULL CHECK (foe >= 0),
+ PRIMARY KEY (user_id, zebra_id)
+);
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index ea7864bd4c..938b11388b 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -314,6 +314,7 @@ INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_subscribe', 1);
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_user_lock', 1);
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_vote', 1);
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_votechg', 1);
+INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_restore', 1);
# -- Moderator related auth options
INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_', 1, 1);
@@ -327,6 +328,7 @@ INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_merg
INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_move', 1, 1);
INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_report', 1, 1);
INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_split', 1, 1);
+INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_restore', 1, 1);
# -- Global moderator auth option (not a local option)
INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_ban', 0, 1);
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index 8360bc30ea..361e0ca9c6 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -1,951 +1,947 @@
-# DO NOT EDIT THIS FILE, IT IS GENERATED
-#
-# To change the contents of this file, edit
-# phpBB/develop/create_schema_files.php and
-# run it.
-BEGIN TRANSACTION;
-
-# Table: 'phpbb_attachments'
-CREATE TABLE phpbb_attachments (
- attach_id INTEGER PRIMARY KEY NOT NULL ,
- post_msg_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- in_message INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- is_orphan INTEGER UNSIGNED NOT NULL DEFAULT '1',
- physical_filename varchar(255) NOT NULL DEFAULT '',
- real_filename varchar(255) NOT NULL DEFAULT '',
- download_count INTEGER UNSIGNED NOT NULL DEFAULT '0',
- attach_comment text(65535) NOT NULL DEFAULT '',
- extension varchar(100) NOT NULL DEFAULT '',
- mimetype varchar(100) NOT NULL DEFAULT '',
- filesize INTEGER UNSIGNED NOT NULL DEFAULT '0',
- filetime INTEGER UNSIGNED NOT NULL DEFAULT '0',
- thumbnail INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments (filetime);
-CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments (post_msg_id);
-CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments (topic_id);
-CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id);
-CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments (is_orphan);
-
-# Table: 'phpbb_acl_groups'
-CREATE TABLE phpbb_acl_groups (
- group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_role_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_setting tinyint(2) NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups (group_id);
-CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups (auth_option_id);
-CREATE INDEX phpbb_acl_groups_auth_role_id ON phpbb_acl_groups (auth_role_id);
-
-# Table: 'phpbb_acl_options'
-CREATE TABLE phpbb_acl_options (
- auth_option_id INTEGER PRIMARY KEY NOT NULL ,
- auth_option varchar(50) NOT NULL DEFAULT '',
- is_global INTEGER UNSIGNED NOT NULL DEFAULT '0',
- is_local INTEGER UNSIGNED NOT NULL DEFAULT '0',
- founder_only INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE UNIQUE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options (auth_option);
-
-# Table: 'phpbb_acl_roles'
-CREATE TABLE phpbb_acl_roles (
- role_id INTEGER PRIMARY KEY NOT NULL ,
- role_name varchar(255) NOT NULL DEFAULT '',
- role_description text(65535) NOT NULL DEFAULT '',
- role_type varchar(10) NOT NULL DEFAULT '',
- role_order INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles (role_type);
-CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles (role_order);
-
-# Table: 'phpbb_acl_roles_data'
-CREATE TABLE phpbb_acl_roles_data (
- role_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_setting tinyint(2) NOT NULL DEFAULT '0',
- PRIMARY KEY (role_id, auth_option_id)
-);
-
-CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id);
-
-# Table: 'phpbb_acl_users'
-CREATE TABLE phpbb_acl_users (
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_role_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- auth_setting tinyint(2) NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users (user_id);
-CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users (auth_option_id);
-CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id);
-
-# Table: 'phpbb_banlist'
-CREATE TABLE phpbb_banlist (
- ban_id INTEGER PRIMARY KEY NOT NULL ,
- ban_userid INTEGER UNSIGNED NOT NULL DEFAULT '0',
- ban_ip varchar(40) NOT NULL DEFAULT '',
- ban_email varchar(100) NOT NULL DEFAULT '',
- ban_start INTEGER UNSIGNED NOT NULL DEFAULT '0',
- ban_end INTEGER UNSIGNED NOT NULL DEFAULT '0',
- ban_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0',
- ban_reason varchar(255) NOT NULL DEFAULT '',
- ban_give_reason varchar(255) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end);
-CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist (ban_userid, ban_exclude);
-CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist (ban_email, ban_exclude);
-CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist (ban_ip, ban_exclude);
-
-# Table: 'phpbb_bbcodes'
-CREATE TABLE phpbb_bbcodes (
- bbcode_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- bbcode_tag varchar(16) NOT NULL DEFAULT '',
- bbcode_helpline varchar(255) NOT NULL DEFAULT '',
- display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '0',
- bbcode_match text(65535) NOT NULL DEFAULT '',
- bbcode_tpl mediumtext(16777215) NOT NULL DEFAULT '',
- first_pass_match mediumtext(16777215) NOT NULL DEFAULT '',
- first_pass_replace mediumtext(16777215) NOT NULL DEFAULT '',
- second_pass_match mediumtext(16777215) NOT NULL DEFAULT '',
- second_pass_replace mediumtext(16777215) NOT NULL DEFAULT '',
- PRIMARY KEY (bbcode_id)
-);
-
-CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting);
-
-# Table: 'phpbb_bookmarks'
-CREATE TABLE phpbb_bookmarks (
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (topic_id, user_id)
-);
-
-
-# Table: 'phpbb_bots'
-CREATE TABLE phpbb_bots (
- bot_id INTEGER PRIMARY KEY NOT NULL ,
- bot_active INTEGER UNSIGNED NOT NULL DEFAULT '1',
- bot_name text(65535) NOT NULL DEFAULT '',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- bot_agent varchar(255) NOT NULL DEFAULT '',
- bot_ip varchar(255) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active);
-
-# Table: 'phpbb_config'
-CREATE TABLE phpbb_config (
- config_name varchar(255) NOT NULL DEFAULT '',
- config_value varchar(255) NOT NULL DEFAULT '',
- is_dynamic INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (config_name)
-);
-
-CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic);
-
-# Table: 'phpbb_confirm'
-CREATE TABLE phpbb_confirm (
- confirm_id char(32) NOT NULL DEFAULT '',
- session_id char(32) NOT NULL DEFAULT '',
- confirm_type tinyint(3) NOT NULL DEFAULT '0',
- code varchar(8) NOT NULL DEFAULT '',
- seed INTEGER UNSIGNED NOT NULL DEFAULT '0',
- attempts INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (session_id, confirm_id)
-);
-
-CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm (confirm_type);
-
-# Table: 'phpbb_disallow'
-CREATE TABLE phpbb_disallow (
- disallow_id INTEGER PRIMARY KEY NOT NULL ,
- disallow_username varchar(255) NOT NULL DEFAULT ''
-);
-
-
-# Table: 'phpbb_drafts'
-CREATE TABLE phpbb_drafts (
- draft_id INTEGER PRIMARY KEY NOT NULL ,
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- save_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- draft_subject text(65535) NOT NULL DEFAULT '',
- draft_message mediumtext(16777215) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time);
-
-# Table: 'phpbb_ext'
-CREATE TABLE phpbb_ext (
- ext_name varchar(255) NOT NULL DEFAULT '',
- ext_active INTEGER UNSIGNED NOT NULL DEFAULT '0',
- ext_state text(65535) NOT NULL DEFAULT ''
-);
-
-CREATE UNIQUE INDEX phpbb_ext_ext_name ON phpbb_ext (ext_name);
-
-# Table: 'phpbb_extensions'
-CREATE TABLE phpbb_extensions (
- extension_id INTEGER PRIMARY KEY NOT NULL ,
- group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- extension varchar(100) NOT NULL DEFAULT ''
-);
-
-
-# Table: 'phpbb_extension_groups'
-CREATE TABLE phpbb_extension_groups (
- group_id INTEGER PRIMARY KEY NOT NULL ,
- group_name varchar(255) NOT NULL DEFAULT '',
- cat_id tinyint(2) NOT NULL DEFAULT '0',
- allow_group INTEGER UNSIGNED NOT NULL DEFAULT '0',
- download_mode INTEGER UNSIGNED NOT NULL DEFAULT '1',
- upload_icon varchar(255) NOT NULL DEFAULT '',
- max_filesize INTEGER UNSIGNED NOT NULL DEFAULT '0',
- allowed_forums text(65535) NOT NULL DEFAULT '',
- allow_in_pm INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-
-# Table: 'phpbb_forums'
-CREATE TABLE phpbb_forums (
- forum_id INTEGER PRIMARY KEY NOT NULL ,
- parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- left_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- right_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_parents mediumtext(16777215) NOT NULL DEFAULT '',
- forum_name text(65535) NOT NULL DEFAULT '',
- forum_desc text(65535) NOT NULL DEFAULT '',
- forum_desc_bitfield varchar(255) NOT NULL DEFAULT '',
- forum_desc_options INTEGER UNSIGNED NOT NULL DEFAULT '7',
- forum_desc_uid varchar(8) NOT NULL DEFAULT '',
- forum_link varchar(255) NOT NULL DEFAULT '',
- forum_password varchar(40) NOT NULL DEFAULT '',
- forum_style INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_image varchar(255) NOT NULL DEFAULT '',
- forum_rules text(65535) NOT NULL DEFAULT '',
- forum_rules_link varchar(255) NOT NULL DEFAULT '',
- forum_rules_bitfield varchar(255) NOT NULL DEFAULT '',
- forum_rules_options INTEGER UNSIGNED NOT NULL DEFAULT '7',
- forum_rules_uid varchar(8) NOT NULL DEFAULT '',
- forum_topics_per_page tinyint(4) NOT NULL DEFAULT '0',
- forum_type tinyint(4) NOT NULL DEFAULT '0',
- forum_status tinyint(4) NOT NULL DEFAULT '0',
- forum_posts INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_topics INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_topics_real INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_last_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_last_poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_last_post_subject text(65535) NOT NULL DEFAULT '',
- forum_last_post_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_last_poster_name varchar(255) NOT NULL DEFAULT '',
- forum_last_poster_colour varchar(6) NOT NULL DEFAULT '',
- forum_flags tinyint(4) NOT NULL DEFAULT '32',
- forum_options INTEGER UNSIGNED NOT NULL DEFAULT '0',
- display_subforum_list INTEGER UNSIGNED NOT NULL DEFAULT '1',
- display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_indexing INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_icons INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_prune INTEGER UNSIGNED NOT NULL DEFAULT '0',
- prune_next INTEGER UNSIGNED NOT NULL DEFAULT '0',
- prune_days INTEGER UNSIGNED NOT NULL DEFAULT '0',
- prune_viewed INTEGER UNSIGNED NOT NULL DEFAULT '0',
- prune_freq INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums (left_id, right_id);
-CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums (forum_last_post_id);
-
-# Table: 'phpbb_forums_access'
-CREATE TABLE phpbb_forums_access (
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- session_id char(32) NOT NULL DEFAULT '',
- PRIMARY KEY (forum_id, user_id, session_id)
-);
-
-
-# Table: 'phpbb_forums_track'
-CREATE TABLE phpbb_forums_track (
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- mark_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (user_id, forum_id)
-);
-
-
-# Table: 'phpbb_forums_watch'
-CREATE TABLE phpbb_forums_watch (
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- notify_status INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch (forum_id);
-CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch (user_id);
-CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch (notify_status);
-
-# Table: 'phpbb_groups'
-CREATE TABLE phpbb_groups (
- group_id INTEGER PRIMARY KEY NOT NULL ,
- group_type tinyint(4) NOT NULL DEFAULT '1',
- group_founder_manage INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_skip_auth INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_name varchar(255) NOT NULL DEFAULT '',
- group_desc text(65535) NOT NULL DEFAULT '',
- group_desc_bitfield varchar(255) NOT NULL DEFAULT '',
- group_desc_options INTEGER UNSIGNED NOT NULL DEFAULT '7',
- group_desc_uid varchar(8) NOT NULL DEFAULT '',
- group_display INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_avatar varchar(255) NOT NULL DEFAULT '',
- group_avatar_type tinyint(2) NOT NULL DEFAULT '0',
- group_avatar_width INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_avatar_height INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_rank INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_colour varchar(6) NOT NULL DEFAULT '',
- group_sig_chars INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_receive_pm INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_message_limit INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_max_recipients INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_legend INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_teampage INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name);
-
-# Table: 'phpbb_icons'
-CREATE TABLE phpbb_icons (
- icons_id INTEGER PRIMARY KEY NOT NULL ,
- icons_url varchar(255) NOT NULL DEFAULT '',
- icons_width tinyint(4) NOT NULL DEFAULT '0',
- icons_height tinyint(4) NOT NULL DEFAULT '0',
- icons_order INTEGER UNSIGNED NOT NULL DEFAULT '0',
- display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '1'
-);
-
-CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons (display_on_posting);
-
-# Table: 'phpbb_lang'
-CREATE TABLE phpbb_lang (
- lang_id INTEGER PRIMARY KEY NOT NULL ,
- lang_iso varchar(30) NOT NULL DEFAULT '',
- lang_dir varchar(30) NOT NULL DEFAULT '',
- lang_english_name varchar(100) NOT NULL DEFAULT '',
- lang_local_name varchar(255) NOT NULL DEFAULT '',
- lang_author varchar(255) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang (lang_iso);
-
-# Table: 'phpbb_log'
-CREATE TABLE phpbb_log (
- log_id INTEGER PRIMARY KEY NOT NULL ,
- log_type tinyint(4) NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- reportee_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- log_ip varchar(40) NOT NULL DEFAULT '',
- log_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- log_operation text(65535) NOT NULL DEFAULT '',
- log_data mediumtext(16777215) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type);
-CREATE INDEX phpbb_log_log_time ON phpbb_log (log_time);
-CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id);
-CREATE INDEX phpbb_log_topic_id ON phpbb_log (topic_id);
-CREATE INDEX phpbb_log_reportee_id ON phpbb_log (reportee_id);
-CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id);
-
-# Table: 'phpbb_login_attempts'
-CREATE TABLE phpbb_login_attempts (
- attempt_ip varchar(40) NOT NULL DEFAULT '',
- attempt_browser varchar(150) NOT NULL DEFAULT '',
- attempt_forwarded_for varchar(255) NOT NULL DEFAULT '',
- attempt_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- username varchar(255) NOT NULL DEFAULT '0',
- username_clean varchar(255) NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts (attempt_ip, attempt_time);
-CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts (attempt_forwarded_for, attempt_time);
-CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts (attempt_time);
-CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts (user_id);
-
-# Table: 'phpbb_moderator_cache'
-CREATE TABLE phpbb_moderator_cache (
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- username varchar(255) NOT NULL DEFAULT '',
- group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_name varchar(255) NOT NULL DEFAULT '',
- display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1'
-);
-
-CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache (display_on_index);
-CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache (forum_id);
-
-# Table: 'phpbb_modules'
-CREATE TABLE phpbb_modules (
- module_id INTEGER PRIMARY KEY NOT NULL ,
- module_enabled INTEGER UNSIGNED NOT NULL DEFAULT '1',
- module_display INTEGER UNSIGNED NOT NULL DEFAULT '1',
- module_basename varchar(255) NOT NULL DEFAULT '',
- module_class varchar(10) NOT NULL DEFAULT '',
- parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- left_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- right_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- module_langname varchar(255) NOT NULL DEFAULT '',
- module_mode varchar(255) NOT NULL DEFAULT '',
- module_auth varchar(255) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id);
-CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled);
-CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id);
-
-# Table: 'phpbb_poll_options'
-CREATE TABLE phpbb_poll_options (
- poll_option_id tinyint(4) NOT NULL DEFAULT '0',
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poll_option_text text(65535) NOT NULL DEFAULT '',
- poll_option_total INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options (poll_option_id);
-CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options (topic_id);
-
-# Table: 'phpbb_poll_votes'
-CREATE TABLE phpbb_poll_votes (
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poll_option_id tinyint(4) NOT NULL DEFAULT '0',
- vote_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- vote_user_ip varchar(40) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes (topic_id);
-CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes (vote_user_id);
-CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes (vote_user_ip);
-
-# Table: 'phpbb_posts'
-CREATE TABLE phpbb_posts (
- post_id INTEGER PRIMARY KEY NOT NULL ,
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- icon_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poster_ip varchar(40) NOT NULL DEFAULT '',
- post_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- post_approved INTEGER UNSIGNED NOT NULL DEFAULT '1',
- post_reported INTEGER UNSIGNED NOT NULL DEFAULT '0',
- enable_bbcode INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_smilies INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_magic_url INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_sig INTEGER UNSIGNED NOT NULL DEFAULT '1',
- post_username varchar(255) NOT NULL DEFAULT '',
- post_subject text(65535) NOT NULL DEFAULT '',
- post_text mediumtext(16777215) NOT NULL DEFAULT '',
- post_checksum varchar(32) NOT NULL DEFAULT '',
- post_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
- bbcode_bitfield varchar(255) NOT NULL DEFAULT '',
- bbcode_uid varchar(8) NOT NULL DEFAULT '',
- post_postcount INTEGER UNSIGNED NOT NULL DEFAULT '1',
- post_edit_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- post_edit_reason text(65535) NOT NULL DEFAULT '',
- post_edit_user INTEGER UNSIGNED NOT NULL DEFAULT '0',
- post_edit_count INTEGER UNSIGNED NOT NULL DEFAULT '0',
- post_edit_locked INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-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_username ON phpbb_posts (post_username);
-CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time);
-
-# Table: 'phpbb_privmsgs'
-CREATE TABLE phpbb_privmsgs (
- msg_id INTEGER PRIMARY KEY NOT NULL ,
- root_level INTEGER UNSIGNED NOT NULL DEFAULT '0',
- author_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- icon_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- author_ip varchar(40) NOT NULL DEFAULT '',
- message_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- enable_bbcode INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_smilies INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_magic_url INTEGER UNSIGNED NOT NULL DEFAULT '1',
- enable_sig INTEGER UNSIGNED NOT NULL DEFAULT '1',
- message_subject text(65535) NOT NULL DEFAULT '',
- message_text mediumtext(16777215) NOT NULL DEFAULT '',
- message_edit_reason text(65535) NOT NULL DEFAULT '',
- message_edit_user INTEGER UNSIGNED NOT NULL DEFAULT '0',
- message_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
- bbcode_bitfield varchar(255) NOT NULL DEFAULT '',
- bbcode_uid varchar(8) NOT NULL DEFAULT '',
- message_edit_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- message_edit_count INTEGER UNSIGNED NOT NULL DEFAULT '0',
- to_address text(65535) NOT NULL DEFAULT '',
- bcc_address text(65535) NOT NULL DEFAULT '',
- message_reported INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs (author_ip);
-CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs (message_time);
-CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs (author_id);
-CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs (root_level);
-
-# Table: 'phpbb_privmsgs_folder'
-CREATE TABLE phpbb_privmsgs_folder (
- folder_id INTEGER PRIMARY KEY NOT NULL ,
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- folder_name varchar(255) NOT NULL DEFAULT '',
- pm_count INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id);
-
-# Table: 'phpbb_privmsgs_rules'
-CREATE TABLE phpbb_privmsgs_rules (
- rule_id INTEGER PRIMARY KEY NOT NULL ,
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rule_check INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rule_connection INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rule_string varchar(255) NOT NULL DEFAULT '',
- rule_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rule_group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rule_action INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rule_folder_id int(11) NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules (user_id);
-
-# Table: 'phpbb_privmsgs_to'
-CREATE TABLE phpbb_privmsgs_to (
- msg_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- author_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- pm_deleted INTEGER UNSIGNED NOT NULL DEFAULT '0',
- pm_new INTEGER UNSIGNED NOT NULL DEFAULT '1',
- pm_unread INTEGER UNSIGNED NOT NULL DEFAULT '1',
- pm_replied INTEGER UNSIGNED NOT NULL DEFAULT '0',
- pm_marked INTEGER UNSIGNED NOT NULL DEFAULT '0',
- pm_forwarded INTEGER UNSIGNED NOT NULL DEFAULT '0',
- folder_id int(11) NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id);
-CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to (author_id);
-CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folder_id);
-
-# Table: 'phpbb_profile_fields'
-CREATE TABLE phpbb_profile_fields (
- field_id INTEGER PRIMARY KEY NOT NULL ,
- field_name varchar(255) NOT NULL DEFAULT '',
- field_type tinyint(4) NOT NULL DEFAULT '0',
- field_ident varchar(20) NOT NULL DEFAULT '',
- field_length varchar(20) NOT NULL DEFAULT '',
- field_minlen varchar(255) NOT NULL DEFAULT '',
- field_maxlen varchar(255) NOT NULL DEFAULT '',
- field_novalue varchar(255) NOT NULL DEFAULT '',
- field_default_value varchar(255) NOT NULL DEFAULT '',
- field_validation varchar(20) NOT NULL DEFAULT '',
- field_required INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_show_novalue INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_show_on_reg INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_show_on_pm INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_show_on_vt INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_show_profile INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_hide INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_no_view INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_active INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_order INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields (field_type);
-CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields (field_order);
-
-# Table: 'phpbb_profile_fields_data'
-CREATE TABLE phpbb_profile_fields_data (
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (user_id)
-);
-
-
-# Table: 'phpbb_profile_fields_lang'
-CREATE TABLE phpbb_profile_fields_lang (
- field_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- lang_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- field_type tinyint(4) NOT NULL DEFAULT '0',
- lang_value varchar(255) NOT NULL DEFAULT '',
- PRIMARY KEY (field_id, lang_id, option_id)
-);
-
-
-# Table: 'phpbb_profile_lang'
-CREATE TABLE phpbb_profile_lang (
- field_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- lang_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- lang_name varchar(255) NOT NULL DEFAULT '',
- lang_explain text(65535) NOT NULL DEFAULT '',
- lang_default_value varchar(255) NOT NULL DEFAULT '',
- PRIMARY KEY (field_id, lang_id)
-);
-
-
-# Table: 'phpbb_ranks'
-CREATE TABLE phpbb_ranks (
- rank_id INTEGER PRIMARY KEY NOT NULL ,
- rank_title varchar(255) NOT NULL DEFAULT '',
- rank_min INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rank_special INTEGER UNSIGNED NOT NULL DEFAULT '0',
- rank_image varchar(255) NOT NULL DEFAULT ''
-);
-
-
-# Table: 'phpbb_reports'
-CREATE TABLE phpbb_reports (
- report_id INTEGER PRIMARY KEY NOT NULL ,
- reason_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- pm_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_notify INTEGER UNSIGNED NOT NULL DEFAULT '0',
- report_closed INTEGER UNSIGNED NOT NULL DEFAULT '0',
- report_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- report_text mediumtext(16777215) NOT NULL DEFAULT '',
- reported_post_text mediumtext(16777215) NOT NULL DEFAULT ''
-);
-
-CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id);
-CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id);
-
-# Table: 'phpbb_reports_reasons'
-CREATE TABLE phpbb_reports_reasons (
- reason_id INTEGER PRIMARY KEY NOT NULL ,
- reason_title varchar(255) NOT NULL DEFAULT '',
- reason_description mediumtext(16777215) NOT NULL DEFAULT '',
- reason_order INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-
-# Table: 'phpbb_search_results'
-CREATE TABLE phpbb_search_results (
- search_key varchar(32) NOT NULL DEFAULT '',
- search_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- search_keywords mediumtext(16777215) NOT NULL DEFAULT '',
- search_authors mediumtext(16777215) NOT NULL DEFAULT '',
- PRIMARY KEY (search_key)
-);
-
-
-# Table: 'phpbb_search_wordlist'
-CREATE TABLE phpbb_search_wordlist (
- word_id INTEGER PRIMARY KEY NOT NULL ,
- word_text varchar(255) NOT NULL DEFAULT '',
- word_common INTEGER UNSIGNED NOT NULL DEFAULT '0',
- word_count INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist (word_text);
-CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist (word_count);
-
-# Table: 'phpbb_search_wordmatch'
-CREATE TABLE phpbb_search_wordmatch (
- post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- word_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- title_match INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE UNIQUE INDEX phpbb_search_wordmatch_unq_mtch ON phpbb_search_wordmatch (word_id, post_id, title_match);
-CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id);
-CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id);
-
-# Table: 'phpbb_sessions'
-CREATE TABLE phpbb_sessions (
- session_id char(32) NOT NULL DEFAULT '',
- session_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- session_forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- session_last_visit INTEGER UNSIGNED NOT NULL DEFAULT '0',
- session_start INTEGER UNSIGNED NOT NULL DEFAULT '0',
- session_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- session_ip varchar(40) NOT NULL DEFAULT '',
- session_browser varchar(150) NOT NULL DEFAULT '',
- session_forwarded_for varchar(255) NOT NULL DEFAULT '',
- session_page varchar(255) NOT NULL DEFAULT '',
- session_viewonline INTEGER UNSIGNED NOT NULL DEFAULT '1',
- session_autologin INTEGER UNSIGNED NOT NULL DEFAULT '0',
- session_admin INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (session_id)
-);
-
-CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions (session_time);
-CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions (session_user_id);
-CREATE INDEX phpbb_sessions_session_fid ON phpbb_sessions (session_forum_id);
-
-# Table: 'phpbb_sessions_keys'
-CREATE TABLE phpbb_sessions_keys (
- key_id char(32) NOT NULL DEFAULT '',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- last_ip varchar(40) NOT NULL DEFAULT '',
- last_login INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (key_id, user_id)
-);
-
-CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login);
-
-# Table: 'phpbb_sitelist'
-CREATE TABLE phpbb_sitelist (
- site_id INTEGER PRIMARY KEY NOT NULL ,
- site_ip varchar(40) NOT NULL DEFAULT '',
- site_hostname varchar(255) NOT NULL DEFAULT '',
- ip_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-
-# Table: 'phpbb_smilies'
-CREATE TABLE phpbb_smilies (
- smiley_id INTEGER PRIMARY KEY NOT NULL ,
- code varchar(50) NOT NULL DEFAULT '',
- emotion varchar(50) NOT NULL DEFAULT '',
- smiley_url varchar(50) NOT NULL DEFAULT '',
- smiley_width INTEGER UNSIGNED NOT NULL DEFAULT '0',
- smiley_height INTEGER UNSIGNED NOT NULL DEFAULT '0',
- smiley_order INTEGER UNSIGNED NOT NULL DEFAULT '0',
- display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '1'
-);
-
-CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting);
-
-# Table: 'phpbb_styles'
-CREATE TABLE phpbb_styles (
- style_id INTEGER PRIMARY KEY NOT NULL ,
- style_name varchar(255) NOT NULL DEFAULT '',
- style_copyright varchar(255) NOT NULL DEFAULT '',
- style_active INTEGER UNSIGNED NOT NULL DEFAULT '1',
- style_path varchar(100) NOT NULL DEFAULT '',
- bbcode_bitfield varchar(255) NOT NULL DEFAULT 'kNg=',
- style_parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- style_parent_tree text(65535) NOT NULL DEFAULT ''
-);
-
-CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name);
-
-# Table: 'phpbb_topics'
-CREATE TABLE phpbb_topics (
- topic_id INTEGER PRIMARY KEY NOT NULL ,
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- icon_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_approved INTEGER UNSIGNED NOT NULL DEFAULT '1',
- topic_reported INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_title text(65535) NOT NULL DEFAULT '',
- topic_poster INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_time_limit INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_views INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_replies INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_replies_real INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_status tinyint(3) NOT NULL DEFAULT '0',
- topic_type tinyint(3) NOT NULL DEFAULT '0',
- topic_first_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_first_poster_name varchar(255) NOT NULL DEFAULT '',
- topic_first_poster_colour varchar(6) NOT NULL DEFAULT '',
- topic_last_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_last_poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_last_poster_name varchar(255) NOT NULL DEFAULT '',
- topic_last_poster_colour varchar(6) NOT NULL DEFAULT '',
- topic_last_post_subject text(65535) NOT NULL DEFAULT '',
- topic_last_post_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_last_view_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_moved_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_bumped INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_bumper INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poll_title text(65535) NOT NULL DEFAULT '',
- poll_start INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poll_length INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poll_max_options tinyint(4) NOT NULL DEFAULT '1',
- poll_last_vote INTEGER UNSIGNED NOT NULL DEFAULT '0',
- poll_vote_change INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_topics_forum_id ON phpbb_topics (forum_id);
-CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics (forum_id, topic_type);
-CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics (topic_last_post_time);
-CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics (topic_approved);
-CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics (forum_id, topic_approved, topic_last_post_id);
-CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id);
-
-# Table: 'phpbb_topics_track'
-CREATE TABLE phpbb_topics_track (
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- mark_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (user_id, topic_id)
-);
-
-CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id);
-CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id);
-
-# Table: 'phpbb_topics_posted'
-CREATE TABLE phpbb_topics_posted (
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- topic_posted INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (user_id, topic_id)
-);
-
-
-# Table: 'phpbb_topics_watch'
-CREATE TABLE phpbb_topics_watch (
- topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- notify_status INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch (topic_id);
-CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch (user_id);
-CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status);
-
-# Table: 'phpbb_user_group'
-CREATE TABLE phpbb_user_group (
- group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- group_leader INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_pending INTEGER UNSIGNED NOT NULL DEFAULT '1'
-);
-
-CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group (group_id);
-CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group (user_id);
-CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group (group_leader);
-
-# Table: 'phpbb_users'
-CREATE TABLE phpbb_users (
- user_id INTEGER PRIMARY KEY NOT NULL ,
- user_type tinyint(2) NOT NULL DEFAULT '0',
- group_id INTEGER UNSIGNED NOT NULL DEFAULT '3',
- user_permissions mediumtext(16777215) NOT NULL DEFAULT '',
- user_perm_from INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_ip varchar(40) NOT NULL DEFAULT '',
- user_regdate INTEGER UNSIGNED NOT NULL DEFAULT '0',
- username varchar(255) NOT NULL DEFAULT '',
- username_clean varchar(255) NOT NULL DEFAULT '',
- user_password varchar(40) NOT NULL DEFAULT '',
- user_passchg INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_pass_convert INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_email varchar(100) NOT NULL DEFAULT '',
- user_email_hash bigint(20) NOT NULL DEFAULT '0',
- user_birthday varchar(10) NOT NULL DEFAULT '',
- user_lastvisit INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_lastmark INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_lastpost_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_lastpage varchar(200) NOT NULL DEFAULT '',
- user_last_confirm_key varchar(10) NOT NULL DEFAULT '',
- user_last_search INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_warnings tinyint(4) NOT NULL DEFAULT '0',
- user_last_warning INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_login_attempts tinyint(4) NOT NULL DEFAULT '0',
- user_inactive_reason tinyint(2) NOT NULL DEFAULT '0',
- user_inactive_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_posts INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_lang varchar(30) NOT NULL DEFAULT '',
- user_timezone varchar(100) NOT NULL DEFAULT 'UTC',
- user_dateformat varchar(30) NOT NULL DEFAULT 'd M Y H:i',
- user_style INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_rank INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_colour varchar(6) NOT NULL DEFAULT '',
- user_new_privmsg int(4) NOT NULL DEFAULT '0',
- user_unread_privmsg int(4) NOT NULL DEFAULT '0',
- user_last_privmsg INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_message_rules INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_full_folder int(11) NOT NULL DEFAULT '-3',
- user_emailtime INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_topic_show_days INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_topic_sortby_type varchar(1) NOT NULL DEFAULT 't',
- user_topic_sortby_dir varchar(1) NOT NULL DEFAULT 'd',
- user_post_show_days INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_post_sortby_type varchar(1) NOT NULL DEFAULT 't',
- user_post_sortby_dir varchar(1) NOT NULL DEFAULT 'a',
- user_notify INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_notify_pm INTEGER UNSIGNED NOT NULL DEFAULT '1',
- user_notify_type tinyint(4) NOT NULL DEFAULT '0',
- user_allow_pm INTEGER UNSIGNED NOT NULL DEFAULT '1',
- user_allow_viewonline INTEGER UNSIGNED NOT NULL DEFAULT '1',
- user_allow_viewemail INTEGER UNSIGNED NOT NULL DEFAULT '1',
- user_allow_massemail INTEGER UNSIGNED NOT NULL DEFAULT '1',
- user_options INTEGER UNSIGNED NOT NULL DEFAULT '230271',
- user_avatar varchar(255) NOT NULL DEFAULT '',
- user_avatar_type tinyint(2) NOT NULL DEFAULT '0',
- user_avatar_width INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_avatar_height INTEGER UNSIGNED NOT NULL DEFAULT '0',
- user_sig mediumtext(16777215) NOT NULL DEFAULT '',
- user_sig_bbcode_uid varchar(8) NOT NULL DEFAULT '',
- user_sig_bbcode_bitfield varchar(255) NOT NULL DEFAULT '',
- user_from varchar(100) NOT NULL DEFAULT '',
- user_icq varchar(15) NOT NULL DEFAULT '',
- user_aim varchar(255) NOT NULL DEFAULT '',
- user_yim varchar(255) NOT NULL DEFAULT '',
- user_msnm varchar(255) NOT NULL DEFAULT '',
- user_jabber varchar(255) NOT NULL DEFAULT '',
- user_website varchar(200) NOT NULL DEFAULT '',
- user_occ text(65535) NOT NULL DEFAULT '',
- user_interests text(65535) NOT NULL DEFAULT '',
- user_actkey varchar(32) NOT NULL DEFAULT '',
- user_newpasswd varchar(40) NOT NULL DEFAULT '',
- user_form_salt varchar(32) NOT NULL DEFAULT '',
- user_new INTEGER UNSIGNED NOT NULL DEFAULT '1',
- user_reminded tinyint(4) NOT NULL DEFAULT '0',
- user_reminded_time INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday);
-CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash);
-CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type);
-CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users (username_clean);
-
-# Table: 'phpbb_warnings'
-CREATE TABLE phpbb_warnings (
- warning_id INTEGER PRIMARY KEY NOT NULL ,
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- log_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- warning_time INTEGER UNSIGNED NOT NULL DEFAULT '0'
-);
-
-
-# Table: 'phpbb_words'
-CREATE TABLE phpbb_words (
- word_id INTEGER PRIMARY KEY NOT NULL ,
- word varchar(255) NOT NULL DEFAULT '',
- replacement varchar(255) NOT NULL DEFAULT ''
-);
-
-
-# Table: 'phpbb_zebra'
-CREATE TABLE phpbb_zebra (
- user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- zebra_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
- friend INTEGER UNSIGNED NOT NULL DEFAULT '0',
- foe INTEGER UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (user_id, zebra_id)
-);
-
-
-
-COMMIT; \ No newline at end of file
+# DO NOT EDIT THIS FILE, IT IS GENERATED
+#
+# To change the contents of this file, edit
+# phpBB/develop/create_schema_files.php and
+# run it.
+BEGIN TRANSACTION;
+
+# Table: 'phpbb_attachments'
+CREATE TABLE phpbb_attachments (
+ attach_id INTEGER PRIMARY KEY NOT NULL ,
+ post_msg_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ in_message INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ is_orphan INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ physical_filename varchar(255) NOT NULL DEFAULT '',
+ real_filename varchar(255) NOT NULL DEFAULT '',
+ download_count INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ attach_comment text(65535) NOT NULL DEFAULT '',
+ extension varchar(100) NOT NULL DEFAULT '',
+ mimetype varchar(100) NOT NULL DEFAULT '',
+ filesize INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ filetime INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ thumbnail INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments (filetime);
+CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments (post_msg_id);
+CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments (topic_id);
+CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id);
+CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments (is_orphan);
+
+# Table: 'phpbb_acl_groups'
+CREATE TABLE phpbb_acl_groups (
+ group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ auth_role_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ auth_setting tinyint(2) NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups (group_id);
+CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups (auth_option_id);
+CREATE INDEX phpbb_acl_groups_auth_role_id ON phpbb_acl_groups (auth_role_id);
+
+# Table: 'phpbb_acl_options'
+CREATE TABLE phpbb_acl_options (
+ auth_option_id INTEGER PRIMARY KEY NOT NULL ,
+ auth_option varchar(50) NOT NULL DEFAULT '',
+ is_global INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ is_local INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ founder_only INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+CREATE UNIQUE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options (auth_option);
+
+# Table: 'phpbb_acl_roles'
+CREATE TABLE phpbb_acl_roles (
+ role_id INTEGER PRIMARY KEY NOT NULL ,
+ role_name varchar(255) NOT NULL DEFAULT '',
+ role_description text(65535) NOT NULL DEFAULT '',
+ role_type varchar(10) NOT NULL DEFAULT '',
+ role_order INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles (role_type);
+CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles (role_order);
+
+# Table: 'phpbb_acl_roles_data'
+CREATE TABLE phpbb_acl_roles_data (
+ role_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ auth_setting tinyint(2) NOT NULL DEFAULT '0',
+ PRIMARY KEY (role_id, auth_option_id)
+);
+
+CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id);
+
+# Table: 'phpbb_acl_users'
+CREATE TABLE phpbb_acl_users (
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ auth_role_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ auth_setting tinyint(2) NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users (user_id);
+CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users (auth_option_id);
+CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id);
+
+# Table: 'phpbb_banlist'
+CREATE TABLE phpbb_banlist (
+ ban_id INTEGER PRIMARY KEY NOT NULL ,
+ ban_userid INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ ban_ip varchar(40) NOT NULL DEFAULT '',
+ ban_email varchar(100) NOT NULL DEFAULT '',
+ ban_start INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ ban_end INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ ban_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ ban_reason varchar(255) NOT NULL DEFAULT '',
+ ban_give_reason varchar(255) NOT NULL DEFAULT ''
+);
+
+CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end);
+CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist (ban_userid, ban_exclude);
+CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist (ban_email, ban_exclude);
+CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist (ban_ip, ban_exclude);
+
+# Table: 'phpbb_bbcodes'
+CREATE TABLE phpbb_bbcodes (
+ bbcode_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ bbcode_tag varchar(16) NOT NULL DEFAULT '',
+ bbcode_helpline varchar(255) NOT NULL DEFAULT '',
+ display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ bbcode_match text(65535) NOT NULL DEFAULT '',
+ bbcode_tpl mediumtext(16777215) NOT NULL DEFAULT '',
+ first_pass_match mediumtext(16777215) NOT NULL DEFAULT '',
+ first_pass_replace mediumtext(16777215) NOT NULL DEFAULT '',
+ second_pass_match mediumtext(16777215) NOT NULL DEFAULT '',
+ second_pass_replace mediumtext(16777215) NOT NULL DEFAULT '',
+ PRIMARY KEY (bbcode_id)
+);
+
+CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting);
+
+# Table: 'phpbb_bookmarks'
+CREATE TABLE phpbb_bookmarks (
+ topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (topic_id, user_id)
+);
+
+
+# Table: 'phpbb_bots'
+CREATE TABLE phpbb_bots (
+ bot_id INTEGER PRIMARY KEY NOT NULL ,
+ bot_active INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ bot_name text(65535) NOT NULL DEFAULT '',
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ bot_agent varchar(255) NOT NULL DEFAULT '',
+ bot_ip varchar(255) NOT NULL DEFAULT ''
+);
+
+CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active);
+
+# Table: 'phpbb_config'
+CREATE TABLE phpbb_config (
+ config_name varchar(255) NOT NULL DEFAULT '',
+ config_value varchar(255) NOT NULL DEFAULT '',
+ is_dynamic INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (config_name)
+);
+
+CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic);
+
+# Table: 'phpbb_confirm'
+CREATE TABLE phpbb_confirm (
+ confirm_id char(32) NOT NULL DEFAULT '',
+ session_id char(32) NOT NULL DEFAULT '',
+ confirm_type tinyint(3) NOT NULL DEFAULT '0',
+ code varchar(8) NOT NULL DEFAULT '',
+ seed INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ attempts INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (session_id, confirm_id)
+);
+
+CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm (confirm_type);
+
+# Table: 'phpbb_disallow'
+CREATE TABLE phpbb_disallow (
+ disallow_id INTEGER PRIMARY KEY NOT NULL ,
+ disallow_username varchar(255) NOT NULL DEFAULT ''
+);
+
+
+# Table: 'phpbb_drafts'
+CREATE TABLE phpbb_drafts (
+ draft_id INTEGER PRIMARY KEY NOT NULL ,
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ save_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ draft_subject text(65535) NOT NULL DEFAULT '',
+ draft_message mediumtext(16777215) NOT NULL DEFAULT ''
+);
+
+CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time);
+
+# Table: 'phpbb_ext'
+CREATE TABLE phpbb_ext (
+ ext_name varchar(255) NOT NULL DEFAULT '',
+ ext_active INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ ext_state text(65535) NOT NULL DEFAULT ''
+);
+
+CREATE UNIQUE INDEX phpbb_ext_ext_name ON phpbb_ext (ext_name);
+
+# Table: 'phpbb_extensions'
+CREATE TABLE phpbb_extensions (
+ extension_id INTEGER PRIMARY KEY NOT NULL ,
+ group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ extension varchar(100) NOT NULL DEFAULT ''
+);
+
+
+# Table: 'phpbb_extension_groups'
+CREATE TABLE phpbb_extension_groups (
+ group_id INTEGER PRIMARY KEY NOT NULL ,
+ group_name varchar(255) NOT NULL DEFAULT '',
+ cat_id tinyint(2) NOT NULL DEFAULT '0',
+ allow_group INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ download_mode INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ upload_icon varchar(255) NOT NULL DEFAULT '',
+ max_filesize INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ allowed_forums text(65535) NOT NULL DEFAULT '',
+ allow_in_pm INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+
+# Table: 'phpbb_forums'
+CREATE TABLE phpbb_forums (
+ forum_id INTEGER PRIMARY KEY NOT NULL ,
+ parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ left_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ right_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ forum_parents mediumtext(16777215) NOT NULL DEFAULT '',
+ forum_name text(65535) NOT NULL DEFAULT '',
+ forum_desc text(65535) NOT NULL DEFAULT '',
+ forum_desc_bitfield varchar(255) NOT NULL DEFAULT '',
+ forum_desc_options INTEGER UNSIGNED NOT NULL DEFAULT '7',
+ forum_desc_uid varchar(8) NOT NULL DEFAULT '',
+ forum_link varchar(255) NOT NULL DEFAULT '',
+ forum_password varchar(40) NOT NULL DEFAULT '',
+ forum_style INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ forum_image varchar(255) NOT NULL DEFAULT '',
+ forum_rules text(65535) NOT NULL DEFAULT '',
+ forum_rules_link varchar(255) NOT NULL DEFAULT '',
+ forum_rules_bitfield varchar(255) NOT NULL DEFAULT '',
+ forum_rules_options INTEGER UNSIGNED NOT NULL DEFAULT '7',
+ forum_rules_uid varchar(8) NOT NULL DEFAULT '',
+ forum_topics_per_page tinyint(4) NOT NULL DEFAULT '0',
+ forum_type tinyint(4) NOT NULL DEFAULT '0',
+ forum_status tinyint(4) NOT NULL DEFAULT '0',
+ forum_posts INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ forum_topics INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ forum_topics_real INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ forum_last_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ forum_last_poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ forum_last_post_subject text(65535) NOT NULL DEFAULT '',
+ forum_last_post_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ forum_last_poster_name varchar(255) NOT NULL DEFAULT '',
+ forum_last_poster_colour varchar(6) NOT NULL DEFAULT '',
+ forum_flags tinyint(4) NOT NULL DEFAULT '32',
+ forum_options INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ display_subforum_list INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ enable_indexing INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ enable_icons INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ enable_prune INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ prune_next INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ prune_days INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ prune_viewed INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ prune_freq INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums (left_id, right_id);
+CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums (forum_last_post_id);
+
+# Table: 'phpbb_forums_access'
+CREATE TABLE phpbb_forums_access (
+ forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ session_id char(32) NOT NULL DEFAULT '',
+ PRIMARY KEY (forum_id, user_id, session_id)
+);
+
+
+# Table: 'phpbb_forums_track'
+CREATE TABLE phpbb_forums_track (
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ mark_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (user_id, forum_id)
+);
+
+
+# Table: 'phpbb_forums_watch'
+CREATE TABLE phpbb_forums_watch (
+ forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ notify_status INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch (forum_id);
+CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch (user_id);
+CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch (notify_status);
+
+# Table: 'phpbb_groups'
+CREATE TABLE phpbb_groups (
+ group_id INTEGER PRIMARY KEY NOT NULL ,
+ group_type tinyint(4) NOT NULL DEFAULT '1',
+ group_founder_manage INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ group_skip_auth INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ group_name varchar(255) NOT NULL DEFAULT '',
+ group_desc text(65535) NOT NULL DEFAULT '',
+ group_desc_bitfield varchar(255) NOT NULL DEFAULT '',
+ group_desc_options INTEGER UNSIGNED NOT NULL DEFAULT '7',
+ group_desc_uid varchar(8) NOT NULL DEFAULT '',
+ group_display INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ group_avatar varchar(255) NOT NULL DEFAULT '',
+ group_avatar_type tinyint(2) NOT NULL DEFAULT '0',
+ group_avatar_width INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ group_avatar_height INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ group_rank INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ group_colour varchar(6) NOT NULL DEFAULT '',
+ group_sig_chars INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ group_receive_pm INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ group_message_limit INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ group_max_recipients INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ group_legend INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ group_teampage INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name);
+
+# Table: 'phpbb_icons'
+CREATE TABLE phpbb_icons (
+ icons_id INTEGER PRIMARY KEY NOT NULL ,
+ icons_url varchar(255) NOT NULL DEFAULT '',
+ icons_width tinyint(4) NOT NULL DEFAULT '0',
+ icons_height tinyint(4) NOT NULL DEFAULT '0',
+ icons_order INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '1'
+);
+
+CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons (display_on_posting);
+
+# Table: 'phpbb_lang'
+CREATE TABLE phpbb_lang (
+ lang_id INTEGER PRIMARY KEY NOT NULL ,
+ lang_iso varchar(30) NOT NULL DEFAULT '',
+ lang_dir varchar(30) NOT NULL DEFAULT '',
+ lang_english_name varchar(100) NOT NULL DEFAULT '',
+ lang_local_name varchar(255) NOT NULL DEFAULT '',
+ lang_author varchar(255) NOT NULL DEFAULT ''
+);
+
+CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang (lang_iso);
+
+# Table: 'phpbb_log'
+CREATE TABLE phpbb_log (
+ log_id INTEGER PRIMARY KEY NOT NULL ,
+ log_type tinyint(4) NOT NULL DEFAULT '0',
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ reportee_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ log_ip varchar(40) NOT NULL DEFAULT '',
+ log_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ log_operation text(65535) NOT NULL DEFAULT '',
+ log_data mediumtext(16777215) NOT NULL DEFAULT ''
+);
+
+CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type);
+CREATE INDEX phpbb_log_log_time ON phpbb_log (log_time);
+CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id);
+CREATE INDEX phpbb_log_topic_id ON phpbb_log (topic_id);
+CREATE INDEX phpbb_log_reportee_id ON phpbb_log (reportee_id);
+CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id);
+
+# Table: 'phpbb_login_attempts'
+CREATE TABLE phpbb_login_attempts (
+ attempt_ip varchar(40) NOT NULL DEFAULT '',
+ attempt_browser varchar(150) NOT NULL DEFAULT '',
+ attempt_forwarded_for varchar(255) NOT NULL DEFAULT '',
+ attempt_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ username varchar(255) NOT NULL DEFAULT '0',
+ username_clean varchar(255) NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts (attempt_ip, attempt_time);
+CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts (attempt_forwarded_for, attempt_time);
+CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts (attempt_time);
+CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts (user_id);
+
+# Table: 'phpbb_moderator_cache'
+CREATE TABLE phpbb_moderator_cache (
+ forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ username varchar(255) NOT NULL DEFAULT '',
+ group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ group_name varchar(255) NOT NULL DEFAULT '',
+ display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1'
+);
+
+CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache (display_on_index);
+CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache (forum_id);
+
+# Table: 'phpbb_modules'
+CREATE TABLE phpbb_modules (
+ module_id INTEGER PRIMARY KEY NOT NULL ,
+ module_enabled INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ module_display INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ module_basename varchar(255) NOT NULL DEFAULT '',
+ module_class varchar(10) NOT NULL DEFAULT '',
+ parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ left_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ right_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ module_langname varchar(255) NOT NULL DEFAULT '',
+ module_mode varchar(255) NOT NULL DEFAULT '',
+ module_auth varchar(255) NOT NULL DEFAULT ''
+);
+
+CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id);
+CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled);
+CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id);
+
+# Table: 'phpbb_poll_options'
+CREATE TABLE phpbb_poll_options (
+ poll_option_id tinyint(4) NOT NULL DEFAULT '0',
+ topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ poll_option_text text(65535) NOT NULL DEFAULT '',
+ poll_option_total INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options (poll_option_id);
+CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options (topic_id);
+
+# Table: 'phpbb_poll_votes'
+CREATE TABLE phpbb_poll_votes (
+ topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ poll_option_id tinyint(4) NOT NULL DEFAULT '0',
+ vote_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ vote_user_ip varchar(40) NOT NULL DEFAULT ''
+);
+
+CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes (topic_id);
+CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes (vote_user_id);
+CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes (vote_user_ip);
+
+# Table: 'phpbb_posts'
+CREATE TABLE phpbb_posts (
+ post_id INTEGER PRIMARY KEY NOT NULL ,
+ topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ icon_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ poster_ip varchar(40) NOT NULL DEFAULT '',
+ post_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ post_approved INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ post_reported INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ enable_bbcode INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ enable_smilies INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ enable_magic_url INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ enable_sig INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ post_username varchar(255) NOT NULL DEFAULT '',
+ post_subject text(65535) NOT NULL DEFAULT '',
+ post_text mediumtext(16777215) NOT NULL DEFAULT '',
+ post_checksum varchar(32) NOT NULL DEFAULT '',
+ post_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ bbcode_bitfield varchar(255) NOT NULL DEFAULT '',
+ bbcode_uid varchar(8) NOT NULL DEFAULT '',
+ post_postcount INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ post_edit_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ post_edit_reason text(65535) NOT NULL DEFAULT '',
+ post_edit_user INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ post_edit_count INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ post_edit_locked INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+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_username ON phpbb_posts (post_username);
+CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time);
+
+# Table: 'phpbb_privmsgs'
+CREATE TABLE phpbb_privmsgs (
+ msg_id INTEGER PRIMARY KEY NOT NULL ,
+ root_level INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ author_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ icon_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ author_ip varchar(40) NOT NULL DEFAULT '',
+ message_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ enable_bbcode INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ enable_smilies INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ enable_magic_url INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ enable_sig INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ message_subject text(65535) NOT NULL DEFAULT '',
+ message_text mediumtext(16777215) NOT NULL DEFAULT '',
+ message_edit_reason text(65535) NOT NULL DEFAULT '',
+ message_edit_user INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ message_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ bbcode_bitfield varchar(255) NOT NULL DEFAULT '',
+ bbcode_uid varchar(8) NOT NULL DEFAULT '',
+ message_edit_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ message_edit_count INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ to_address text(65535) NOT NULL DEFAULT '',
+ bcc_address text(65535) NOT NULL DEFAULT '',
+ message_reported INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs (author_ip);
+CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs (message_time);
+CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs (author_id);
+CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs (root_level);
+
+# Table: 'phpbb_privmsgs_folder'
+CREATE TABLE phpbb_privmsgs_folder (
+ folder_id INTEGER PRIMARY KEY NOT NULL ,
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ folder_name varchar(255) NOT NULL DEFAULT '',
+ pm_count INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id);
+
+# Table: 'phpbb_privmsgs_rules'
+CREATE TABLE phpbb_privmsgs_rules (
+ rule_id INTEGER PRIMARY KEY NOT NULL ,
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ rule_check INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ rule_connection INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ rule_string varchar(255) NOT NULL DEFAULT '',
+ rule_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ rule_group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ rule_action INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ rule_folder_id int(11) NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules (user_id);
+
+# Table: 'phpbb_privmsgs_to'
+CREATE TABLE phpbb_privmsgs_to (
+ msg_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ author_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ pm_deleted INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ pm_new INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ pm_unread INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ pm_replied INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ pm_marked INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ pm_forwarded INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ folder_id int(11) NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id);
+CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to (author_id);
+CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folder_id);
+
+# Table: 'phpbb_profile_fields'
+CREATE TABLE phpbb_profile_fields (
+ field_id INTEGER PRIMARY KEY NOT NULL ,
+ field_name varchar(255) NOT NULL DEFAULT '',
+ field_type tinyint(4) NOT NULL DEFAULT '0',
+ field_ident varchar(20) NOT NULL DEFAULT '',
+ field_length varchar(20) NOT NULL DEFAULT '',
+ field_minlen varchar(255) NOT NULL DEFAULT '',
+ field_maxlen varchar(255) NOT NULL DEFAULT '',
+ field_novalue varchar(255) NOT NULL DEFAULT '',
+ field_default_value varchar(255) NOT NULL DEFAULT '',
+ field_validation varchar(20) NOT NULL DEFAULT '',
+ field_required INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ field_show_novalue INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ field_show_on_reg INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ field_show_on_pm INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ field_show_on_vt INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ field_show_profile INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ field_hide INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ field_no_view INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ field_active INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ field_order INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields (field_type);
+CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields (field_order);
+
+# Table: 'phpbb_profile_fields_data'
+CREATE TABLE phpbb_profile_fields_data (
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (user_id)
+);
+
+
+# Table: 'phpbb_profile_fields_lang'
+CREATE TABLE phpbb_profile_fields_lang (
+ field_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ lang_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ field_type tinyint(4) NOT NULL DEFAULT '0',
+ lang_value varchar(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (field_id, lang_id, option_id)
+);
+
+
+# Table: 'phpbb_profile_lang'
+CREATE TABLE phpbb_profile_lang (
+ field_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ lang_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ lang_name varchar(255) NOT NULL DEFAULT '',
+ lang_explain text(65535) NOT NULL DEFAULT '',
+ lang_default_value varchar(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (field_id, lang_id)
+);
+
+
+# Table: 'phpbb_ranks'
+CREATE TABLE phpbb_ranks (
+ rank_id INTEGER PRIMARY KEY NOT NULL ,
+ rank_title varchar(255) NOT NULL DEFAULT '',
+ rank_min INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ rank_special INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ rank_image varchar(255) NOT NULL DEFAULT ''
+);
+
+
+# Table: 'phpbb_reports'
+CREATE TABLE phpbb_reports (
+ report_id INTEGER PRIMARY KEY NOT NULL ,
+ reason_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ pm_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_notify INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ report_closed INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ report_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ report_text mediumtext(16777215) NOT NULL DEFAULT '',
+ reported_post_text mediumtext(16777215) NOT NULL DEFAULT ''
+);
+
+CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id);
+CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id);
+
+# Table: 'phpbb_reports_reasons'
+CREATE TABLE phpbb_reports_reasons (
+ reason_id INTEGER PRIMARY KEY NOT NULL ,
+ reason_title varchar(255) NOT NULL DEFAULT '',
+ reason_description mediumtext(16777215) NOT NULL DEFAULT '',
+ reason_order INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+
+# Table: 'phpbb_search_results'
+CREATE TABLE phpbb_search_results (
+ search_key varchar(32) NOT NULL DEFAULT '',
+ search_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ search_keywords mediumtext(16777215) NOT NULL DEFAULT '',
+ search_authors mediumtext(16777215) NOT NULL DEFAULT '',
+ PRIMARY KEY (search_key)
+);
+
+
+# Table: 'phpbb_search_wordlist'
+CREATE TABLE phpbb_search_wordlist (
+ word_id INTEGER PRIMARY KEY NOT NULL ,
+ word_text varchar(255) NOT NULL DEFAULT '',
+ word_common INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ word_count INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist (word_text);
+CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist (word_count);
+
+# Table: 'phpbb_search_wordmatch'
+CREATE TABLE phpbb_search_wordmatch (
+ post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ word_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ title_match INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+CREATE UNIQUE INDEX phpbb_search_wordmatch_unq_mtch ON phpbb_search_wordmatch (word_id, post_id, title_match);
+CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id);
+CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id);
+
+# Table: 'phpbb_sessions'
+CREATE TABLE phpbb_sessions (
+ session_id char(32) NOT NULL DEFAULT '',
+ session_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ session_forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ session_last_visit INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ session_start INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ session_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ session_ip varchar(40) NOT NULL DEFAULT '',
+ session_browser varchar(150) NOT NULL DEFAULT '',
+ session_forwarded_for varchar(255) NOT NULL DEFAULT '',
+ session_page varchar(255) NOT NULL DEFAULT '',
+ session_viewonline INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ session_autologin INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ session_admin INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (session_id)
+);
+
+CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions (session_time);
+CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions (session_user_id);
+CREATE INDEX phpbb_sessions_session_fid ON phpbb_sessions (session_forum_id);
+
+# Table: 'phpbb_sessions_keys'
+CREATE TABLE phpbb_sessions_keys (
+ key_id char(32) NOT NULL DEFAULT '',
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ last_ip varchar(40) NOT NULL DEFAULT '',
+ last_login INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (key_id, user_id)
+);
+
+CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login);
+
+# Table: 'phpbb_sitelist'
+CREATE TABLE phpbb_sitelist (
+ site_id INTEGER PRIMARY KEY NOT NULL ,
+ site_ip varchar(40) NOT NULL DEFAULT '',
+ site_hostname varchar(255) NOT NULL DEFAULT '',
+ ip_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+
+# Table: 'phpbb_smilies'
+CREATE TABLE phpbb_smilies (
+ smiley_id INTEGER PRIMARY KEY NOT NULL ,
+ code varchar(50) NOT NULL DEFAULT '',
+ emotion varchar(50) NOT NULL DEFAULT '',
+ smiley_url varchar(50) NOT NULL DEFAULT '',
+ smiley_width INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ smiley_height INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ smiley_order INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '1'
+);
+
+CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting);
+
+# Table: 'phpbb_styles'
+CREATE TABLE phpbb_styles (
+ style_id INTEGER PRIMARY KEY NOT NULL ,
+ style_name varchar(255) NOT NULL DEFAULT '',
+ style_copyright varchar(255) NOT NULL DEFAULT '',
+ style_active INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ style_path varchar(100) NOT NULL DEFAULT '',
+ bbcode_bitfield varchar(255) NOT NULL DEFAULT 'kNg=',
+ style_parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ style_parent_tree text(65535) NOT NULL DEFAULT ''
+);
+
+CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name);
+
+# Table: 'phpbb_topics'
+CREATE TABLE phpbb_topics (
+ topic_id INTEGER PRIMARY KEY NOT NULL ,
+ forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ icon_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_approved INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ topic_reported INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_title text(65535) NOT NULL DEFAULT '',
+ topic_poster INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_time_limit INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_views INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_replies INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_replies_real INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_status tinyint(3) NOT NULL DEFAULT '0',
+ topic_type tinyint(3) NOT NULL DEFAULT '0',
+ topic_first_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_first_poster_name varchar(255) NOT NULL DEFAULT '',
+ topic_first_poster_colour varchar(6) NOT NULL DEFAULT '',
+ topic_last_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_last_poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_last_poster_name varchar(255) NOT NULL DEFAULT '',
+ topic_last_poster_colour varchar(6) NOT NULL DEFAULT '',
+ topic_last_post_subject text(65535) NOT NULL DEFAULT '',
+ topic_last_post_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_last_view_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_moved_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_bumped INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_bumper INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ poll_title text(65535) NOT NULL DEFAULT '',
+ poll_start INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ poll_length INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ poll_max_options tinyint(4) NOT NULL DEFAULT '1',
+ poll_last_vote INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ poll_vote_change INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_topics_forum_id ON phpbb_topics (forum_id);
+CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics (forum_id, topic_type);
+CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics (topic_last_post_time);
+CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics (topic_approved);
+CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics (forum_id, topic_approved, topic_last_post_id);
+CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id);
+
+# Table: 'phpbb_topics_track'
+CREATE TABLE phpbb_topics_track (
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ mark_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (user_id, topic_id)
+);
+
+CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id);
+CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id);
+
+# Table: 'phpbb_topics_posted'
+CREATE TABLE phpbb_topics_posted (
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ topic_posted INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (user_id, topic_id)
+);
+
+
+# Table: 'phpbb_topics_watch'
+CREATE TABLE phpbb_topics_watch (
+ topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ notify_status INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch (topic_id);
+CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch (user_id);
+CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status);
+
+# Table: 'phpbb_user_group'
+CREATE TABLE phpbb_user_group (
+ group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ group_leader INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_pending INTEGER UNSIGNED NOT NULL DEFAULT '1'
+);
+
+CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group (group_id);
+CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group (user_id);
+CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group (group_leader);
+
+# Table: 'phpbb_users'
+CREATE TABLE phpbb_users (
+ user_id INTEGER PRIMARY KEY NOT NULL ,
+ user_type tinyint(2) NOT NULL DEFAULT '0',
+ group_id INTEGER UNSIGNED NOT NULL DEFAULT '3',
+ user_permissions mediumtext(16777215) NOT NULL DEFAULT '',
+ user_perm_from INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_ip varchar(40) NOT NULL DEFAULT '',
+ user_regdate INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ username varchar(255) NOT NULL DEFAULT '',
+ username_clean varchar(255) NOT NULL DEFAULT '',
+ user_password varchar(40) NOT NULL DEFAULT '',
+ user_passchg INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_pass_convert INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_email varchar(100) NOT NULL DEFAULT '',
+ user_email_hash bigint(20) NOT NULL DEFAULT '0',
+ user_birthday varchar(10) NOT NULL DEFAULT '',
+ user_lastvisit INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_lastmark INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_lastpost_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_lastpage varchar(200) NOT NULL DEFAULT '',
+ user_last_confirm_key varchar(10) NOT NULL DEFAULT '',
+ user_last_search INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_warnings tinyint(4) NOT NULL DEFAULT '0',
+ user_last_warning INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_login_attempts tinyint(4) NOT NULL DEFAULT '0',
+ user_inactive_reason tinyint(2) NOT NULL DEFAULT '0',
+ user_inactive_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_posts INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_lang varchar(30) NOT NULL DEFAULT '',
+ user_timezone varchar(100) NOT NULL DEFAULT 'UTC',
+ user_dateformat varchar(30) NOT NULL DEFAULT 'd M Y H:i',
+ user_style INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_rank INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_colour varchar(6) NOT NULL DEFAULT '',
+ user_new_privmsg int(4) NOT NULL DEFAULT '0',
+ user_unread_privmsg int(4) NOT NULL DEFAULT '0',
+ user_last_privmsg INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_message_rules INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_full_folder int(11) NOT NULL DEFAULT '-3',
+ user_emailtime INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_topic_show_days INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_topic_sortby_type varchar(1) NOT NULL DEFAULT 't',
+ user_topic_sortby_dir varchar(1) NOT NULL DEFAULT 'd',
+ user_post_show_days INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_post_sortby_type varchar(1) NOT NULL DEFAULT 't',
+ user_post_sortby_dir varchar(1) NOT NULL DEFAULT 'a',
+ user_notify INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_notify_pm INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ user_notify_type tinyint(4) NOT NULL DEFAULT '0',
+ user_allow_pm INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ user_allow_viewonline INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ user_allow_viewemail INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ user_allow_massemail INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ user_options INTEGER UNSIGNED NOT NULL DEFAULT '230271',
+ user_avatar varchar(255) NOT NULL DEFAULT '',
+ user_avatar_type tinyint(2) NOT NULL DEFAULT '0',
+ user_avatar_width INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_avatar_height INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ user_sig mediumtext(16777215) NOT NULL DEFAULT '',
+ user_sig_bbcode_uid varchar(8) NOT NULL DEFAULT '',
+ user_sig_bbcode_bitfield varchar(255) NOT NULL DEFAULT '',
+ user_from varchar(100) NOT NULL DEFAULT '',
+ user_icq varchar(15) NOT NULL DEFAULT '',
+ user_aim varchar(255) NOT NULL DEFAULT '',
+ user_yim varchar(255) NOT NULL DEFAULT '',
+ user_msnm varchar(255) NOT NULL DEFAULT '',
+ user_jabber varchar(255) NOT NULL DEFAULT '',
+ user_website varchar(200) NOT NULL DEFAULT '',
+ user_occ text(65535) NOT NULL DEFAULT '',
+ user_interests text(65535) NOT NULL DEFAULT '',
+ user_actkey varchar(32) NOT NULL DEFAULT '',
+ user_newpasswd varchar(40) NOT NULL DEFAULT '',
+ user_form_salt varchar(32) NOT NULL DEFAULT '',
+ user_new INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ user_reminded tinyint(4) NOT NULL DEFAULT '0',
+ user_reminded_time INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday);
+CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash);
+CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type);
+CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users (username_clean);
+
+# Table: 'phpbb_warnings'
+CREATE TABLE phpbb_warnings (
+ warning_id INTEGER PRIMARY KEY NOT NULL ,
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ log_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ warning_time INTEGER UNSIGNED NOT NULL DEFAULT '0'
+);
+
+
+# Table: 'phpbb_words'
+CREATE TABLE phpbb_words (
+ word_id INTEGER PRIMARY KEY NOT NULL ,
+ word varchar(255) NOT NULL DEFAULT '',
+ replacement varchar(255) NOT NULL DEFAULT ''
+);
+
+
+# Table: 'phpbb_zebra'
+CREATE TABLE phpbb_zebra (
+ user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ zebra_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ friend INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ foe INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (user_id, zebra_id)
+);
diff --git a/phpBB/mcp.php b/phpBB/mcp.php
index d04a297cf9..984925789f 100644
--- a/phpBB/mcp.php
+++ b/phpBB/mcp.php
@@ -483,7 +483,7 @@ function get_post_data($post_ids, $acl_list = false, $read_tracking = false)
continue;
}
- if (!$row['post_approved'] && !$auth->acl_get('m_approve', $row['forum_id']))
+ if ($row['post_visibility'] == ITEM_UNAPPROVED && !$auth->acl_get('m_approve', $row['forum_id']))
{
// Moderators without the permission to approve post should at least not see them. ;)
continue;
@@ -619,7 +619,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
if (!$auth->acl_get('m_approve', $forum_id))
{
- $sql .= 'AND topic_approved = 1';
+ $sql .= 'AND post_visibility = ' . ITEM_APPROVED;
}
break;
@@ -635,7 +635,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
if (!$auth->acl_get('m_approve', $forum_id))
{
- $sql .= 'AND post_approved = 1';
+ $sql .= 'AND post_visibility = ' . ITEM_APPROVED;
}
break;
@@ -648,7 +648,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
$sql = 'SELECT COUNT(p.post_id) AS total
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
$where_sql " . $db->sql_in_set('p.forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
- AND p.post_approved = 0
+ AND p.post_visibility = ' . ITEM_UNAPPROVED . '
AND t.topic_id = p.topic_id
AND t.topic_first_post_id <> p.post_id';
@@ -666,7 +666,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
$sql = 'SELECT COUNT(topic_id) AS total
FROM ' . TOPICS_TABLE . "
$where_sql " . $db->sql_in_set('forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
- AND topic_approved = 0';
+ AND topic_visibility = ' . ITEM_UNAPPROVED;
if ($min_time)
{
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index f142d182bc..f8cb55ccc4 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -613,7 +613,7 @@ switch ($mode)
$sql = 'SELECT COUNT(post_id) as posts_in_queue
FROM ' . POSTS_TABLE . '
WHERE poster_id = ' . $user_id . '
- AND post_approved = 0';
+ AND post_visibility = ' . ITEM_UNAPPROVED;
$result = $db->sql_query($sql);
$member['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue');
$db->sql_freeresult($result);
diff --git a/phpBB/posting.php b/phpBB/posting.php
index a17578e343..273499c1e4 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -86,8 +86,8 @@ switch ($mode)
$sql = 'SELECT f.*, t.*
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f
WHERE t.topic_id = $topic_id
- AND f.forum_id = t.forum_id" .
- (($auth->acl_get('m_approve', $forum_id)) ? '' : ' AND t.topic_approved = 1');
+ AND f.forum_id = t.forum_id
+ AND " . topic_visibility::get_visibility_sql('topic', $forum_id, 't.');
break;
case 'quote':
@@ -114,8 +114,8 @@ switch ($mode)
WHERE p.post_id = $post_id
AND t.topic_id = p.topic_id
AND u.user_id = p.poster_id
- AND f.forum_id = t.forum_id" .
- (($auth->acl_get('m_approve', $forum_id)) ? '' : ' AND p.post_approved = 1');
+ AND f.forum_id = t.forum_id
+ AND " . topic_visibility::get_visibility_sql('topic', $forum_id, 't.');
break;
case 'smilies':
@@ -163,7 +163,7 @@ if (!$post_data)
// Not able to reply to unapproved posts/topics
// TODO: add more descriptive language key
-if ($auth->acl_get('m_approve', $forum_id) && ((($mode == 'reply' || $mode == 'bump') && !$post_data['topic_approved']) || ($mode == 'quote' && !$post_data['post_approved'])))
+if ($auth->acl_get('m_approve', $forum_id) && ((($mode == 'reply' || $mode == 'bump') && $post_data['topic_visibility'] == ITEM_UNAPPROVED) || ($mode == 'quote' && $post_data['post_visibility'] == ITEM_UNAPPROVED)))
{
trigger_error(($mode == 'reply' || $mode == 'bump') ? 'TOPIC_UNAPPROVED' : 'POST_UNAPPROVED');
}
@@ -1063,8 +1063,8 @@ if ($submit || $preview || $refresh)
'attachment_data' => $message_parser->attachment_data,
'filename_data' => $message_parser->filename_data,
- 'topic_approved' => (isset($post_data['topic_approved'])) ? $post_data['topic_approved'] : false,
- 'post_approved' => (isset($post_data['post_approved'])) ? $post_data['post_approved'] : false,
+ 'topic_visibility' => (isset($post_data['topic_visibility'])) ? $post_data['topic_visibility'] : false,
+ 'post_visibility' => (isset($post_data['post_visibility'])) ? $post_data['post_visibility'] : false,
);
if ($mode == 'edit')
@@ -1514,9 +1514,9 @@ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data)
'topic_first_post_id' => $post_data['topic_first_post_id'],
'topic_last_post_id' => $post_data['topic_last_post_id'],
'topic_replies_real' => $post_data['topic_replies_real'],
- 'topic_approved' => $post_data['topic_approved'],
+ 'topic_visibility' => $post_data['topic_visibility'],
'topic_type' => $post_data['topic_type'],
- 'post_approved' => $post_data['post_approved'],
+ 'post_visibility' => $post_data['post_visibility'],
'post_reported' => $post_data['post_reported'],
'post_time' => $post_data['post_time'],
'poster_id' => $post_data['poster_id'],
diff --git a/phpBB/search.php b/phpBB/search.php
index 190da5247f..7bf941f127 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -249,7 +249,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
$db->sql_freeresult($result);
- // find out in which forums the user is allowed to view approved posts
+/* // find out in which forums the user is allowed to view approved posts
if ($auth->acl_get('m_approve'))
{
$m_approve_fid_ary = array(-1);
@@ -265,6 +265,8 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$m_approve_fid_ary = array();
$m_approve_fid_sql = ' AND p.post_approved = 1';
}
+*/
+ $m_approve_fid_sql = ' AND ' . topic_visibility::get_visibility_sql_global('post', $ex_fid_ary, 'p.');
if ($reset_search_forum)
{
@@ -523,17 +525,17 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// make sure that some arrays are always in the same order
sort($ex_fid_ary);
- sort($m_approve_fid_ary);
+// @TODO sort($m_approve_fid_ary);
sort($author_id_ary);
if (!empty($search->search_query))
{
- $total_match_count = $search->keyword_search($show_results, $search_fields, $search_terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page);
+ $total_match_count = $search->keyword_search($show_results, $search_fields, $search_terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_sql, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page);
}
else if (sizeof($author_id_ary))
{
$firstpost_only = ($search_fields === 'firstpost' || $search_fields == 'titleonly') ? true : false;
- $total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page);
+ $total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_sql, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page);
}
// For some searches we need to print out the "no results" page directly to allow re-sorting/refining the search options.
@@ -548,7 +550,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
{
$sql_where .= $db->sql_in_set(($show_results == 'posts') ? 'p.post_id' : 't.topic_id', $id_ary);
$sql_where .= (sizeof($ex_fid_ary)) ? ' AND (' . $db->sql_in_set('f.forum_id', $ex_fid_ary, true) . ' OR f.forum_id IS NULL)' : '';
- $sql_where .= ($show_results == 'posts') ? $m_approve_fid_sql : str_replace(array('p.post_approved', 'p.forum_id'), array('t.topic_approved', 't.forum_id'), $m_approve_fid_sql);
+ $sql_where .= ($show_results == 'posts') ? $m_approve_fid_sql : str_replace(array('p.post_visibility', 'p.forum_id'), array('t.topic_visibility', 't.forum_id'), $m_approve_fid_sql);
}
if ($show_results == 'posts')
@@ -882,8 +884,9 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$unread_topic = (isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']]) ? true : false;
- $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
- $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
+ $topic_unapproved = ($row['topic_visibility'] == ITEM_UNAPPROVED && $auth->acl_get('m_approve', $forum_id)) ? true : false;
+ $posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
+ $topic_deleted = ($row['topic_visibility'] == ITEM_DELETED) ? true : false;
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$result_topic_id", true, $user->session_id) : '';
$row['topic_title'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $row['topic_title']);
@@ -911,6 +914,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
+ 'DELETED_IMG' => ($topic_deleted) ? $user->img(/*TODO*/) : '',
'S_TOPIC_TYPE' => $row['topic_type'],
'S_USER_POSTED' => (!empty($row['topic_posted'])) ? true : false,
@@ -919,6 +923,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $forum_id)) ? true : false,
'S_TOPIC_UNAPPROVED' => $topic_unapproved,
'S_POSTS_UNAPPROVED' => $posts_unapproved,
+ 'S_TOPIC_DELETED' => $topic_deleted,
'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&amp;p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 783c7181d2..2c29d92cd8 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -241,7 +241,7 @@ if ($sort_days)
AND (topic_last_post_time >= $min_post_time
OR topic_type = " . POST_ANNOUNCE . '
OR topic_type = ' . POST_GLOBAL . ')
- ' . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND topic_approved = 1');
+ AND ' . topic_visibility::get_visibility_sql('topic', $forum_id);
$result = $db->sql_query($sql);
$topics_count = (int) $db->sql_fetchfield('num_topics');
$db->sql_freeresult($result);
@@ -353,7 +353,7 @@ $sql_array = array(
'LEFT_JOIN' => array(),
);
-$sql_approved = ($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1';
+$sql_approved = 'AND ' . topic_visibility::get_visibility_sql('topic', $forum_id, 't.');
if ($user->data['is_registered'])
{
@@ -685,8 +685,9 @@ if (sizeof($topic_list))
$view_topic_url_params = 'f=' . $row['forum_id'] . '&amp;t=' . $topic_id;
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params);
- $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
- $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
+ $topic_unapproved = ($row['topic_visibility'] == ITEM_UNAPPROVED && $auth->acl_get('m_approve', $row['forum_id']));
+ $posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $row['forum_id']));
+ $topic_deleted = ($row['topic_visibility'] == ITEM_DELETED);
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$topic_id", true, $user->session_id) : '';
// Send vars to template
@@ -719,6 +720,7 @@ if (sizeof($topic_list))
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
+ 'DELETED_IMG' => ($topic_deleted) ? $user->img(/*TODO*/) : '',
'S_TOPIC_TYPE' => $row['topic_type'],
'S_USER_POSTED' => (isset($row['topic_posted']) && $row['topic_posted']) ? true : false,
@@ -726,6 +728,7 @@ if (sizeof($topic_list))
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false,
'S_TOPIC_UNAPPROVED' => $topic_unapproved,
'S_POSTS_UNAPPROVED' => $posts_unapproved,
+ 'S_TOPIC_DELETED' => $topic_deleted,
'S_HAS_POLL' => ($row['poll_start']) ? true : false,
'S_POST_ANNOUNCE' => ($row['topic_type'] == POST_ANNOUNCE) ? true : false,
'S_POST_GLOBAL' => ($row['topic_type'] == POST_GLOBAL) ? true : false,
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 3fde5b5e03..282c23cd70 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -83,7 +83,7 @@ if ($view && !$post_id)
$sql = 'SELECT post_id, topic_id, forum_id
FROM ' . POSTS_TABLE . "
WHERE topic_id = $topic_id
- " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1') . "
+ AND " . topic_visibility::get_visibility_sql('post', $forum_id) . "
AND post_time > $topic_last_read
AND forum_id = $forum_id
ORDER BY post_time ASC";
@@ -137,7 +137,7 @@ if ($view && !$post_id)
WHERE forum_id = ' . $row['forum_id'] . "
AND topic_moved_id = 0
AND topic_last_post_time $sql_condition {$row['topic_last_post_time']}
- " . (($auth->acl_get('m_approve', $row['forum_id'])) ? '' : 'AND topic_approved = 1') . "
+ AND" . topic_visibility::get_visibility_sql('topic', $row['forum_id']) . "
ORDER BY topic_last_post_time $sql_ordering";
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
@@ -174,7 +174,7 @@ $sql_array = array(
// The FROM-Order is quite important here, else t.* columns can not be correctly bound.
if ($post_id)
{
- $sql_array['SELECT'] .= ', p.post_approved, p.post_time, p.post_id';
+ $sql_array['SELECT'] .= ', p.post_visibility, p.post_time, p.post_id';
$sql_array['FROM'][POSTS_TABLE] = 'p';
}
@@ -249,7 +249,7 @@ $forum_id = (int) $topic_data['forum_id'];
if ($post_id)
{
// are we where we are supposed to be?
- if (!$topic_data['post_approved'] && !$auth->acl_get('m_approve', $topic_data['forum_id']))
+ if ($topic_data['post_visibility'] == ITEM_UNAPPROVED && !$auth->acl_get('m_approve', $topic_data['forum_id']))
{
// If post_id was submitted, we try at least to display the topic as a last resort...
if ($topic_id)
@@ -277,7 +277,7 @@ if ($post_id)
$sql = 'SELECT COUNT(p.post_id) AS prev_posts
FROM ' . POSTS_TABLE . " p
WHERE p.topic_id = {$topic_data['topic_id']}
- " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '');
+ " . topic_visibility::get_visibility_sql('post', $forum_id, 'p');
if ($sort_dir == 'd')
{
@@ -315,7 +315,13 @@ if (($topic_data['topic_type'] == POST_STICKY || $topic_data['topic_type'] == PO
// Setup look and feel
$user->setup('viewtopic', $topic_data['forum_style']);
-if (!$topic_data['topic_approved'] && !$auth->acl_get('m_approve', $forum_id))
+/* the topic "does not exist":
+* if the topic is unapproved and the user cannot approve it
+* if the topic is deleted and the user cannot restore it
+* NB: restoring a topic has two cases: moderator restore and poster restore.
+*/
+if (($topic_data['topic_visibility'] == ITEM_UNAPPROVED && !$auth->acl_get('m_approve', $forum_id))
+ || ($topic_data['topic_visibility'] == ITEM_DELETED && (!$auth->acl_get('m_restore', $forum_id) || ($user->data['user_id'] == $topic_data['topic_poster'] && $auth->acl_get('f_restore', $forum_id)))))
{
trigger_error('NO_TOPIC');
}
@@ -402,7 +408,7 @@ if ($sort_days)
FROM ' . POSTS_TABLE . "
WHERE topic_id = $topic_id
AND post_time >= $min_post_time
- " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1');
+ AND " . topic_visibility::get_visibility_sql('post', $forum_id);
$result = $db->sql_query($sql);
$total_posts = (int) $db->sql_fetchfield('num_posts');
$db->sql_freeresult($result);
@@ -938,7 +944,7 @@ $i = $i_total = 0;
$sql = 'SELECT p.post_id
FROM ' . POSTS_TABLE . ' p' . (($join_user_sql[$sort_key]) ? ', ' . USERS_TABLE . ' u': '') . "
WHERE p.topic_id = $topic_id
- " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . "
+ AND " . topic_visibility::get_visibility_sql('post', $forum_id, 'p.') . "
" . (($join_user_sql[$sort_key]) ? 'AND u.user_id = p.poster_id': '') . "
$limit_posts_time
ORDER BY $sql_sort_order";
@@ -1020,7 +1026,7 @@ while ($row = $db->sql_fetchrow($result))
{
$attach_list[] = (int) $row['post_id'];
- if ($row['post_approved'])
+ if ($row['post_visibility'] == ITEM_UNAPPROVED)
{
$has_attachments = true;
}
@@ -1046,7 +1052,7 @@ while ($row = $db->sql_fetchrow($result))
// Make sure the icon actually exists
'icon_id' => (isset($icons[$row['icon_id']]['img'], $icons[$row['icon_id']]['height'], $icons[$row['icon_id']]['width'])) ? $row['icon_id'] : 0,
'post_attachment' => $row['post_attachment'],
- 'post_approved' => $row['post_approved'],
+ 'post_visibility' => $row['post_visibility'],
'post_reported' => $row['post_reported'],
'post_username' => $row['post_username'],
'post_text' => $row['post_text'],
@@ -1313,8 +1319,8 @@ if (sizeof($attach_list))
$sql = 'SELECT a.post_msg_id as post_id
FROM ' . ATTACHMENTS_TABLE . ' a, ' . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
- AND p.post_approved = 1
- AND p.topic_id = a.topic_id";
+ AND p.post_visibility = " . ITEM_APPROVED . '
+ AND p.topic_id = a.topic_id';
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -1605,7 +1611,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
'S_MULTIPLE_ATTACHMENTS' => !empty($attachments[$row['post_id']]) && sizeof($attachments[$row['post_id']]) > 1,
- 'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true,
+ 'S_POST_UNAPPROVED' => ($row['post_visibility'] == ITEM_APPROVED) ? false : true,
'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $forum_id)) ? true : false,
'S_DISPLAY_NOTICE' => $display_notice && $row['post_attachment'],
'S_FRIEND' => ($row['friend']) ? true : false,