Blame Identity/Webenv/phpBB/3.0.4/install/schemas/firebird_schema.sql

ef5584
#
ef5584
# $Id: firebird_schema.sql 9127 2008-11-26 19:58:35Z acydburn $
ef5584
#
ef5584
ef5584
ef5584
# Table: 'phpbb_attachments'
ef5584
CREATE TABLE phpbb_attachments (
ef5584
	attach_id INTEGER NOT NULL,
ef5584
	post_msg_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	in_message INTEGER DEFAULT 0 NOT NULL,
ef5584
	poster_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	is_orphan INTEGER DEFAULT 1 NOT NULL,
ef5584
	physical_filename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	real_filename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	download_count INTEGER DEFAULT 0 NOT NULL,
ef5584
	attach_comment BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	extension VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	mimetype VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	filesize INTEGER DEFAULT 0 NOT NULL,
ef5584
	filetime INTEGER DEFAULT 0 NOT NULL,
ef5584
	thumbnail INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_attachments ADD PRIMARY KEY (attach_id);;
ef5584
ef5584
CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments(filetime);;
ef5584
CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments(post_msg_id);;
ef5584
CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments(topic_id);;
ef5584
CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments(poster_id);;
ef5584
CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments(is_orphan);;
ef5584
ef5584
CREATE GENERATOR phpbb_attachments_gen;;
ef5584
SET GENERATOR phpbb_attachments_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_attachments FOR phpbb_attachments
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.attach_id = GEN_ID(phpbb_attachments_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_acl_groups'
ef5584
CREATE TABLE phpbb_acl_groups (
ef5584
	group_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	auth_option_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	auth_role_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	auth_setting INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
CREATE INDEX phpbb_acl_groups_group_id ON phpbb_acl_groups(group_id);;
ef5584
CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups(auth_option_id);;
ef5584
CREATE INDEX phpbb_acl_groups_auth_role_id ON phpbb_acl_groups(auth_role_id);;
ef5584
ef5584
# Table: 'phpbb_acl_options'
ef5584
CREATE TABLE phpbb_acl_options (
ef5584
	auth_option_id INTEGER NOT NULL,
ef5584
	auth_option VARCHAR(50) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	is_global INTEGER DEFAULT 0 NOT NULL,
ef5584
	is_local INTEGER DEFAULT 0 NOT NULL,
ef5584
	founder_only INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_acl_options ADD PRIMARY KEY (auth_option_id);;
ef5584
ef5584
CREATE INDEX phpbb_acl_options_auth_option ON phpbb_acl_options(auth_option);;
ef5584
ef5584
CREATE GENERATOR phpbb_acl_options_gen;;
ef5584
SET GENERATOR phpbb_acl_options_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_acl_options FOR phpbb_acl_options
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.auth_option_id = GEN_ID(phpbb_acl_options_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_acl_roles'
ef5584
CREATE TABLE phpbb_acl_roles (
ef5584
	role_id INTEGER NOT NULL,
ef5584
	role_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	role_description BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	role_type VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	role_order INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_acl_roles ADD PRIMARY KEY (role_id);;
ef5584
ef5584
CREATE INDEX phpbb_acl_roles_role_type ON phpbb_acl_roles(role_type);;
ef5584
CREATE INDEX phpbb_acl_roles_role_order ON phpbb_acl_roles(role_order);;
ef5584
ef5584
CREATE GENERATOR phpbb_acl_roles_gen;;
ef5584
SET GENERATOR phpbb_acl_roles_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_acl_roles FOR phpbb_acl_roles
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.role_id = GEN_ID(phpbb_acl_roles_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_acl_roles_data'
ef5584
CREATE TABLE phpbb_acl_roles_data (
ef5584
	role_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	auth_option_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	auth_setting INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_acl_roles_data ADD PRIMARY KEY (role_id, auth_option_id);;
ef5584
ef5584
CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data(auth_option_id);;
ef5584
ef5584
# Table: 'phpbb_acl_users'
ef5584
CREATE TABLE phpbb_acl_users (
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	auth_option_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	auth_role_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	auth_setting INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
CREATE INDEX phpbb_acl_users_user_id ON phpbb_acl_users(user_id);;
ef5584
CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users(auth_option_id);;
ef5584
CREATE INDEX phpbb_acl_users_auth_role_id ON phpbb_acl_users(auth_role_id);;
ef5584
ef5584
# Table: 'phpbb_banlist'
ef5584
CREATE TABLE phpbb_banlist (
ef5584
	ban_id INTEGER NOT NULL,
ef5584
	ban_userid INTEGER DEFAULT 0 NOT NULL,
ef5584
	ban_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	ban_email VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	ban_start INTEGER DEFAULT 0 NOT NULL,
ef5584
	ban_end INTEGER DEFAULT 0 NOT NULL,
ef5584
	ban_exclude INTEGER DEFAULT 0 NOT NULL,
ef5584
	ban_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	ban_give_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_banlist ADD PRIMARY KEY (ban_id);;
ef5584
ef5584
CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist(ban_end);;
ef5584
CREATE INDEX phpbb_banlist_ban_user ON phpbb_banlist(ban_userid, ban_exclude);;
ef5584
CREATE INDEX phpbb_banlist_ban_email ON phpbb_banlist(ban_email, ban_exclude);;
ef5584
CREATE INDEX phpbb_banlist_ban_ip ON phpbb_banlist(ban_ip, ban_exclude);;
ef5584
ef5584
CREATE GENERATOR phpbb_banlist_gen;;
ef5584
SET GENERATOR phpbb_banlist_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_banlist FOR phpbb_banlist
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.ban_id = GEN_ID(phpbb_banlist_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_bbcodes'
ef5584
CREATE TABLE phpbb_bbcodes (
ef5584
	bbcode_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	bbcode_tag VARCHAR(16) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	bbcode_helpline VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	display_on_posting INTEGER DEFAULT 0 NOT NULL,
ef5584
	bbcode_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	bbcode_tpl BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	first_pass_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	first_pass_replace BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	second_pass_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	second_pass_replace BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_bbcodes ADD PRIMARY KEY (bbcode_id);;
ef5584
ef5584
CREATE INDEX phpbb_bbcodes_display_on_post ON phpbb_bbcodes(display_on_posting);;
ef5584
ef5584
# Table: 'phpbb_bookmarks'
ef5584
CREATE TABLE phpbb_bookmarks (
ef5584
	topic_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_bookmarks ADD PRIMARY KEY (topic_id, user_id);;
ef5584
ef5584
ef5584
# Table: 'phpbb_bots'
ef5584
CREATE TABLE phpbb_bots (
ef5584
	bot_id INTEGER NOT NULL,
ef5584
	bot_active INTEGER DEFAULT 1 NOT NULL,
ef5584
	bot_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	bot_agent VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	bot_ip VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_bots ADD PRIMARY KEY (bot_id);;
ef5584
ef5584
CREATE INDEX phpbb_bots_bot_active ON phpbb_bots(bot_active);;
ef5584
ef5584
CREATE GENERATOR phpbb_bots_gen;;
ef5584
SET GENERATOR phpbb_bots_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_bots FOR phpbb_bots
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.bot_id = GEN_ID(phpbb_bots_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_config'
ef5584
CREATE TABLE phpbb_config (
ef5584
	config_name VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	config_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	is_dynamic INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_config ADD PRIMARY KEY (config_name);;
ef5584
ef5584
CREATE INDEX phpbb_config_is_dynamic ON phpbb_config(is_dynamic);;
ef5584
ef5584
# Table: 'phpbb_confirm'
ef5584
CREATE TABLE phpbb_confirm (
ef5584
	confirm_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	confirm_type INTEGER DEFAULT 0 NOT NULL,
ef5584
	code VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	seed INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_confirm ADD PRIMARY KEY (session_id, confirm_id);;
ef5584
ef5584
CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm(confirm_type);;
ef5584
ef5584
# Table: 'phpbb_disallow'
ef5584
CREATE TABLE phpbb_disallow (
ef5584
	disallow_id INTEGER NOT NULL,
ef5584
	disallow_username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_disallow ADD PRIMARY KEY (disallow_id);;
ef5584
ef5584
ef5584
CREATE GENERATOR phpbb_disallow_gen;;
ef5584
SET GENERATOR phpbb_disallow_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_disallow FOR phpbb_disallow
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.disallow_id = GEN_ID(phpbb_disallow_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_drafts'
ef5584
CREATE TABLE phpbb_drafts (
ef5584
	draft_id INTEGER NOT NULL,
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	save_time INTEGER DEFAULT 0 NOT NULL,
ef5584
	draft_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	draft_message BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_drafts ADD PRIMARY KEY (draft_id);;
ef5584
ef5584
CREATE INDEX phpbb_drafts_save_time ON phpbb_drafts(save_time);;
ef5584
ef5584
CREATE GENERATOR phpbb_drafts_gen;;
ef5584
SET GENERATOR phpbb_drafts_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_drafts FOR phpbb_drafts
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.draft_id = GEN_ID(phpbb_drafts_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_extensions'
ef5584
CREATE TABLE phpbb_extensions (
ef5584
	extension_id INTEGER NOT NULL,
ef5584
	group_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	extension VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_extensions ADD PRIMARY KEY (extension_id);;
ef5584
ef5584
ef5584
CREATE GENERATOR phpbb_extensions_gen;;
ef5584
SET GENERATOR phpbb_extensions_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_extensions FOR phpbb_extensions
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.extension_id = GEN_ID(phpbb_extensions_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_extension_groups'
ef5584
CREATE TABLE phpbb_extension_groups (
ef5584
	group_id INTEGER NOT NULL,
ef5584
	group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	cat_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	allow_group INTEGER DEFAULT 0 NOT NULL,
ef5584
	download_mode INTEGER DEFAULT 1 NOT NULL,
ef5584
	upload_icon VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	max_filesize INTEGER DEFAULT 0 NOT NULL,
ef5584
	allowed_forums BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	allow_in_pm INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_extension_groups ADD PRIMARY KEY (group_id);;
ef5584
ef5584
ef5584
CREATE GENERATOR phpbb_extension_groups_gen;;
ef5584
SET GENERATOR phpbb_extension_groups_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_extension_groups FOR phpbb_extension_groups
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.group_id = GEN_ID(phpbb_extension_groups_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_forums'
ef5584
CREATE TABLE phpbb_forums (
ef5584
	forum_id INTEGER NOT NULL,
ef5584
	parent_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	left_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	right_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_parents BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	forum_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	forum_desc BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	forum_desc_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	forum_desc_options INTEGER DEFAULT 7 NOT NULL,
ef5584
	forum_desc_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	forum_link VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	forum_password VARCHAR(40) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	forum_style INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_image VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	forum_rules BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	forum_rules_link VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	forum_rules_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	forum_rules_options INTEGER DEFAULT 7 NOT NULL,
ef5584
	forum_rules_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	forum_topics_per_page INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_type INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_status INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_posts INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_topics INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_topics_real INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_last_post_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_last_poster_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_last_post_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	forum_last_post_time INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_last_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	forum_last_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	forum_flags INTEGER DEFAULT 32 NOT NULL,
ef5584
	display_subforum_list INTEGER DEFAULT 1 NOT NULL,
ef5584
	display_on_index INTEGER DEFAULT 1 NOT NULL,
ef5584
	enable_indexing INTEGER DEFAULT 1 NOT NULL,
ef5584
	enable_icons INTEGER DEFAULT 1 NOT NULL,
ef5584
	enable_prune INTEGER DEFAULT 0 NOT NULL,
ef5584
	prune_next INTEGER DEFAULT 0 NOT NULL,
ef5584
	prune_days INTEGER DEFAULT 0 NOT NULL,
ef5584
	prune_viewed INTEGER DEFAULT 0 NOT NULL,
ef5584
	prune_freq INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_forums ADD PRIMARY KEY (forum_id);;
ef5584
ef5584
CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums(left_id, right_id);;
ef5584
CREATE INDEX phpbb_forums_forum_lastpost_id ON phpbb_forums(forum_last_post_id);;
ef5584
ef5584
CREATE GENERATOR phpbb_forums_gen;;
ef5584
SET GENERATOR phpbb_forums_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_forums FOR phpbb_forums
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.forum_id = GEN_ID(phpbb_forums_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_forums_access'
ef5584
CREATE TABLE phpbb_forums_access (
ef5584
	forum_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_forums_access ADD PRIMARY KEY (forum_id, user_id, session_id);;
ef5584
ef5584
ef5584
# Table: 'phpbb_forums_track'
ef5584
CREATE TABLE phpbb_forums_track (
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	mark_time INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_forums_track ADD PRIMARY KEY (user_id, forum_id);;
ef5584
ef5584
ef5584
# Table: 'phpbb_forums_watch'
ef5584
CREATE TABLE phpbb_forums_watch (
ef5584
	forum_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	notify_status INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch(forum_id);;
ef5584
CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch(user_id);;
ef5584
CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch(notify_status);;
ef5584
ef5584
# Table: 'phpbb_groups'
ef5584
CREATE TABLE phpbb_groups (
ef5584
	group_id INTEGER NOT NULL,
ef5584
	group_type INTEGER DEFAULT 1 NOT NULL,
ef5584
	group_founder_manage INTEGER DEFAULT 0 NOT NULL,
ef5584
	group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	group_desc BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	group_desc_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	group_desc_options INTEGER DEFAULT 7 NOT NULL,
ef5584
	group_desc_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	group_display INTEGER DEFAULT 0 NOT NULL,
ef5584
	group_avatar VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	group_avatar_type INTEGER DEFAULT 0 NOT NULL,
ef5584
	group_avatar_width INTEGER DEFAULT 0 NOT NULL,
ef5584
	group_avatar_height INTEGER DEFAULT 0 NOT NULL,
ef5584
	group_rank INTEGER DEFAULT 0 NOT NULL,
ef5584
	group_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	group_sig_chars INTEGER DEFAULT 0 NOT NULL,
ef5584
	group_receive_pm INTEGER DEFAULT 0 NOT NULL,
ef5584
	group_message_limit INTEGER DEFAULT 0 NOT NULL,
ef5584
	group_max_recipients INTEGER DEFAULT 0 NOT NULL,
ef5584
	group_legend INTEGER DEFAULT 1 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_groups ADD PRIMARY KEY (group_id);;
ef5584
ef5584
CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups(group_legend, group_name);;
ef5584
ef5584
CREATE GENERATOR phpbb_groups_gen;;
ef5584
SET GENERATOR phpbb_groups_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_groups FOR phpbb_groups
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.group_id = GEN_ID(phpbb_groups_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_icons'
ef5584
CREATE TABLE phpbb_icons (
ef5584
	icons_id INTEGER NOT NULL,
ef5584
	icons_url VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	icons_width INTEGER DEFAULT 0 NOT NULL,
ef5584
	icons_height INTEGER DEFAULT 0 NOT NULL,
ef5584
	icons_order INTEGER DEFAULT 0 NOT NULL,
ef5584
	display_on_posting INTEGER DEFAULT 1 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_icons ADD PRIMARY KEY (icons_id);;
ef5584
ef5584
CREATE INDEX phpbb_icons_display_on_posting ON phpbb_icons(display_on_posting);;
ef5584
ef5584
CREATE GENERATOR phpbb_icons_gen;;
ef5584
SET GENERATOR phpbb_icons_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_icons FOR phpbb_icons
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.icons_id = GEN_ID(phpbb_icons_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_lang'
ef5584
CREATE TABLE phpbb_lang (
ef5584
	lang_id INTEGER NOT NULL,
ef5584
	lang_iso VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	lang_dir VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	lang_english_name VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	lang_local_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	lang_author VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_lang ADD PRIMARY KEY (lang_id);;
ef5584
ef5584
CREATE INDEX phpbb_lang_lang_iso ON phpbb_lang(lang_iso);;
ef5584
ef5584
CREATE GENERATOR phpbb_lang_gen;;
ef5584
SET GENERATOR phpbb_lang_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_lang FOR phpbb_lang
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.lang_id = GEN_ID(phpbb_lang_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_log'
ef5584
CREATE TABLE phpbb_log (
ef5584
	log_id INTEGER NOT NULL,
ef5584
	log_type INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	reportee_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	log_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	log_time INTEGER DEFAULT 0 NOT NULL,
ef5584
	log_operation BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	log_data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_log ADD PRIMARY KEY (log_id);;
ef5584
ef5584
CREATE INDEX phpbb_log_log_type ON phpbb_log(log_type);;
ef5584
CREATE INDEX phpbb_log_forum_id ON phpbb_log(forum_id);;
ef5584
CREATE INDEX phpbb_log_topic_id ON phpbb_log(topic_id);;
ef5584
CREATE INDEX phpbb_log_reportee_id ON phpbb_log(reportee_id);;
ef5584
CREATE INDEX phpbb_log_user_id ON phpbb_log(user_id);;
ef5584
ef5584
CREATE GENERATOR phpbb_log_gen;;
ef5584
SET GENERATOR phpbb_log_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_log FOR phpbb_log
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.log_id = GEN_ID(phpbb_log_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_moderator_cache'
ef5584
CREATE TABLE phpbb_moderator_cache (
ef5584
	forum_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	group_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	display_on_index INTEGER DEFAULT 1 NOT NULL
ef5584
);;
ef5584
ef5584
CREATE INDEX phpbb_moderator_cache_disp_idx ON phpbb_moderator_cache(display_on_index);;
ef5584
CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache(forum_id);;
ef5584
ef5584
# Table: 'phpbb_modules'
ef5584
CREATE TABLE phpbb_modules (
ef5584
	module_id INTEGER NOT NULL,
ef5584
	module_enabled INTEGER DEFAULT 1 NOT NULL,
ef5584
	module_display INTEGER DEFAULT 1 NOT NULL,
ef5584
	module_basename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	module_class VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	parent_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	left_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	right_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	module_langname VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	module_mode VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	module_auth VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_modules ADD PRIMARY KEY (module_id);;
ef5584
ef5584
CREATE INDEX phpbb_modules_left_right_id ON phpbb_modules(left_id, right_id);;
ef5584
CREATE INDEX phpbb_modules_module_enabled ON phpbb_modules(module_enabled);;
ef5584
CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules(module_class, left_id);;
ef5584
ef5584
CREATE GENERATOR phpbb_modules_gen;;
ef5584
SET GENERATOR phpbb_modules_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_modules FOR phpbb_modules
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.module_id = GEN_ID(phpbb_modules_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_poll_options'
ef5584
CREATE TABLE phpbb_poll_options (
ef5584
	poll_option_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	poll_option_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	poll_option_total INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options(poll_option_id);;
ef5584
CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options(topic_id);;
ef5584
ef5584
# Table: 'phpbb_poll_votes'
ef5584
CREATE TABLE phpbb_poll_votes (
ef5584
	topic_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	poll_option_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	vote_user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	vote_user_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes(topic_id);;
ef5584
CREATE INDEX phpbb_poll_votes_vote_user_id ON phpbb_poll_votes(vote_user_id);;
ef5584
CREATE INDEX phpbb_poll_votes_vote_user_ip ON phpbb_poll_votes(vote_user_ip);;
ef5584
ef5584
# Table: 'phpbb_posts'
ef5584
CREATE TABLE phpbb_posts (
ef5584
	post_id INTEGER NOT NULL,
ef5584
	topic_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	poster_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	icon_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	poster_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	post_time INTEGER DEFAULT 0 NOT NULL,
ef5584
	post_approved INTEGER DEFAULT 1 NOT NULL,
ef5584
	post_reported INTEGER DEFAULT 0 NOT NULL,
ef5584
	enable_bbcode INTEGER DEFAULT 1 NOT NULL,
ef5584
	enable_smilies INTEGER DEFAULT 1 NOT NULL,
ef5584
	enable_magic_url INTEGER DEFAULT 1 NOT NULL,
ef5584
	enable_sig INTEGER DEFAULT 1 NOT NULL,
ef5584
	post_username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	post_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	post_checksum VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	post_attachment INTEGER DEFAULT 0 NOT NULL,
ef5584
	bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	post_postcount INTEGER DEFAULT 1 NOT NULL,
ef5584
	post_edit_time INTEGER DEFAULT 0 NOT NULL,
ef5584
	post_edit_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	post_edit_user INTEGER DEFAULT 0 NOT NULL,
ef5584
	post_edit_count INTEGER DEFAULT 0 NOT NULL,
ef5584
	post_edit_locked INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_posts ADD PRIMARY KEY (post_id);;
ef5584
ef5584
CREATE INDEX phpbb_posts_forum_id ON phpbb_posts(forum_id);;
ef5584
CREATE INDEX phpbb_posts_topic_id ON phpbb_posts(topic_id);;
ef5584
CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts(poster_ip);;
ef5584
CREATE INDEX phpbb_posts_poster_id ON phpbb_posts(poster_id);;
ef5584
CREATE INDEX phpbb_posts_post_approved ON phpbb_posts(post_approved);;
ef5584
CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts(topic_id, post_time);;
ef5584
ef5584
CREATE GENERATOR phpbb_posts_gen;;
ef5584
SET GENERATOR phpbb_posts_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_posts FOR phpbb_posts
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.post_id = GEN_ID(phpbb_posts_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_privmsgs'
ef5584
CREATE TABLE phpbb_privmsgs (
ef5584
	msg_id INTEGER NOT NULL,
ef5584
	root_level INTEGER DEFAULT 0 NOT NULL,
ef5584
	author_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	icon_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	author_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	message_time INTEGER DEFAULT 0 NOT NULL,
ef5584
	enable_bbcode INTEGER DEFAULT 1 NOT NULL,
ef5584
	enable_smilies INTEGER DEFAULT 1 NOT NULL,
ef5584
	enable_magic_url INTEGER DEFAULT 1 NOT NULL,
ef5584
	enable_sig INTEGER DEFAULT 1 NOT NULL,
ef5584
	message_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	message_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	message_edit_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	message_edit_user INTEGER DEFAULT 0 NOT NULL,
ef5584
	message_attachment INTEGER DEFAULT 0 NOT NULL,
ef5584
	bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	message_edit_time INTEGER DEFAULT 0 NOT NULL,
ef5584
	message_edit_count INTEGER DEFAULT 0 NOT NULL,
ef5584
	to_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	bcc_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_privmsgs ADD PRIMARY KEY (msg_id);;
ef5584
ef5584
CREATE INDEX phpbb_privmsgs_author_ip ON phpbb_privmsgs(author_ip);;
ef5584
CREATE INDEX phpbb_privmsgs_message_time ON phpbb_privmsgs(message_time);;
ef5584
CREATE INDEX phpbb_privmsgs_author_id ON phpbb_privmsgs(author_id);;
ef5584
CREATE INDEX phpbb_privmsgs_root_level ON phpbb_privmsgs(root_level);;
ef5584
ef5584
CREATE GENERATOR phpbb_privmsgs_gen;;
ef5584
SET GENERATOR phpbb_privmsgs_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_privmsgs FOR phpbb_privmsgs
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.msg_id = GEN_ID(phpbb_privmsgs_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_privmsgs_folder'
ef5584
CREATE TABLE phpbb_privmsgs_folder (
ef5584
	folder_id INTEGER NOT NULL,
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	folder_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	pm_count INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_privmsgs_folder ADD PRIMARY KEY (folder_id);;
ef5584
ef5584
CREATE INDEX phpbb_privmsgs_folder_user_id ON phpbb_privmsgs_folder(user_id);;
ef5584
ef5584
CREATE GENERATOR phpbb_privmsgs_folder_gen;;
ef5584
SET GENERATOR phpbb_privmsgs_folder_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_privmsgs_folder FOR phpbb_privmsgs_folder
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.folder_id = GEN_ID(phpbb_privmsgs_folder_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_privmsgs_rules'
ef5584
CREATE TABLE phpbb_privmsgs_rules (
ef5584
	rule_id INTEGER NOT NULL,
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	rule_check INTEGER DEFAULT 0 NOT NULL,
ef5584
	rule_connection INTEGER DEFAULT 0 NOT NULL,
ef5584
	rule_string VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	rule_user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	rule_group_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	rule_action INTEGER DEFAULT 0 NOT NULL,
ef5584
	rule_folder_id INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_privmsgs_rules ADD PRIMARY KEY (rule_id);;
ef5584
ef5584
CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules(user_id);;
ef5584
ef5584
CREATE GENERATOR phpbb_privmsgs_rules_gen;;
ef5584
SET GENERATOR phpbb_privmsgs_rules_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_privmsgs_rules FOR phpbb_privmsgs_rules
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.rule_id = GEN_ID(phpbb_privmsgs_rules_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_privmsgs_to'
ef5584
CREATE TABLE phpbb_privmsgs_to (
ef5584
	msg_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	author_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	pm_deleted INTEGER DEFAULT 0 NOT NULL,
ef5584
	pm_new INTEGER DEFAULT 1 NOT NULL,
ef5584
	pm_unread INTEGER DEFAULT 1 NOT NULL,
ef5584
	pm_replied INTEGER DEFAULT 0 NOT NULL,
ef5584
	pm_marked INTEGER DEFAULT 0 NOT NULL,
ef5584
	pm_forwarded INTEGER DEFAULT 0 NOT NULL,
ef5584
	folder_id INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to(msg_id);;
ef5584
CREATE INDEX phpbb_privmsgs_to_author_id ON phpbb_privmsgs_to(author_id);;
ef5584
CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to(user_id, folder_id);;
ef5584
ef5584
# Table: 'phpbb_profile_fields'
ef5584
CREATE TABLE phpbb_profile_fields (
ef5584
	field_id INTEGER NOT NULL,
ef5584
	field_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	field_type INTEGER DEFAULT 0 NOT NULL,
ef5584
	field_ident VARCHAR(20) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	field_length VARCHAR(20) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	field_minlen VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	field_maxlen VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	field_novalue VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	field_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	field_validation VARCHAR(20) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	field_required INTEGER DEFAULT 0 NOT NULL,
ef5584
	field_show_on_reg INTEGER DEFAULT 0 NOT NULL,
ef5584
	field_show_profile INTEGER DEFAULT 0 NOT NULL,
ef5584
	field_hide INTEGER DEFAULT 0 NOT NULL,
ef5584
	field_no_view INTEGER DEFAULT 0 NOT NULL,
ef5584
	field_active INTEGER DEFAULT 0 NOT NULL,
ef5584
	field_order INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_profile_fields ADD PRIMARY KEY (field_id);;
ef5584
ef5584
CREATE INDEX phpbb_profile_fields_fld_type ON phpbb_profile_fields(field_type);;
ef5584
CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields(field_order);;
ef5584
ef5584
CREATE GENERATOR phpbb_profile_fields_gen;;
ef5584
SET GENERATOR phpbb_profile_fields_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_profile_fields FOR phpbb_profile_fields
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.field_id = GEN_ID(phpbb_profile_fields_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_profile_fields_data'
ef5584
CREATE TABLE phpbb_profile_fields_data (
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_profile_fields_data ADD PRIMARY KEY (user_id);;
ef5584
ef5584
ef5584
# Table: 'phpbb_profile_fields_lang'
ef5584
CREATE TABLE phpbb_profile_fields_lang (
ef5584
	field_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	lang_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	option_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	field_type INTEGER DEFAULT 0 NOT NULL,
ef5584
	lang_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_profile_fields_lang ADD PRIMARY KEY (field_id, lang_id, option_id);;
ef5584
ef5584
ef5584
# Table: 'phpbb_profile_lang'
ef5584
CREATE TABLE phpbb_profile_lang (
ef5584
	field_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	lang_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	lang_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	lang_explain BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	lang_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_profile_lang ADD PRIMARY KEY (field_id, lang_id);;
ef5584
ef5584
ef5584
# Table: 'phpbb_ranks'
ef5584
CREATE TABLE phpbb_ranks (
ef5584
	rank_id INTEGER NOT NULL,
ef5584
	rank_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	rank_min INTEGER DEFAULT 0 NOT NULL,
ef5584
	rank_special INTEGER DEFAULT 0 NOT NULL,
ef5584
	rank_image VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_ranks ADD PRIMARY KEY (rank_id);;
ef5584
ef5584
ef5584
CREATE GENERATOR phpbb_ranks_gen;;
ef5584
SET GENERATOR phpbb_ranks_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_ranks FOR phpbb_ranks
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.rank_id = GEN_ID(phpbb_ranks_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_reports'
ef5584
CREATE TABLE phpbb_reports (
ef5584
	report_id INTEGER NOT NULL,
ef5584
	reason_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	post_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_notify INTEGER DEFAULT 0 NOT NULL,
ef5584
	report_closed INTEGER DEFAULT 0 NOT NULL,
ef5584
	report_time INTEGER DEFAULT 0 NOT NULL,
ef5584
	report_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);;
ef5584
ef5584
ef5584
CREATE GENERATOR phpbb_reports_gen;;
ef5584
SET GENERATOR phpbb_reports_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_reports FOR phpbb_reports
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.report_id = GEN_ID(phpbb_reports_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_reports_reasons'
ef5584
CREATE TABLE phpbb_reports_reasons (
ef5584
	reason_id INTEGER NOT NULL,
ef5584
	reason_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	reason_description BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	reason_order INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_reports_reasons ADD PRIMARY KEY (reason_id);;
ef5584
ef5584
ef5584
CREATE GENERATOR phpbb_reports_reasons_gen;;
ef5584
SET GENERATOR phpbb_reports_reasons_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_reports_reasons FOR phpbb_reports_reasons
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.reason_id = GEN_ID(phpbb_reports_reasons_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_search_results'
ef5584
CREATE TABLE phpbb_search_results (
ef5584
	search_key VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	search_time INTEGER DEFAULT 0 NOT NULL,
ef5584
	search_keywords BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	search_authors BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_search_results ADD PRIMARY KEY (search_key);;
ef5584
ef5584
ef5584
# Table: 'phpbb_search_wordlist'
ef5584
CREATE TABLE phpbb_search_wordlist (
ef5584
	word_id INTEGER NOT NULL,
ef5584
	word_text VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	word_common INTEGER DEFAULT 0 NOT NULL,
ef5584
	word_count INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_search_wordlist ADD PRIMARY KEY (word_id);;
ef5584
ef5584
CREATE UNIQUE INDEX phpbb_search_wordlist_wrd_txt ON phpbb_search_wordlist(word_text);;
ef5584
CREATE INDEX phpbb_search_wordlist_wrd_cnt ON phpbb_search_wordlist(word_count);;
ef5584
ef5584
CREATE GENERATOR phpbb_search_wordlist_gen;;
ef5584
SET GENERATOR phpbb_search_wordlist_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_search_wordlist FOR phpbb_search_wordlist
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.word_id = GEN_ID(phpbb_search_wordlist_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_search_wordmatch'
ef5584
CREATE TABLE phpbb_search_wordmatch (
ef5584
	post_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	word_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	title_match INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
CREATE UNIQUE INDEX phpbb_search_wordmatch_unq_mtch ON phpbb_search_wordmatch(word_id, post_id, title_match);;
ef5584
CREATE INDEX phpbb_search_wordmatch_word_id ON phpbb_search_wordmatch(word_id);;
ef5584
CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch(post_id);;
ef5584
ef5584
# Table: 'phpbb_sessions'
ef5584
CREATE TABLE phpbb_sessions (
ef5584
	session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	session_user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	session_forum_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	session_last_visit INTEGER DEFAULT 0 NOT NULL,
ef5584
	session_start INTEGER DEFAULT 0 NOT NULL,
ef5584
	session_time INTEGER DEFAULT 0 NOT NULL,
ef5584
	session_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	session_browser VARCHAR(150) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	session_forwarded_for VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	session_page VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	session_viewonline INTEGER DEFAULT 1 NOT NULL,
ef5584
	session_autologin INTEGER DEFAULT 0 NOT NULL,
ef5584
	session_admin INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_sessions ADD PRIMARY KEY (session_id);;
ef5584
ef5584
CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions(session_time);;
ef5584
CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions(session_user_id);;
ef5584
CREATE INDEX phpbb_sessions_session_fid ON phpbb_sessions(session_forum_id);;
ef5584
ef5584
# Table: 'phpbb_sessions_keys'
ef5584
CREATE TABLE phpbb_sessions_keys (
ef5584
	key_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	last_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	last_login INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_sessions_keys ADD PRIMARY KEY (key_id, user_id);;
ef5584
ef5584
CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys(last_login);;
ef5584
ef5584
# Table: 'phpbb_sitelist'
ef5584
CREATE TABLE phpbb_sitelist (
ef5584
	site_id INTEGER NOT NULL,
ef5584
	site_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	site_hostname VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	ip_exclude INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_sitelist ADD PRIMARY KEY (site_id);;
ef5584
ef5584
ef5584
CREATE GENERATOR phpbb_sitelist_gen;;
ef5584
SET GENERATOR phpbb_sitelist_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_sitelist FOR phpbb_sitelist
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.site_id = GEN_ID(phpbb_sitelist_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_smilies'
ef5584
CREATE TABLE phpbb_smilies (
ef5584
	smiley_id INTEGER NOT NULL,
ef5584
	code VARCHAR(50) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	emotion VARCHAR(50) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	smiley_url VARCHAR(50) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	smiley_width INTEGER DEFAULT 0 NOT NULL,
ef5584
	smiley_height INTEGER DEFAULT 0 NOT NULL,
ef5584
	smiley_order INTEGER DEFAULT 0 NOT NULL,
ef5584
	display_on_posting INTEGER DEFAULT 1 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_smilies ADD PRIMARY KEY (smiley_id);;
ef5584
ef5584
CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies(display_on_posting);;
ef5584
ef5584
CREATE GENERATOR phpbb_smilies_gen;;
ef5584
SET GENERATOR phpbb_smilies_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_smilies FOR phpbb_smilies
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.smiley_id = GEN_ID(phpbb_smilies_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_styles'
ef5584
CREATE TABLE phpbb_styles (
ef5584
	style_id INTEGER NOT NULL,
ef5584
	style_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	style_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	style_active INTEGER DEFAULT 1 NOT NULL,
ef5584
	template_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	theme_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	imageset_id INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_styles ADD PRIMARY KEY (style_id);;
ef5584
ef5584
CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles(style_name);;
ef5584
CREATE INDEX phpbb_styles_template_id ON phpbb_styles(template_id);;
ef5584
CREATE INDEX phpbb_styles_theme_id ON phpbb_styles(theme_id);;
ef5584
CREATE INDEX phpbb_styles_imageset_id ON phpbb_styles(imageset_id);;
ef5584
ef5584
CREATE GENERATOR phpbb_styles_gen;;
ef5584
SET GENERATOR phpbb_styles_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_styles FOR phpbb_styles
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.style_id = GEN_ID(phpbb_styles_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_styles_template'
ef5584
CREATE TABLE phpbb_styles_template (
ef5584
	template_id INTEGER NOT NULL,
ef5584
	template_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	template_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	template_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT 'kNg=' NOT NULL,
ef5584
	template_storedb INTEGER DEFAULT 0 NOT NULL,
ef5584
	template_inherits_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	template_inherit_path VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_styles_template ADD PRIMARY KEY (template_id);;
ef5584
ef5584
CREATE UNIQUE INDEX phpbb_styles_template_tmplte_nm ON phpbb_styles_template(template_name);;
ef5584
ef5584
CREATE GENERATOR phpbb_styles_template_gen;;
ef5584
SET GENERATOR phpbb_styles_template_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_styles_template FOR phpbb_styles_template
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.template_id = GEN_ID(phpbb_styles_template_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_styles_template_data'
ef5584
CREATE TABLE phpbb_styles_template_data (
ef5584
	template_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	template_filename VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	template_included BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	template_mtime INTEGER DEFAULT 0 NOT NULL,
ef5584
	template_data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
CREATE INDEX phpbb_styles_template_data_tid ON phpbb_styles_template_data(template_id);;
ef5584
CREATE INDEX phpbb_styles_template_data_tfn ON phpbb_styles_template_data(template_filename);;
ef5584
ef5584
# Table: 'phpbb_styles_theme'
ef5584
CREATE TABLE phpbb_styles_theme (
ef5584
	theme_id INTEGER NOT NULL,
ef5584
	theme_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	theme_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	theme_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	theme_storedb INTEGER DEFAULT 0 NOT NULL,
ef5584
	theme_mtime INTEGER DEFAULT 0 NOT NULL,
ef5584
	theme_data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_styles_theme ADD PRIMARY KEY (theme_id);;
ef5584
ef5584
CREATE UNIQUE INDEX phpbb_styles_theme_theme_name ON phpbb_styles_theme(theme_name);;
ef5584
ef5584
CREATE GENERATOR phpbb_styles_theme_gen;;
ef5584
SET GENERATOR phpbb_styles_theme_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_styles_theme FOR phpbb_styles_theme
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.theme_id = GEN_ID(phpbb_styles_theme_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_styles_imageset'
ef5584
CREATE TABLE phpbb_styles_imageset (
ef5584
	imageset_id INTEGER NOT NULL,
ef5584
	imageset_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	imageset_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	imageset_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_styles_imageset ADD PRIMARY KEY (imageset_id);;
ef5584
ef5584
CREATE UNIQUE INDEX phpbb_styles_imageset_imgset_nm ON phpbb_styles_imageset(imageset_name);;
ef5584
ef5584
CREATE GENERATOR phpbb_styles_imageset_gen;;
ef5584
SET GENERATOR phpbb_styles_imageset_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_styles_imageset FOR phpbb_styles_imageset
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.imageset_id = GEN_ID(phpbb_styles_imageset_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_styles_imageset_data'
ef5584
CREATE TABLE phpbb_styles_imageset_data (
ef5584
	image_id INTEGER NOT NULL,
ef5584
	image_name VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	image_filename VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	image_lang VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	image_height INTEGER DEFAULT 0 NOT NULL,
ef5584
	image_width INTEGER DEFAULT 0 NOT NULL,
ef5584
	imageset_id INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_styles_imageset_data ADD PRIMARY KEY (image_id);;
ef5584
ef5584
CREATE INDEX phpbb_styles_imageset_data_i_d ON phpbb_styles_imageset_data(imageset_id);;
ef5584
ef5584
CREATE GENERATOR phpbb_styles_imageset_data_gen;;
ef5584
SET GENERATOR phpbb_styles_imageset_data_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_styles_imageset_data FOR phpbb_styles_imageset_data
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.image_id = GEN_ID(phpbb_styles_imageset_data_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_topics'
ef5584
CREATE TABLE phpbb_topics (
ef5584
	topic_id INTEGER NOT NULL,
ef5584
	forum_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	icon_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_attachment INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_approved INTEGER DEFAULT 1 NOT NULL,
ef5584
	topic_reported INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	topic_poster INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_time INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_time_limit INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_views INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_replies INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_replies_real INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_status INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_type INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_first_post_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_first_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	topic_first_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	topic_last_post_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_last_poster_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_last_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	topic_last_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	topic_last_post_subject VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	topic_last_post_time INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_last_view_time INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_moved_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_bumped INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_bumper INTEGER DEFAULT 0 NOT NULL,
ef5584
	poll_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	poll_start INTEGER DEFAULT 0 NOT NULL,
ef5584
	poll_length INTEGER DEFAULT 0 NOT NULL,
ef5584
	poll_max_options INTEGER DEFAULT 1 NOT NULL,
ef5584
	poll_last_vote INTEGER DEFAULT 0 NOT NULL,
ef5584
	poll_vote_change INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_topics ADD PRIMARY KEY (topic_id);;
ef5584
ef5584
CREATE INDEX phpbb_topics_forum_id ON phpbb_topics(forum_id);;
ef5584
CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics(forum_id, topic_type);;
ef5584
CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics(topic_last_post_time);;
ef5584
CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics(topic_approved);;
ef5584
CREATE INDEX phpbb_topics_forum_appr_last ON phpbb_topics(forum_id, topic_approved, topic_last_post_id);;
ef5584
CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics(forum_id, topic_last_post_time, topic_moved_id);;
ef5584
ef5584
CREATE GENERATOR phpbb_topics_gen;;
ef5584
SET GENERATOR phpbb_topics_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_topics FOR phpbb_topics
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.topic_id = GEN_ID(phpbb_topics_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_topics_track'
ef5584
CREATE TABLE phpbb_topics_track (
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	forum_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	mark_time INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_topics_track ADD PRIMARY KEY (user_id, topic_id);;
ef5584
ef5584
CREATE INDEX phpbb_topics_track_forum_id ON phpbb_topics_track(forum_id);;
ef5584
ef5584
# Table: 'phpbb_topics_posted'
ef5584
CREATE TABLE phpbb_topics_posted (
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	topic_posted INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_topics_posted ADD PRIMARY KEY (user_id, topic_id);;
ef5584
ef5584
ef5584
# Table: 'phpbb_topics_watch'
ef5584
CREATE TABLE phpbb_topics_watch (
ef5584
	topic_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	notify_status INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch(topic_id);;
ef5584
CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch(user_id);;
ef5584
CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch(notify_status);;
ef5584
ef5584
# Table: 'phpbb_user_group'
ef5584
CREATE TABLE phpbb_user_group (
ef5584
	group_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	group_leader INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_pending INTEGER DEFAULT 1 NOT NULL
ef5584
);;
ef5584
ef5584
CREATE INDEX phpbb_user_group_group_id ON phpbb_user_group(group_id);;
ef5584
CREATE INDEX phpbb_user_group_user_id ON phpbb_user_group(user_id);;
ef5584
CREATE INDEX phpbb_user_group_group_leader ON phpbb_user_group(group_leader);;
ef5584
ef5584
# Table: 'phpbb_users'
ef5584
CREATE TABLE phpbb_users (
ef5584
	user_id INTEGER NOT NULL,
ef5584
	user_type INTEGER DEFAULT 0 NOT NULL,
ef5584
	group_id INTEGER DEFAULT 3 NOT NULL,
ef5584
	user_permissions BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	user_perm_from INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	user_regdate INTEGER DEFAULT 0 NOT NULL,
ef5584
	username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	username_clean VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	user_password VARCHAR(40) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	user_passchg INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_pass_convert INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_email VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	user_email_hash DOUBLE PRECISION DEFAULT 0 NOT NULL,
ef5584
	user_birthday VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	user_lastvisit INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_lastmark INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_lastpost_time INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_lastpage VARCHAR(200) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	user_last_confirm_key VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	user_last_search INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_warnings INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_last_warning INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_login_attempts INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_inactive_reason INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_inactive_time INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_posts INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_lang VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	user_timezone DOUBLE PRECISION DEFAULT 0 NOT NULL,
ef5584
	user_dst INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_dateformat VARCHAR(30) CHARACTER SET UTF8 DEFAULT 'd M Y H:i' NOT NULL COLLATE UNICODE,
ef5584
	user_style INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_rank INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	user_new_privmsg INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_unread_privmsg INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_last_privmsg INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_message_rules INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_full_folder INTEGER DEFAULT -3 NOT NULL,
ef5584
	user_emailtime INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_topic_show_days INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_topic_sortby_type VARCHAR(1) CHARACTER SET NONE DEFAULT 't' NOT NULL,
ef5584
	user_topic_sortby_dir VARCHAR(1) CHARACTER SET NONE DEFAULT 'd' NOT NULL,
ef5584
	user_post_show_days INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_post_sortby_type VARCHAR(1) CHARACTER SET NONE DEFAULT 't' NOT NULL,
ef5584
	user_post_sortby_dir VARCHAR(1) CHARACTER SET NONE DEFAULT 'a' NOT NULL,
ef5584
	user_notify INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_notify_pm INTEGER DEFAULT 1 NOT NULL,
ef5584
	user_notify_type INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_allow_pm INTEGER DEFAULT 1 NOT NULL,
ef5584
	user_allow_viewonline INTEGER DEFAULT 1 NOT NULL,
ef5584
	user_allow_viewemail INTEGER DEFAULT 1 NOT NULL,
ef5584
	user_allow_massemail INTEGER DEFAULT 1 NOT NULL,
ef5584
	user_options INTEGER DEFAULT 895 NOT NULL,
ef5584
	user_avatar VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	user_avatar_type INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_avatar_width INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_avatar_height INTEGER DEFAULT 0 NOT NULL,
ef5584
	user_sig BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	user_sig_bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	user_sig_bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	user_from VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	user_icq VARCHAR(15) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	user_aim VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	user_yim VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	user_msnm VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	user_jabber VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	user_website VARCHAR(200) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	user_occ BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	user_interests BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
ef5584
	user_actkey VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
ef5584
	user_newpasswd VARCHAR(40) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	user_form_salt VARCHAR(32) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_users ADD PRIMARY KEY (user_id);;
ef5584
ef5584
CREATE INDEX phpbb_users_user_birthday ON phpbb_users(user_birthday);;
ef5584
CREATE INDEX phpbb_users_user_email_hash ON phpbb_users(user_email_hash);;
ef5584
CREATE INDEX phpbb_users_user_type ON phpbb_users(user_type);;
ef5584
CREATE UNIQUE INDEX phpbb_users_username_clean ON phpbb_users(username_clean);;
ef5584
ef5584
CREATE GENERATOR phpbb_users_gen;;
ef5584
SET GENERATOR phpbb_users_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_users FOR phpbb_users
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.user_id = GEN_ID(phpbb_users_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_warnings'
ef5584
CREATE TABLE phpbb_warnings (
ef5584
	warning_id INTEGER NOT NULL,
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	post_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	log_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	warning_time INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_warnings ADD PRIMARY KEY (warning_id);;
ef5584
ef5584
ef5584
CREATE GENERATOR phpbb_warnings_gen;;
ef5584
SET GENERATOR phpbb_warnings_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_warnings FOR phpbb_warnings
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.warning_id = GEN_ID(phpbb_warnings_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_words'
ef5584
CREATE TABLE phpbb_words (
ef5584
	word_id INTEGER NOT NULL,
ef5584
	word VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
ef5584
	replacement VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_words ADD PRIMARY KEY (word_id);;
ef5584
ef5584
ef5584
CREATE GENERATOR phpbb_words_gen;;
ef5584
SET GENERATOR phpbb_words_gen TO 0;;
ef5584
ef5584
CREATE TRIGGER t_phpbb_words FOR phpbb_words
ef5584
BEFORE INSERT
ef5584
AS
ef5584
BEGIN
ef5584
	NEW.word_id = GEN_ID(phpbb_words_gen, 1);
ef5584
END;;
ef5584
ef5584
ef5584
# Table: 'phpbb_zebra'
ef5584
CREATE TABLE phpbb_zebra (
ef5584
	user_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	zebra_id INTEGER DEFAULT 0 NOT NULL,
ef5584
	friend INTEGER DEFAULT 0 NOT NULL,
ef5584
	foe INTEGER DEFAULT 0 NOT NULL
ef5584
);;
ef5584
ef5584
ALTER TABLE phpbb_zebra ADD PRIMARY KEY (user_id, zebra_id);;
ef5584
ef5584