install/schemas/sqlite_schema.sql
changeset 0 ceef6d64c21d
equal deleted inserted replaced
-1:000000000000 0:ceef6d64c21d
       
     1 # DO NOT EDIT THIS FILE, IT IS GENERATED
       
     2 #
       
     3 # To change the contents of this file, edit
       
     4 # phpBB/develop/create_schema_files.php and
       
     5 # run it.
       
     6 BEGIN TRANSACTION;
       
     7 
       
     8 # Table: 'phpbb_attachments'
       
     9 CREATE TABLE phpbb_attachments (
       
    10 	attach_id INTEGER PRIMARY KEY NOT NULL ,
       
    11 	post_msg_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    12 	topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    13 	in_message INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    14 	poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    15 	is_orphan INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
    16 	physical_filename varchar(255) NOT NULL DEFAULT '',
       
    17 	real_filename varchar(255) NOT NULL DEFAULT '',
       
    18 	download_count INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    19 	attach_comment text(65535) NOT NULL DEFAULT '',
       
    20 	extension varchar(100) NOT NULL DEFAULT '',
       
    21 	mimetype varchar(100) NOT NULL DEFAULT '',
       
    22 	filesize INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    23 	filetime INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    24 	thumbnail INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
    25 );
       
    26 
       
    27 CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments (filetime);
       
    28 CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments (post_msg_id);
       
    29 CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments (topic_id);
       
    30 CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id);
       
    31 CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments (is_orphan);
       
    32 
       
    33 # Table: 'phpbb_acl_groups'
       
    34 CREATE TABLE phpbb_acl_groups (
       
    35 	group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    36 	forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    37 	auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    38 	auth_role_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    39 	auth_setting tinyint(2) NOT NULL DEFAULT '0'
       
    40 );
       
    41 
       
    42 CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups (group_id);
       
    43 CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups (auth_option_id);
       
    44 CREATE INDEX phpbb_acl_groups_auth_role_id ON phpbb_acl_groups (auth_role_id);
       
    45 
       
    46 # Table: 'phpbb_acl_options'
       
    47 CREATE TABLE phpbb_acl_options (
       
    48 	auth_option_id INTEGER PRIMARY KEY NOT NULL ,
       
    49 	auth_option varchar(50) NOT NULL DEFAULT '',
       
    50 	is_global INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    51 	is_local INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    52 	founder_only INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
    53 );
       
    54 
       
    55 CREATE UNIQUE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options (auth_option);
       
    56 
       
    57 # Table: 'phpbb_acl_roles'
       
    58 CREATE TABLE phpbb_acl_roles (
       
    59 	role_id INTEGER PRIMARY KEY NOT NULL ,
       
    60 	role_name varchar(255) NOT NULL DEFAULT '',
       
    61 	role_description text(65535) NOT NULL DEFAULT '',
       
    62 	role_type varchar(10) NOT NULL DEFAULT '',
       
    63 	role_order INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
    64 );
       
    65 
       
    66 CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles (role_type);
       
    67 CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles (role_order);
       
    68 
       
    69 # Table: 'phpbb_acl_roles_data'
       
    70 CREATE TABLE phpbb_acl_roles_data (
       
    71 	role_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    72 	auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    73 	auth_setting tinyint(2) NOT NULL DEFAULT '0',
       
    74 	PRIMARY KEY (role_id, auth_option_id)
       
    75 );
       
    76 
       
    77 CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id);
       
    78 
       
    79 # Table: 'phpbb_acl_users'
       
    80 CREATE TABLE phpbb_acl_users (
       
    81 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    82 	forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    83 	auth_option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    84 	auth_role_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    85 	auth_setting tinyint(2) NOT NULL DEFAULT '0'
       
    86 );
       
    87 
       
    88 CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users (user_id);
       
    89 CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users (auth_option_id);
       
    90 CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users (auth_role_id);
       
    91 
       
    92 # Table: 'phpbb_banlist'
       
    93 CREATE TABLE phpbb_banlist (
       
    94 	ban_id INTEGER PRIMARY KEY NOT NULL ,
       
    95 	ban_userid INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    96 	ban_ip varchar(40) NOT NULL DEFAULT '',
       
    97 	ban_email varchar(100) NOT NULL DEFAULT '',
       
    98 	ban_start INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
    99 	ban_end INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   100 	ban_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   101 	ban_reason varchar(255) NOT NULL DEFAULT '',
       
   102 	ban_give_reason varchar(255) NOT NULL DEFAULT ''
       
   103 );
       
   104 
       
   105 CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end);
       
   106 CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist (ban_userid, ban_exclude);
       
   107 CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist (ban_email, ban_exclude);
       
   108 CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist (ban_ip, ban_exclude);
       
   109 
       
   110 # Table: 'phpbb_bbcodes'
       
   111 CREATE TABLE phpbb_bbcodes (
       
   112 	bbcode_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   113 	bbcode_tag varchar(16) NOT NULL DEFAULT '',
       
   114 	bbcode_helpline varchar(255) NOT NULL DEFAULT '',
       
   115 	display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   116 	bbcode_match text(65535) NOT NULL DEFAULT '',
       
   117 	bbcode_tpl mediumtext(16777215) NOT NULL DEFAULT '',
       
   118 	first_pass_match mediumtext(16777215) NOT NULL DEFAULT '',
       
   119 	first_pass_replace mediumtext(16777215) NOT NULL DEFAULT '',
       
   120 	second_pass_match mediumtext(16777215) NOT NULL DEFAULT '',
       
   121 	second_pass_replace mediumtext(16777215) NOT NULL DEFAULT '',
       
   122 	PRIMARY KEY (bbcode_id)
       
   123 );
       
   124 
       
   125 CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes (display_on_posting);
       
   126 
       
   127 # Table: 'phpbb_bookmarks'
       
   128 CREATE TABLE phpbb_bookmarks (
       
   129 	topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   130 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   131 	PRIMARY KEY (topic_id, user_id)
       
   132 );
       
   133 
       
   134 
       
   135 # Table: 'phpbb_bots'
       
   136 CREATE TABLE phpbb_bots (
       
   137 	bot_id INTEGER PRIMARY KEY NOT NULL ,
       
   138 	bot_active INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   139 	bot_name text(65535) NOT NULL DEFAULT '',
       
   140 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   141 	bot_agent varchar(255) NOT NULL DEFAULT '',
       
   142 	bot_ip varchar(255) NOT NULL DEFAULT ''
       
   143 );
       
   144 
       
   145 CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active);
       
   146 
       
   147 # Table: 'phpbb_config'
       
   148 CREATE TABLE phpbb_config (
       
   149 	config_name varchar(255) NOT NULL DEFAULT '',
       
   150 	config_value varchar(255) NOT NULL DEFAULT '',
       
   151 	is_dynamic INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   152 	PRIMARY KEY (config_name)
       
   153 );
       
   154 
       
   155 CREATE INDEX phpbb_config_is_dynamic ON phpbb_config (is_dynamic);
       
   156 
       
   157 # Table: 'phpbb_confirm'
       
   158 CREATE TABLE phpbb_confirm (
       
   159 	confirm_id char(32) NOT NULL DEFAULT '',
       
   160 	session_id char(32) NOT NULL DEFAULT '',
       
   161 	confirm_type tinyint(3) NOT NULL DEFAULT '0',
       
   162 	code varchar(8) NOT NULL DEFAULT '',
       
   163 	seed INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   164 	attempts INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   165 	PRIMARY KEY (session_id, confirm_id)
       
   166 );
       
   167 
       
   168 CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm (confirm_type);
       
   169 
       
   170 # Table: 'phpbb_disallow'
       
   171 CREATE TABLE phpbb_disallow (
       
   172 	disallow_id INTEGER PRIMARY KEY NOT NULL ,
       
   173 	disallow_username varchar(255) NOT NULL DEFAULT ''
       
   174 );
       
   175 
       
   176 
       
   177 # Table: 'phpbb_drafts'
       
   178 CREATE TABLE phpbb_drafts (
       
   179 	draft_id INTEGER PRIMARY KEY NOT NULL ,
       
   180 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   181 	topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   182 	forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   183 	save_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   184 	draft_subject text(65535) NOT NULL DEFAULT '',
       
   185 	draft_message mediumtext(16777215) NOT NULL DEFAULT ''
       
   186 );
       
   187 
       
   188 CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts (save_time);
       
   189 
       
   190 # Table: 'phpbb_extensions'
       
   191 CREATE TABLE phpbb_extensions (
       
   192 	extension_id INTEGER PRIMARY KEY NOT NULL ,
       
   193 	group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   194 	extension varchar(100) NOT NULL DEFAULT ''
       
   195 );
       
   196 
       
   197 
       
   198 # Table: 'phpbb_extension_groups'
       
   199 CREATE TABLE phpbb_extension_groups (
       
   200 	group_id INTEGER PRIMARY KEY NOT NULL ,
       
   201 	group_name varchar(255) NOT NULL DEFAULT '',
       
   202 	cat_id tinyint(2) NOT NULL DEFAULT '0',
       
   203 	allow_group INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   204 	download_mode INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   205 	upload_icon varchar(255) NOT NULL DEFAULT '',
       
   206 	max_filesize INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   207 	allowed_forums text(65535) NOT NULL DEFAULT '',
       
   208 	allow_in_pm INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   209 );
       
   210 
       
   211 
       
   212 # Table: 'phpbb_forums'
       
   213 CREATE TABLE phpbb_forums (
       
   214 	forum_id INTEGER PRIMARY KEY NOT NULL ,
       
   215 	parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   216 	left_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   217 	right_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   218 	forum_parents mediumtext(16777215) NOT NULL DEFAULT '',
       
   219 	forum_name text(65535) NOT NULL DEFAULT '',
       
   220 	forum_desc text(65535) NOT NULL DEFAULT '',
       
   221 	forum_desc_bitfield varchar(255) NOT NULL DEFAULT '',
       
   222 	forum_desc_options INTEGER UNSIGNED NOT NULL DEFAULT '7',
       
   223 	forum_desc_uid varchar(8) NOT NULL DEFAULT '',
       
   224 	forum_link varchar(255) NOT NULL DEFAULT '',
       
   225 	forum_password varchar(40) NOT NULL DEFAULT '',
       
   226 	forum_style INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   227 	forum_image varchar(255) NOT NULL DEFAULT '',
       
   228 	forum_rules text(65535) NOT NULL DEFAULT '',
       
   229 	forum_rules_link varchar(255) NOT NULL DEFAULT '',
       
   230 	forum_rules_bitfield varchar(255) NOT NULL DEFAULT '',
       
   231 	forum_rules_options INTEGER UNSIGNED NOT NULL DEFAULT '7',
       
   232 	forum_rules_uid varchar(8) NOT NULL DEFAULT '',
       
   233 	forum_topics_per_page tinyint(4) NOT NULL DEFAULT '0',
       
   234 	forum_type tinyint(4) NOT NULL DEFAULT '0',
       
   235 	forum_status tinyint(4) NOT NULL DEFAULT '0',
       
   236 	forum_posts INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   237 	forum_topics INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   238 	forum_topics_real INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   239 	forum_last_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   240 	forum_last_poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   241 	forum_last_post_subject text(65535) NOT NULL DEFAULT '',
       
   242 	forum_last_post_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   243 	forum_last_poster_name varchar(255) NOT NULL DEFAULT '',
       
   244 	forum_last_poster_colour varchar(6) NOT NULL DEFAULT '',
       
   245 	forum_flags tinyint(4) NOT NULL DEFAULT '32',
       
   246 	forum_options INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   247 	display_subforum_list INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   248 	display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   249 	enable_indexing INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   250 	enable_icons INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   251 	enable_prune INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   252 	prune_next INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   253 	prune_days INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   254 	prune_viewed INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   255 	prune_freq INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   256 );
       
   257 
       
   258 CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums (left_id, right_id);
       
   259 CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums (forum_last_post_id);
       
   260 
       
   261 # Table: 'phpbb_forums_access'
       
   262 CREATE TABLE phpbb_forums_access (
       
   263 	forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   264 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   265 	session_id char(32) NOT NULL DEFAULT '',
       
   266 	PRIMARY KEY (forum_id, user_id, session_id)
       
   267 );
       
   268 
       
   269 
       
   270 # Table: 'phpbb_forums_track'
       
   271 CREATE TABLE phpbb_forums_track (
       
   272 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   273 	forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   274 	mark_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   275 	PRIMARY KEY (user_id, forum_id)
       
   276 );
       
   277 
       
   278 
       
   279 # Table: 'phpbb_forums_watch'
       
   280 CREATE TABLE phpbb_forums_watch (
       
   281 	forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   282 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   283 	notify_status INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   284 );
       
   285 
       
   286 CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch (forum_id);
       
   287 CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch (user_id);
       
   288 CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch (notify_status);
       
   289 
       
   290 # Table: 'phpbb_groups'
       
   291 CREATE TABLE phpbb_groups (
       
   292 	group_id INTEGER PRIMARY KEY NOT NULL ,
       
   293 	group_type tinyint(4) NOT NULL DEFAULT '1',
       
   294 	group_founder_manage INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   295 	group_skip_auth INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   296 	group_name varchar(255) NOT NULL DEFAULT '',
       
   297 	group_desc text(65535) NOT NULL DEFAULT '',
       
   298 	group_desc_bitfield varchar(255) NOT NULL DEFAULT '',
       
   299 	group_desc_options INTEGER UNSIGNED NOT NULL DEFAULT '7',
       
   300 	group_desc_uid varchar(8) NOT NULL DEFAULT '',
       
   301 	group_display INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   302 	group_avatar varchar(255) NOT NULL DEFAULT '',
       
   303 	group_avatar_type tinyint(2) NOT NULL DEFAULT '0',
       
   304 	group_avatar_width INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   305 	group_avatar_height INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   306 	group_rank INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   307 	group_colour varchar(6) NOT NULL DEFAULT '',
       
   308 	group_sig_chars INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   309 	group_receive_pm INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   310 	group_message_limit INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   311 	group_max_recipients INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   312 	group_legend INTEGER UNSIGNED NOT NULL DEFAULT '1'
       
   313 );
       
   314 
       
   315 CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name);
       
   316 
       
   317 # Table: 'phpbb_icons'
       
   318 CREATE TABLE phpbb_icons (
       
   319 	icons_id INTEGER PRIMARY KEY NOT NULL ,
       
   320 	icons_url varchar(255) NOT NULL DEFAULT '',
       
   321 	icons_width tinyint(4) NOT NULL DEFAULT '0',
       
   322 	icons_height tinyint(4) NOT NULL DEFAULT '0',
       
   323 	icons_order INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   324 	display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '1'
       
   325 );
       
   326 
       
   327 CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons (display_on_posting);
       
   328 
       
   329 # Table: 'phpbb_lang'
       
   330 CREATE TABLE phpbb_lang (
       
   331 	lang_id INTEGER PRIMARY KEY NOT NULL ,
       
   332 	lang_iso varchar(30) NOT NULL DEFAULT '',
       
   333 	lang_dir varchar(30) NOT NULL DEFAULT '',
       
   334 	lang_english_name varchar(100) NOT NULL DEFAULT '',
       
   335 	lang_local_name varchar(255) NOT NULL DEFAULT '',
       
   336 	lang_author varchar(255) NOT NULL DEFAULT ''
       
   337 );
       
   338 
       
   339 CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang (lang_iso);
       
   340 
       
   341 # Table: 'phpbb_log'
       
   342 CREATE TABLE phpbb_log (
       
   343 	log_id INTEGER PRIMARY KEY NOT NULL ,
       
   344 	log_type tinyint(4) NOT NULL DEFAULT '0',
       
   345 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   346 	forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   347 	topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   348 	reportee_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   349 	log_ip varchar(40) NOT NULL DEFAULT '',
       
   350 	log_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   351 	log_operation text(65535) NOT NULL DEFAULT '',
       
   352 	log_data mediumtext(16777215) NOT NULL DEFAULT ''
       
   353 );
       
   354 
       
   355 CREATE INDEX phpbb_log_log_type ON phpbb_log (log_type);
       
   356 CREATE INDEX phpbb_log_forum_id ON phpbb_log (forum_id);
       
   357 CREATE INDEX phpbb_log_topic_id ON phpbb_log (topic_id);
       
   358 CREATE INDEX phpbb_log_reportee_id ON phpbb_log (reportee_id);
       
   359 CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id);
       
   360 
       
   361 # Table: 'phpbb_login_attempts'
       
   362 CREATE TABLE phpbb_login_attempts (
       
   363 	attempt_ip varchar(40) NOT NULL DEFAULT '',
       
   364 	attempt_browser varchar(150) NOT NULL DEFAULT '',
       
   365 	attempt_forwarded_for varchar(255) NOT NULL DEFAULT '',
       
   366 	attempt_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   367 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   368 	username varchar(255) NOT NULL DEFAULT '0',
       
   369 	username_clean varchar(255) NOT NULL DEFAULT '0'
       
   370 );
       
   371 
       
   372 CREATE INDEX phpbb_login_attempts_att_ip ON phpbb_login_attempts (attempt_ip, attempt_time);
       
   373 CREATE INDEX phpbb_login_attempts_att_for ON phpbb_login_attempts (attempt_forwarded_for, attempt_time);
       
   374 CREATE INDEX phpbb_login_attempts_att_time ON phpbb_login_attempts (attempt_time);
       
   375 CREATE INDEX phpbb_login_attempts_user_id ON phpbb_login_attempts (user_id);
       
   376 
       
   377 # Table: 'phpbb_moderator_cache'
       
   378 CREATE TABLE phpbb_moderator_cache (
       
   379 	forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   380 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   381 	username varchar(255) NOT NULL DEFAULT '',
       
   382 	group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   383 	group_name varchar(255) NOT NULL DEFAULT '',
       
   384 	display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1'
       
   385 );
       
   386 
       
   387 CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache (display_on_index);
       
   388 CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache (forum_id);
       
   389 
       
   390 # Table: 'phpbb_modules'
       
   391 CREATE TABLE phpbb_modules (
       
   392 	module_id INTEGER PRIMARY KEY NOT NULL ,
       
   393 	module_enabled INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   394 	module_display INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   395 	module_basename varchar(255) NOT NULL DEFAULT '',
       
   396 	module_class varchar(10) NOT NULL DEFAULT '',
       
   397 	parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   398 	left_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   399 	right_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   400 	module_langname varchar(255) NOT NULL DEFAULT '',
       
   401 	module_mode varchar(255) NOT NULL DEFAULT '',
       
   402 	module_auth varchar(255) NOT NULL DEFAULT ''
       
   403 );
       
   404 
       
   405 CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules (left_id, right_id);
       
   406 CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules (module_enabled);
       
   407 CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id);
       
   408 
       
   409 # Table: 'phpbb_poll_options'
       
   410 CREATE TABLE phpbb_poll_options (
       
   411 	poll_option_id tinyint(4) NOT NULL DEFAULT '0',
       
   412 	topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   413 	poll_option_text text(65535) NOT NULL DEFAULT '',
       
   414 	poll_option_total INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   415 );
       
   416 
       
   417 CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options (poll_option_id);
       
   418 CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options (topic_id);
       
   419 
       
   420 # Table: 'phpbb_poll_votes'
       
   421 CREATE TABLE phpbb_poll_votes (
       
   422 	topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   423 	poll_option_id tinyint(4) NOT NULL DEFAULT '0',
       
   424 	vote_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   425 	vote_user_ip varchar(40) NOT NULL DEFAULT ''
       
   426 );
       
   427 
       
   428 CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes (topic_id);
       
   429 CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes (vote_user_id);
       
   430 CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes (vote_user_ip);
       
   431 
       
   432 # Table: 'phpbb_posts'
       
   433 CREATE TABLE phpbb_posts (
       
   434 	post_id INTEGER PRIMARY KEY NOT NULL ,
       
   435 	topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   436 	forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   437 	poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   438 	icon_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   439 	poster_ip varchar(40) NOT NULL DEFAULT '',
       
   440 	post_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   441 	post_approved INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   442 	post_reported INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   443 	enable_bbcode INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   444 	enable_smilies INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   445 	enable_magic_url INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   446 	enable_sig INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   447 	post_username varchar(255) NOT NULL DEFAULT '',
       
   448 	post_subject text(65535) NOT NULL DEFAULT '',
       
   449 	post_text mediumtext(16777215) NOT NULL DEFAULT '',
       
   450 	post_checksum varchar(32) NOT NULL DEFAULT '',
       
   451 	post_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   452 	bbcode_bitfield varchar(255) NOT NULL DEFAULT '',
       
   453 	bbcode_uid varchar(8) NOT NULL DEFAULT '',
       
   454 	post_postcount INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   455 	post_edit_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   456 	post_edit_reason text(65535) NOT NULL DEFAULT '',
       
   457 	post_edit_user INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   458 	post_edit_count INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   459 	post_edit_locked INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   460 );
       
   461 
       
   462 CREATE INDEX phpbb_posts_forum_id ON phpbb_posts (forum_id);
       
   463 CREATE INDEX phpbb_posts_topic_id ON phpbb_posts (topic_id);
       
   464 CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip);
       
   465 CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id);
       
   466 CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved);
       
   467 CREATE INDEX phpbb_posts_post_username ON phpbb_posts (post_username);
       
   468 CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time);
       
   469 
       
   470 # Table: 'phpbb_privmsgs'
       
   471 CREATE TABLE phpbb_privmsgs (
       
   472 	msg_id INTEGER PRIMARY KEY NOT NULL ,
       
   473 	root_level INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   474 	author_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   475 	icon_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   476 	author_ip varchar(40) NOT NULL DEFAULT '',
       
   477 	message_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   478 	enable_bbcode INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   479 	enable_smilies INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   480 	enable_magic_url INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   481 	enable_sig INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   482 	message_subject text(65535) NOT NULL DEFAULT '',
       
   483 	message_text mediumtext(16777215) NOT NULL DEFAULT '',
       
   484 	message_edit_reason text(65535) NOT NULL DEFAULT '',
       
   485 	message_edit_user INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   486 	message_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   487 	bbcode_bitfield varchar(255) NOT NULL DEFAULT '',
       
   488 	bbcode_uid varchar(8) NOT NULL DEFAULT '',
       
   489 	message_edit_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   490 	message_edit_count INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   491 	to_address text(65535) NOT NULL DEFAULT '',
       
   492 	bcc_address text(65535) NOT NULL DEFAULT '',
       
   493 	message_reported INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   494 );
       
   495 
       
   496 CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs (author_ip);
       
   497 CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs (message_time);
       
   498 CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs (author_id);
       
   499 CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs (root_level);
       
   500 
       
   501 # Table: 'phpbb_privmsgs_folder'
       
   502 CREATE TABLE phpbb_privmsgs_folder (
       
   503 	folder_id INTEGER PRIMARY KEY NOT NULL ,
       
   504 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   505 	folder_name varchar(255) NOT NULL DEFAULT '',
       
   506 	pm_count INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   507 );
       
   508 
       
   509 CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder (user_id);
       
   510 
       
   511 # Table: 'phpbb_privmsgs_rules'
       
   512 CREATE TABLE phpbb_privmsgs_rules (
       
   513 	rule_id INTEGER PRIMARY KEY NOT NULL ,
       
   514 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   515 	rule_check INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   516 	rule_connection INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   517 	rule_string varchar(255) NOT NULL DEFAULT '',
       
   518 	rule_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   519 	rule_group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   520 	rule_action INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   521 	rule_folder_id int(11) NOT NULL DEFAULT '0'
       
   522 );
       
   523 
       
   524 CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules (user_id);
       
   525 
       
   526 # Table: 'phpbb_privmsgs_to'
       
   527 CREATE TABLE phpbb_privmsgs_to (
       
   528 	msg_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   529 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   530 	author_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   531 	pm_deleted INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   532 	pm_new INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   533 	pm_unread INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   534 	pm_replied INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   535 	pm_marked INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   536 	pm_forwarded INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   537 	folder_id int(11) NOT NULL DEFAULT '0'
       
   538 );
       
   539 
       
   540 CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id);
       
   541 CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to (author_id);
       
   542 CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folder_id);
       
   543 
       
   544 # Table: 'phpbb_profile_fields'
       
   545 CREATE TABLE phpbb_profile_fields (
       
   546 	field_id INTEGER PRIMARY KEY NOT NULL ,
       
   547 	field_name varchar(255) NOT NULL DEFAULT '',
       
   548 	field_type tinyint(4) NOT NULL DEFAULT '0',
       
   549 	field_ident varchar(20) NOT NULL DEFAULT '',
       
   550 	field_length varchar(20) NOT NULL DEFAULT '',
       
   551 	field_minlen varchar(255) NOT NULL DEFAULT '',
       
   552 	field_maxlen varchar(255) NOT NULL DEFAULT '',
       
   553 	field_novalue varchar(255) NOT NULL DEFAULT '',
       
   554 	field_default_value varchar(255) NOT NULL DEFAULT '',
       
   555 	field_validation varchar(20) NOT NULL DEFAULT '',
       
   556 	field_required INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   557 	field_show_on_reg INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   558 	field_show_on_vt INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   559 	field_show_profile INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   560 	field_hide INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   561 	field_no_view INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   562 	field_active INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   563 	field_order INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   564 );
       
   565 
       
   566 CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields (field_type);
       
   567 CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields (field_order);
       
   568 
       
   569 # Table: 'phpbb_profile_fields_data'
       
   570 CREATE TABLE phpbb_profile_fields_data (
       
   571 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   572 	PRIMARY KEY (user_id)
       
   573 );
       
   574 
       
   575 
       
   576 # Table: 'phpbb_profile_fields_lang'
       
   577 CREATE TABLE phpbb_profile_fields_lang (
       
   578 	field_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   579 	lang_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   580 	option_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   581 	field_type tinyint(4) NOT NULL DEFAULT '0',
       
   582 	lang_value varchar(255) NOT NULL DEFAULT '',
       
   583 	PRIMARY KEY (field_id, lang_id, option_id)
       
   584 );
       
   585 
       
   586 
       
   587 # Table: 'phpbb_profile_lang'
       
   588 CREATE TABLE phpbb_profile_lang (
       
   589 	field_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   590 	lang_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   591 	lang_name varchar(255) NOT NULL DEFAULT '',
       
   592 	lang_explain text(65535) NOT NULL DEFAULT '',
       
   593 	lang_default_value varchar(255) NOT NULL DEFAULT '',
       
   594 	PRIMARY KEY (field_id, lang_id)
       
   595 );
       
   596 
       
   597 
       
   598 # Table: 'phpbb_ranks'
       
   599 CREATE TABLE phpbb_ranks (
       
   600 	rank_id INTEGER PRIMARY KEY NOT NULL ,
       
   601 	rank_title varchar(255) NOT NULL DEFAULT '',
       
   602 	rank_min INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   603 	rank_special INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   604 	rank_image varchar(255) NOT NULL DEFAULT ''
       
   605 );
       
   606 
       
   607 
       
   608 # Table: 'phpbb_reports'
       
   609 CREATE TABLE phpbb_reports (
       
   610 	report_id INTEGER PRIMARY KEY NOT NULL ,
       
   611 	reason_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   612 	post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   613 	pm_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   614 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   615 	user_notify INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   616 	report_closed INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   617 	report_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   618 	report_text mediumtext(16777215) NOT NULL DEFAULT ''
       
   619 );
       
   620 
       
   621 CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id);
       
   622 CREATE INDEX phpbb_reports_pm_id ON phpbb_reports (pm_id);
       
   623 
       
   624 # Table: 'phpbb_reports_reasons'
       
   625 CREATE TABLE phpbb_reports_reasons (
       
   626 	reason_id INTEGER PRIMARY KEY NOT NULL ,
       
   627 	reason_title varchar(255) NOT NULL DEFAULT '',
       
   628 	reason_description mediumtext(16777215) NOT NULL DEFAULT '',
       
   629 	reason_order INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   630 );
       
   631 
       
   632 
       
   633 # Table: 'phpbb_search_results'
       
   634 CREATE TABLE phpbb_search_results (
       
   635 	search_key varchar(32) NOT NULL DEFAULT '',
       
   636 	search_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   637 	search_keywords mediumtext(16777215) NOT NULL DEFAULT '',
       
   638 	search_authors mediumtext(16777215) NOT NULL DEFAULT '',
       
   639 	PRIMARY KEY (search_key)
       
   640 );
       
   641 
       
   642 
       
   643 # Table: 'phpbb_search_wordlist'
       
   644 CREATE TABLE phpbb_search_wordlist (
       
   645 	word_id INTEGER PRIMARY KEY NOT NULL ,
       
   646 	word_text varchar(255) NOT NULL DEFAULT '',
       
   647 	word_common INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   648 	word_count INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   649 );
       
   650 
       
   651 CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist (word_text);
       
   652 CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist (word_count);
       
   653 
       
   654 # Table: 'phpbb_search_wordmatch'
       
   655 CREATE TABLE phpbb_search_wordmatch (
       
   656 	post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   657 	word_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   658 	title_match INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   659 );
       
   660 
       
   661 CREATE UNIQUE INDEX phpbb_search_wordmatch_unq_mtch ON phpbb_search_wordmatch (word_id, post_id, title_match);
       
   662 CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch (word_id);
       
   663 CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id);
       
   664 
       
   665 # Table: 'phpbb_sessions'
       
   666 CREATE TABLE phpbb_sessions (
       
   667 	session_id char(32) NOT NULL DEFAULT '',
       
   668 	session_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   669 	session_forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   670 	session_last_visit INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   671 	session_start INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   672 	session_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   673 	session_ip varchar(40) NOT NULL DEFAULT '',
       
   674 	session_browser varchar(150) NOT NULL DEFAULT '',
       
   675 	session_forwarded_for varchar(255) NOT NULL DEFAULT '',
       
   676 	session_page varchar(255) NOT NULL DEFAULT '',
       
   677 	session_viewonline INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   678 	session_autologin INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   679 	session_admin INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   680 	PRIMARY KEY (session_id)
       
   681 );
       
   682 
       
   683 CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions (session_time);
       
   684 CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions (session_user_id);
       
   685 CREATE INDEX phpbb_sessions_session_fid ON phpbb_sessions (session_forum_id);
       
   686 
       
   687 # Table: 'phpbb_sessions_keys'
       
   688 CREATE TABLE phpbb_sessions_keys (
       
   689 	key_id char(32) NOT NULL DEFAULT '',
       
   690 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   691 	last_ip varchar(40) NOT NULL DEFAULT '',
       
   692 	last_login INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   693 	PRIMARY KEY (key_id, user_id)
       
   694 );
       
   695 
       
   696 CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys (last_login);
       
   697 
       
   698 # Table: 'phpbb_sitelist'
       
   699 CREATE TABLE phpbb_sitelist (
       
   700 	site_id INTEGER PRIMARY KEY NOT NULL ,
       
   701 	site_ip varchar(40) NOT NULL DEFAULT '',
       
   702 	site_hostname varchar(255) NOT NULL DEFAULT '',
       
   703 	ip_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   704 );
       
   705 
       
   706 
       
   707 # Table: 'phpbb_smilies'
       
   708 CREATE TABLE phpbb_smilies (
       
   709 	smiley_id INTEGER PRIMARY KEY NOT NULL ,
       
   710 	code varchar(50) NOT NULL DEFAULT '',
       
   711 	emotion varchar(50) NOT NULL DEFAULT '',
       
   712 	smiley_url varchar(50) NOT NULL DEFAULT '',
       
   713 	smiley_width INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   714 	smiley_height INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   715 	smiley_order INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   716 	display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '1'
       
   717 );
       
   718 
       
   719 CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting);
       
   720 
       
   721 # Table: 'phpbb_styles'
       
   722 CREATE TABLE phpbb_styles (
       
   723 	style_id INTEGER PRIMARY KEY NOT NULL ,
       
   724 	style_name varchar(255) NOT NULL DEFAULT '',
       
   725 	style_copyright varchar(255) NOT NULL DEFAULT '',
       
   726 	style_active INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   727 	template_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   728 	theme_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   729 	imageset_id INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   730 );
       
   731 
       
   732 CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name);
       
   733 CREATE INDEX phpbb_styles_template_id ON phpbb_styles (template_id);
       
   734 CREATE INDEX phpbb_styles_theme_id ON phpbb_styles (theme_id);
       
   735 CREATE INDEX phpbb_styles_imageset_id ON phpbb_styles (imageset_id);
       
   736 
       
   737 # Table: 'phpbb_styles_template'
       
   738 CREATE TABLE phpbb_styles_template (
       
   739 	template_id INTEGER PRIMARY KEY NOT NULL ,
       
   740 	template_name varchar(255) NOT NULL DEFAULT '',
       
   741 	template_copyright varchar(255) NOT NULL DEFAULT '',
       
   742 	template_path varchar(100) NOT NULL DEFAULT '',
       
   743 	bbcode_bitfield varchar(255) NOT NULL DEFAULT 'kNg=',
       
   744 	template_storedb INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   745 	template_inherits_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   746 	template_inherit_path varchar(255) NOT NULL DEFAULT ''
       
   747 );
       
   748 
       
   749 CREATE UNIQUE INDEX phpbb_styles_template_tmplte_nm ON phpbb_styles_template (template_name);
       
   750 
       
   751 # Table: 'phpbb_styles_template_data'
       
   752 CREATE TABLE phpbb_styles_template_data (
       
   753 	template_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   754 	template_filename varchar(100) NOT NULL DEFAULT '',
       
   755 	template_included text(65535) NOT NULL DEFAULT '',
       
   756 	template_mtime INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   757 	template_data mediumtext(16777215) NOT NULL DEFAULT ''
       
   758 );
       
   759 
       
   760 CREATE INDEX phpbb_styles_template_data_tid ON phpbb_styles_template_data (template_id);
       
   761 CREATE INDEX phpbb_styles_template_data_tfn ON phpbb_styles_template_data (template_filename);
       
   762 
       
   763 # Table: 'phpbb_styles_theme'
       
   764 CREATE TABLE phpbb_styles_theme (
       
   765 	theme_id INTEGER PRIMARY KEY NOT NULL ,
       
   766 	theme_name varchar(255) NOT NULL DEFAULT '',
       
   767 	theme_copyright varchar(255) NOT NULL DEFAULT '',
       
   768 	theme_path varchar(100) NOT NULL DEFAULT '',
       
   769 	theme_storedb INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   770 	theme_mtime INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   771 	theme_data mediumtext(16777215) NOT NULL DEFAULT ''
       
   772 );
       
   773 
       
   774 CREATE UNIQUE INDEX phpbb_styles_theme_theme_name ON phpbb_styles_theme (theme_name);
       
   775 
       
   776 # Table: 'phpbb_styles_imageset'
       
   777 CREATE TABLE phpbb_styles_imageset (
       
   778 	imageset_id INTEGER PRIMARY KEY NOT NULL ,
       
   779 	imageset_name varchar(255) NOT NULL DEFAULT '',
       
   780 	imageset_copyright varchar(255) NOT NULL DEFAULT '',
       
   781 	imageset_path varchar(100) NOT NULL DEFAULT ''
       
   782 );
       
   783 
       
   784 CREATE UNIQUE INDEX phpbb_styles_imageset_imgset_nm ON phpbb_styles_imageset (imageset_name);
       
   785 
       
   786 # Table: 'phpbb_styles_imageset_data'
       
   787 CREATE TABLE phpbb_styles_imageset_data (
       
   788 	image_id INTEGER PRIMARY KEY NOT NULL ,
       
   789 	image_name varchar(200) NOT NULL DEFAULT '',
       
   790 	image_filename varchar(200) NOT NULL DEFAULT '',
       
   791 	image_lang varchar(30) NOT NULL DEFAULT '',
       
   792 	image_height INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   793 	image_width INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   794 	imageset_id INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   795 );
       
   796 
       
   797 CREATE INDEX phpbb_styles_imageset_data_i_d ON phpbb_styles_imageset_data (imageset_id);
       
   798 
       
   799 # Table: 'phpbb_topics'
       
   800 CREATE TABLE phpbb_topics (
       
   801 	topic_id INTEGER PRIMARY KEY NOT NULL ,
       
   802 	forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   803 	icon_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   804 	topic_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   805 	topic_approved INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   806 	topic_reported INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   807 	topic_title text(65535) NOT NULL DEFAULT '',
       
   808 	topic_poster INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   809 	topic_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   810 	topic_time_limit INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   811 	topic_views INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   812 	topic_replies INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   813 	topic_replies_real INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   814 	topic_status tinyint(3) NOT NULL DEFAULT '0',
       
   815 	topic_type tinyint(3) NOT NULL DEFAULT '0',
       
   816 	topic_first_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   817 	topic_first_poster_name varchar(255) NOT NULL DEFAULT '',
       
   818 	topic_first_poster_colour varchar(6) NOT NULL DEFAULT '',
       
   819 	topic_last_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   820 	topic_last_poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   821 	topic_last_poster_name varchar(255) NOT NULL DEFAULT '',
       
   822 	topic_last_poster_colour varchar(6) NOT NULL DEFAULT '',
       
   823 	topic_last_post_subject text(65535) NOT NULL DEFAULT '',
       
   824 	topic_last_post_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   825 	topic_last_view_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   826 	topic_moved_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   827 	topic_bumped INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   828 	topic_bumper INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   829 	poll_title text(65535) NOT NULL DEFAULT '',
       
   830 	poll_start INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   831 	poll_length INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   832 	poll_max_options tinyint(4) NOT NULL DEFAULT '1',
       
   833 	poll_last_vote INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   834 	poll_vote_change INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   835 );
       
   836 
       
   837 CREATE INDEX phpbb_topics_forum_id ON phpbb_topics (forum_id);
       
   838 CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics (forum_id, topic_type);
       
   839 CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics (topic_last_post_time);
       
   840 CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics (topic_approved);
       
   841 CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics (forum_id, topic_approved, topic_last_post_id);
       
   842 CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id);
       
   843 
       
   844 # Table: 'phpbb_topics_track'
       
   845 CREATE TABLE phpbb_topics_track (
       
   846 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   847 	topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   848 	forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   849 	mark_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   850 	PRIMARY KEY (user_id, topic_id)
       
   851 );
       
   852 
       
   853 CREATE INDEX phpbb_topics_track_topic_id ON phpbb_topics_track (topic_id);
       
   854 CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track (forum_id);
       
   855 
       
   856 # Table: 'phpbb_topics_posted'
       
   857 CREATE TABLE phpbb_topics_posted (
       
   858 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   859 	topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   860 	topic_posted INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   861 	PRIMARY KEY (user_id, topic_id)
       
   862 );
       
   863 
       
   864 
       
   865 # Table: 'phpbb_topics_watch'
       
   866 CREATE TABLE phpbb_topics_watch (
       
   867 	topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   868 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   869 	notify_status INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   870 );
       
   871 
       
   872 CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch (topic_id);
       
   873 CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch (user_id);
       
   874 CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch (notify_status);
       
   875 
       
   876 # Table: 'phpbb_user_group'
       
   877 CREATE TABLE phpbb_user_group (
       
   878 	group_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   879 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   880 	group_leader INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   881 	user_pending INTEGER UNSIGNED NOT NULL DEFAULT '1'
       
   882 );
       
   883 
       
   884 CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group (group_id);
       
   885 CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group (user_id);
       
   886 CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group (group_leader);
       
   887 
       
   888 # Table: 'phpbb_users'
       
   889 CREATE TABLE phpbb_users (
       
   890 	user_id INTEGER PRIMARY KEY NOT NULL ,
       
   891 	user_type tinyint(2) NOT NULL DEFAULT '0',
       
   892 	group_id INTEGER UNSIGNED NOT NULL DEFAULT '3',
       
   893 	user_permissions mediumtext(16777215) NOT NULL DEFAULT '',
       
   894 	user_perm_from INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   895 	user_ip varchar(40) NOT NULL DEFAULT '',
       
   896 	user_regdate INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   897 	username varchar(255) NOT NULL DEFAULT '',
       
   898 	username_clean varchar(255) NOT NULL DEFAULT '',
       
   899 	user_password varchar(40) NOT NULL DEFAULT '',
       
   900 	user_passchg INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   901 	user_pass_convert INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   902 	user_email varchar(100) NOT NULL DEFAULT '',
       
   903 	user_email_hash bigint(20) NOT NULL DEFAULT '0',
       
   904 	user_birthday varchar(10) NOT NULL DEFAULT '',
       
   905 	user_lastvisit INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   906 	user_lastmark INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   907 	user_lastpost_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   908 	user_lastpage varchar(200) NOT NULL DEFAULT '',
       
   909 	user_last_confirm_key varchar(10) NOT NULL DEFAULT '',
       
   910 	user_last_search INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   911 	user_warnings tinyint(4) NOT NULL DEFAULT '0',
       
   912 	user_last_warning INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   913 	user_login_attempts tinyint(4) NOT NULL DEFAULT '0',
       
   914 	user_inactive_reason tinyint(2) NOT NULL DEFAULT '0',
       
   915 	user_inactive_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   916 	user_posts INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   917 	user_lang varchar(30) NOT NULL DEFAULT '',
       
   918 	user_timezone decimal(5,2) NOT NULL DEFAULT '0',
       
   919 	user_dst INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   920 	user_dateformat varchar(30) NOT NULL DEFAULT 'd M Y H:i',
       
   921 	user_style INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   922 	user_rank INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   923 	user_colour varchar(6) NOT NULL DEFAULT '',
       
   924 	user_new_privmsg int(4) NOT NULL DEFAULT '0',
       
   925 	user_unread_privmsg int(4) NOT NULL DEFAULT '0',
       
   926 	user_last_privmsg INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   927 	user_message_rules INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   928 	user_full_folder int(11) NOT NULL DEFAULT '-3',
       
   929 	user_emailtime INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   930 	user_topic_show_days INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   931 	user_topic_sortby_type varchar(1) NOT NULL DEFAULT 't',
       
   932 	user_topic_sortby_dir varchar(1) NOT NULL DEFAULT 'd',
       
   933 	user_post_show_days INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   934 	user_post_sortby_type varchar(1) NOT NULL DEFAULT 't',
       
   935 	user_post_sortby_dir varchar(1) NOT NULL DEFAULT 'a',
       
   936 	user_notify INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   937 	user_notify_pm INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   938 	user_notify_type tinyint(4) NOT NULL DEFAULT '0',
       
   939 	user_allow_pm INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   940 	user_allow_viewonline INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   941 	user_allow_viewemail INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   942 	user_allow_massemail INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   943 	user_options INTEGER UNSIGNED NOT NULL DEFAULT '230271',
       
   944 	user_avatar varchar(255) NOT NULL DEFAULT '',
       
   945 	user_avatar_type tinyint(2) NOT NULL DEFAULT '0',
       
   946 	user_avatar_width INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   947 	user_avatar_height INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   948 	user_sig mediumtext(16777215) NOT NULL DEFAULT '',
       
   949 	user_sig_bbcode_uid varchar(8) NOT NULL DEFAULT '',
       
   950 	user_sig_bbcode_bitfield varchar(255) NOT NULL DEFAULT '',
       
   951 	user_from varchar(100) NOT NULL DEFAULT '',
       
   952 	user_icq varchar(15) NOT NULL DEFAULT '',
       
   953 	user_aim varchar(255) NOT NULL DEFAULT '',
       
   954 	user_yim varchar(255) NOT NULL DEFAULT '',
       
   955 	user_msnm varchar(255) NOT NULL DEFAULT '',
       
   956 	user_jabber varchar(255) NOT NULL DEFAULT '',
       
   957 	user_website varchar(200) NOT NULL DEFAULT '',
       
   958 	user_occ text(65535) NOT NULL DEFAULT '',
       
   959 	user_interests text(65535) NOT NULL DEFAULT '',
       
   960 	user_actkey varchar(32) NOT NULL DEFAULT '',
       
   961 	user_newpasswd varchar(40) NOT NULL DEFAULT '',
       
   962 	user_form_salt varchar(32) NOT NULL DEFAULT '',
       
   963 	user_new INTEGER UNSIGNED NOT NULL DEFAULT '1',
       
   964 	user_reminded tinyint(4) NOT NULL DEFAULT '0',
       
   965 	user_reminded_time INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   966 );
       
   967 
       
   968 CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday);
       
   969 CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash);
       
   970 CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type);
       
   971 CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users (username_clean);
       
   972 
       
   973 # Table: 'phpbb_warnings'
       
   974 CREATE TABLE phpbb_warnings (
       
   975 	warning_id INTEGER PRIMARY KEY NOT NULL ,
       
   976 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   977 	post_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   978 	log_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   979 	warning_time INTEGER UNSIGNED NOT NULL DEFAULT '0'
       
   980 );
       
   981 
       
   982 
       
   983 # Table: 'phpbb_words'
       
   984 CREATE TABLE phpbb_words (
       
   985 	word_id INTEGER PRIMARY KEY NOT NULL ,
       
   986 	word varchar(255) NOT NULL DEFAULT '',
       
   987 	replacement varchar(255) NOT NULL DEFAULT ''
       
   988 );
       
   989 
       
   990 
       
   991 # Table: 'phpbb_zebra'
       
   992 CREATE TABLE phpbb_zebra (
       
   993 	user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   994 	zebra_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   995 	friend INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   996 	foe INTEGER UNSIGNED NOT NULL DEFAULT '0',
       
   997 	PRIMARY KEY (user_id, zebra_id)
       
   998 );
       
   999 
       
  1000 
       
  1001 
       
  1002 COMMIT;