Index: language/en/install.php
===================================================================
--- language/en/install.php	(revision 9326)
+++ language/en/install.php	(working copy)
@@ -151,6 +151,8 @@
 	'DLL_ORACLE'				=> 'Oracle',
 	'DLL_POSTGRES'				=> 'PostgreSQL 7.x/8.x',
 	'DLL_SQLITE'				=> 'SQLite',
+	'DLL_MONETDB'				=> 'MonetDB',
+	'DLL_MONETDB_ODBC'			=> 'MonetDB via ODBC',
 	'DLL_XML'					=> 'XML support [ Jabber ]',
 	'DLL_ZLIB'					=> 'zlib compression support [ gz, .tar.gz, .zip ]',
 	'DL_CONFIG'					=> 'Download config',
@@ -211,6 +213,7 @@
 		<li>Firebird 2.0+</li>
 		<li>MS SQL Server 2000 or above (directly or via ODBC)</li>
 		<li>Oracle</li>
+		<li>MonetDB (directly or via ODBC)</li>
 	</ul>
 
 	<p>Only those databases supported on your server will be displayed.',
@@ -625,4 +628,4 @@
 	'TOPICS_TOPIC_TITLE'			=> 'Welcome to phpBB3',
 ));
 
-?>
\ No newline at end of file
+?>
Index: includes/db/monetdb_odbc.php
===================================================================
--- includes/db/monetdb_odbc.php	(revision 0)
+++ includes/db/monetdb_odbc.php	(revision 0)
@@ -0,0 +1,402 @@
+<?php
+/**
+*
+* @package dbal
+* @version $Id: monetdb_odbc.php 8967 2008-10-02 12:04:12Z acydburn $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+	exit;
+}
+
+include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
+
+/**
+* Unified ODBC functions
+* Unified ODBC functions support any database having ODBC driver, for example Adabas D, IBM DB2, iODBC, Solid, Sybase SQL Anywhere...
+*
+* @note number of bytes returned for returning data depends on odbc.defaultlrl php.ini setting.
+* If it is limited to 4K for example only 4K of data is returned max, resulting in incomplete theme data for example.
+* @note odbc.defaultbinmode may affect UTF8 characters
+*
+* @package dbal
+*/
+class dbal_monetdb_odbc extends dbal
+{
+	var $last_query_text = '';
+
+	/**
+	* Connect to server
+	*/
+	function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
+	{
+		$this->persistency = $persistency;
+		$this->user = $sqluser;
+		$this->dbname = $database;
+
+		$port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':';
+		$this->server = $sqlserver . (($port) ? $port_delimiter . $port : '');
+
+		$max_size = @ini_get('odbc.defaultlrl');
+		if (!empty($max_size))
+		{
+			$unit = strtolower(substr($max_size, -1, 1));
+			$max_size = (int) $max_size;
+
+			if ($unit == 'k')
+			{
+				$max_size = floor($max_size / 1024);
+			}
+			else if ($unit == 'g')
+			{
+				$max_size *= 1024;
+			}
+			else if (is_numeric($unit))
+			{
+				$max_size = floor((int) ($max_size . $unit) / 1048576);
+			}
+			$max_size = max(8, $max_size) . 'M';
+
+			@ini_set('odbc.defaultlrl', $max_size);
+		}
+
+		$this->db_connect_id = ($this->persistency) ? @odbc_pconnect($this->server, $this->user, $sqlpassword) : @odbc_connect($this->server, $this->user, $sqlpassword);
+
+		return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
+	}
+
+	/**
+	* Version information about used database
+	* @param bool $raw if true, only return the fetched sql_server_version
+	* @return string sql server version
+	*/
+	function sql_server_info($raw = false)
+	{
+		global $cache;
+
+		if (empty($cache) || ($this->sql_server_version = $cache->get('monetdbodbc_version')) === false)
+		{
+			$this->sql_server_version = '2009';
+
+			if (!empty($cache))
+			{
+				$cache->put('monetdbodbc_version', $this->sql_server_version);
+			}
+		}
+
+		if ($raw)
+		{
+			return $this->sql_server_version;
+		}
+		
+		return ($this->sql_server_version) ? 'MonetDB (ODBC)<br />' . $this->sql_server_version : 'MonetDB (ODBC)';
+	}
+
+	/**
+	* SQL Transaction
+	* @access private
+	*/
+	function _sql_transaction($status = 'begin')
+	{
+		switch ($status)
+		{
+			case 'begin':
+				return @odbc_exec($this->db_connect_id, 'START TRANSACTION');
+			break;
+
+			case 'commit':
+				return @odbc_exec($this->db_connect_id, 'COMMIT');
+			break;
+
+			case 'rollback':
+				return @odbc_exec($this->db_connect_id, 'ROLLBACK');
+			break;
+		}
+
+		return true;
+	}
+
+	/**
+	* Base query method
+	*
+	* @param	string	$query		Contains the SQL query which shall be executed
+	* @param	int		$cache_ttl	Either 0 to avoid caching or the time in seconds which the result shall be kept in cache
+	* @return	mixed				When casted to bool the returned value returns true on success and false on failure
+	*
+	* @access	public
+	*/
+	function sql_query($query = '', $cache_ttl = 0)
+	{
+		if ($query != '')
+		{
+			global $cache;
+
+			// EXPLAIN only in extra debug mode
+			if (defined('DEBUG_EXTRA'))
+			{
+				$this->sql_report('start', $query);
+			}
+
+			$this->last_query_text = $query;
+			$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
+			$this->sql_add_num_queries($this->query_result);
+
+			if ($this->query_result === false)
+			{
+				if (($this->query_result = @odbc_exec($this->db_connect_id, $query)) === false)
+				{
+					$this->sql_error($query);
+				}
+
+				if (defined('DEBUG_EXTRA'))
+				{
+					$this->sql_report('stop', $query);
+				}
+
+				if ($cache_ttl && method_exists($cache, 'sql_save'))
+				{
+					$this->open_queries[(int) $this->query_result] = $this->query_result;
+					$cache->sql_save($query, $this->query_result, $cache_ttl);
+				}
+				else if (strpos($query, 'SELECT') === 0 && $this->query_result)
+				{
+					$this->open_queries[(int) $this->query_result] = $this->query_result;
+				}
+			}
+			else if (defined('DEBUG_EXTRA'))
+			{
+				$this->sql_report('fromcache', $query);
+			}
+		}
+		else
+		{
+			return false;
+		}
+
+		return $this->query_result;
+	}
+
+	/**
+	* Build LIMIT query
+	*/
+        function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+        {
+                $this->query_result = false;
+
+                // if $total is set to 0 we do not want to limit the number of rows
+                if ($total == 0)
+                {
+                        $total = -1;
+                }
+
+                $query .= "\n LIMIT $total OFFSET $offset";
+
+                return $this->sql_query($query, $cache_ttl);
+        }
+
+	/**
+	* Return number of affected rows
+	*/
+	function sql_affectedrows()
+	{
+		return ($this->db_connect_id) ? @odbc_num_rows($this->query_result) : false;
+	}
+
+	/**
+	* Fetch current row
+	* @note number of bytes returned depends on odbc.defaultlrl php.ini setting. If it is limited to 4K for example only 4K of data is returned max.
+	*/
+	function sql_fetchrow($query_id = false, $debug = false)
+	{
+		global $cache;
+
+		if ($query_id === false)
+		{
+			$query_id = $this->query_result;
+		}
+
+		if (isset($cache->sql_rowset[$query_id]))
+		{
+			return $cache->sql_fetchrow($query_id);
+		}
+
+		return ($query_id !== false) ? @odbc_fetch_array($query_id) : false;
+	}
+
+	/**
+	* Seek to given row number
+	* rownum is zero-based
+	*/
+	function sql_rowseek($rownum, &$query_id)
+	{
+		global $cache;
+
+		if ($query_id === false)
+		{
+			$query_id = $this->query_result;
+		}
+
+		if (isset($cache->sql_rowset[$query_id]))
+		{
+			return $cache->sql_rowseek($rownum, $query_id);
+		}
+
+		if ($query_id === false)
+		{
+			return false;
+		}
+
+		$this->sql_freeresult($query_id);
+		$query_id = $this->sql_query($this->last_query_text);
+
+		if ($query_id === false)
+		{
+			return false;
+		}
+
+		// We do not fetch the row for rownum == 0 because then the next resultset would be the second row
+		for ($i = 0; $i < $rownum; $i++)
+		{
+			if (!$this->sql_fetchrow($query_id))
+			{
+				return false;
+			}
+		}
+
+		return true;
+	}
+
+	/**
+	* Get last inserted id after insert statement
+	*/
+	function sql_nextid()
+	{
+		$result_id = @odbc_exec($this->db_connect_id, 'SELECT @@IDENTITY');
+
+		if ($result_id)
+		{
+			if (@odbc_fetch_array($result_id))
+			{
+				$id = @odbc_result($result_id, 1);
+				@odbc_free_result($result_id);
+				return $id;
+			}
+			@odbc_free_result($result_id);
+		}
+
+		return false;
+	}
+
+	/**
+	* Free sql result
+	*/
+	function sql_freeresult($query_id = false)
+	{
+		global $cache;
+
+		if ($query_id === false)
+		{
+			$query_id = $this->query_result;
+		}
+
+		if (isset($cache->sql_rowset[$query_id]))
+		{
+			return $cache->sql_freeresult($query_id);
+		}
+
+		if (isset($this->open_queries[(int) $query_id]))
+		{
+			unset($this->open_queries[(int) $query_id]);
+			return @odbc_free_result($query_id);
+		}
+
+		return false;
+	}
+
+	/**
+	* Escape string used in sql query
+	*/
+	function sql_escape($msg)
+	{
+		return str_replace(array("'", "\0"), array("''", ''), $msg);
+	}
+
+	/**
+	* Build LIKE expression
+	* @access private
+	*/
+	function _sql_like_expression($expression)
+	{
+		return $expression . " ESCAPE '\\\\'";
+	}
+
+	/**
+	* Build db-specific query data
+	* @access private
+	*/
+	function _sql_custom_build($stage, $data)
+	{
+		return $data;
+	}
+
+	/**
+	* return sql error array
+	* @access private
+	*/
+	function _sql_error()
+	{
+		return array(
+			'message'	=> @odbc_errormsg(),
+			'code'		=> @odbc_error()
+		);
+	}
+
+	/**
+	* Close sql connection
+	* @access private
+	*/
+	function _sql_close()
+	{
+		return @odbc_close($this->db_connect_id);
+	}
+
+	/**
+	* Build db-specific report
+	* @access private
+	*/
+	function _sql_report($mode, $query = '')
+	{
+		switch ($mode)
+		{
+			case 'start':
+			break;
+
+			case 'fromcache':
+				$endtime = explode(' ', microtime());
+				$endtime = $endtime[0] + $endtime[1];
+
+				$result = @odbc_exec($this->db_connect_id, $query);
+				while ($void = @odbc_fetch_array($result))
+				{
+					// Take the time spent on parsing rows into account
+				}
+				@odbc_free_result($result);
+
+				$splittime = explode(' ', microtime());
+				$splittime = $splittime[0] + $splittime[1];
+
+				$this->sql_report('record_fromcache', $query, $endtime, $splittime);
+
+			break;
+		}
+	}
+}
+
+?>
Index: includes/db/db_tools.php
===================================================================
--- includes/db/db_tools.php	(revision 9326)
+++ includes/db/db_tools.php	(working copy)
@@ -120,6 +120,36 @@
 			'VCHAR_CI'	=> 'VARCHAR(255) CHARACTER SET UTF8',
 			'VARBINARY'	=> 'CHAR(255) CHARACTER SET NONE',
 		),
+		
+		'monetdb'	=> array(
+			'INT:'		=> 'INTEGER',
+			'BINT'		=> 'BIGINT',
+			'UINT'		=> 'INTEGER',
+			'UINT:'		=> 'INTEGER',
+			'USINT'		=> 'SMALLINT',
+			'BOOL'		=> 'BOOLEAN',
+			'TINT:'		=> 'TINYINT',
+			'VCHAR'		=> 'varchar(255)',
+			'VCHAR:'	=> 'varchar(%d)',
+			'CHAR:'		=> 'char(%d)',
+			'XSTEXT'	=> 'varchar(1000)',
+			'STEXT'		=> 'varchar(3000)',
+			'TEXT'		=> 'varchar(8000)',
+			'MTEXT'		=> 'TEXT',
+			'XSTEXT_UNI'=> 'varchar(100)',
+			'STEXT_UNI'	=> 'varchar(255)',
+			'TEXT_UNI'	=> 'varchar(4000)',
+			'MTEXT_UNI'	=> 'TEXT',
+			'TIMESTAMP'	=> 'TIMESTAMP', // unsigned
+			'DECIMAL'	=> 'decimal(5,2)',
+			'DECIMAL:'	=> 'decimal(%d,2)',
+			'PDECIMAL'	=> 'decimal(6,3)',
+			'PDECIMAL:'	=> 'decimal(%d,3)',
+			'VCHAR_UNI'	=> 'varchar(255)',
+			'VCHAR_UNI:'=> 'varchar(%d)',
+			'VCHAR_CI'	=> 'varchar_ci',
+			'VARBINARY'	=> 'BLOB',
+		),
 
 		'mssql'		=> array(
 			'INT:'		=> '[int]',
@@ -244,7 +274,7 @@
 
 	// A list of types being unsigned for better reference in some db's
 	var $unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP');
-	var $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite');
+	var $supported_dbms = array('firebird', 'monetdb', 'mssql', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite');
 
 	/**
 	* Set this to true if you only want to return the 'to-be-executed' SQL statement(s) (as an array).
@@ -284,6 +314,11 @@
 				$this->sql_layer = 'mssql';
 			break;
 
+			case 'monetdb':
+			case 'monetdb_odbc':
+				$this->sql_layer = 'monetdb';
+			break;
+
 			default:
 				$this->sql_layer = $this->db->sql_layer;
 			break;
@@ -516,6 +551,20 @@
 				return false;
 			break;
 
+			case 'monetdb':
+				$sql = "SELECT column_name
+				        FROM tables, columns
+					WHERE tables.id = columns.table_id
+					AND tables.name = '{$table}'
+					AND columns.name = '{$column_name}'";
+				$result = $this->db->sql_query($sql);
+				while ($row = $this->db->sql_fetchrow($result))
+				{
+					$this->db->sql_freeresult($result);
+					return true;
+				}
+				return false;
+
 			case 'oracle':
 				$sql = "SELECT column_name
 					FROM user_tab_columns
@@ -769,6 +818,34 @@
 				}
 			break;
 
+			case 'monetdb':
+				$return_array['column_type'] = $column_type;
+				
+				$sql .= " {$column_type} ";
+
+				if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
+				{
+					$default_val = "next value for \"sys\".\"{$table_name}_seq\"";
+				}
+				else if (!is_null($column_data[1]))
+				{
+					$default_val = "'" . $column_data[1] . "'";
+					$return_array['null'] = 'NOT NULL';
+					$sql .= 'NOT NULL ';
+				}
+
+				$return_array['default'] = $default_val;
+
+				$sql .= "DEFAULT {$default_val}";
+
+				// Unsigned? Then add a CHECK contraint
+				if (in_array($orig_column_type, $this->unsigned_types))
+				{
+					$return_array['constraint'] = "CHECK ({$column_name} >= 0)";
+					$sql .= " CHECK ({$column_name} >= 0)";
+				}		
+			break;
+
 			case 'postgres':
 				$return_array['column_type'] = $column_type;
 
@@ -844,6 +921,7 @@
 				$statements[] = 'ALTER TABLE ' . $table_name . ' ADD ' . $column_name . ' ' . $column_data['column_type_sql'];
 			break;
 
+			case 'monetdb':
 			case 'postgres':
 				$statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type_sql'];
 			break;
@@ -936,6 +1014,7 @@
 				$statements[] = 'ALTER TABLE ' . $table_name . ' DROP ' . $column_name;
 			break;
 
+			case 'monetdb':
 			case 'postgres':
 				$statements[] = 'ALTER TABLE ' . $table_name . ' DROP COLUMN "' . $column_name . '"';
 			break;
@@ -1021,6 +1100,7 @@
 			break;
 
 			case 'firebird':
+			case 'monetdb':
 			case 'oracle':
 			case 'postgres':
 			case 'sqlite':
@@ -1041,6 +1121,7 @@
 		switch ($this->sql_layer)
 		{
 			case 'firebird':
+			case 'monetdb':
 			case 'postgres':
 				$statements[] = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')';
 			break;
@@ -1127,6 +1208,7 @@
 		{
 			case 'firebird':
 			case 'postgres':
+			case 'monetdb':
 			case 'oracle':
 			case 'sqlite':
 				$statements[] = 'CREATE UNIQUE INDEX ' . $table_name . '_' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
@@ -1156,6 +1238,7 @@
 		{
 			case 'firebird':
 			case 'postgres':
+			case 'monetdb':
 			case 'oracle':
 			case 'sqlite':
 				$statements[] = 'CREATE INDEX ' . $table_name . '_' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
@@ -1196,6 +1279,11 @@
 				}
 			}
 			$this->db->sql_freeresult($result);
+		} 
+		elseif ($this->sql_layer == 'monetdb')
+		{
+			/* MonetDB doesn't maintain internal indices, thus
+			   it is pretty useless to pretend it does. */
 		}
 		else
 		{
@@ -1277,6 +1365,10 @@
 
 		switch ($this->sql_layer)
 		{
+			case 'monetdb':
+				// TODO MONETDB: not supported
+				return false;
+			break;
 			case 'firebird':
 				// Change type...
 				$statements[] = 'ALTER TABLE "' . $table_name . '" ALTER COLUMN "' . $column_name . '" TYPE ' . ' ' . $column_data['column_type_sql'];
@@ -1414,4 +1506,4 @@
 	}
 }
 
-?>
\ No newline at end of file
+?>
Index: includes/acp/acp_reasons.php
===================================================================
--- includes/acp/acp_reasons.php	(revision 9326)
+++ includes/acp/acp_reasons.php	(working copy)
@@ -248,6 +248,7 @@
 						break;
 
 						// Teh standard
+						case 'monetdb':
 						case 'postgres':
 						case 'oracle':
 						case 'firebird':
@@ -371,4 +372,4 @@
 	}
 }
 
-?>
\ No newline at end of file
+?>
Index: includes/acp/acp_users.php
===================================================================
--- includes/acp/acp_users.php	(revision 9326)
+++ includes/acp/acp_users.php	(working copy)
@@ -1140,6 +1140,7 @@
 						{
 							switch ($db->sql_layer)
 							{
+								case 'monetdb':
 								case 'oracle':
 								case 'firebird':
 								case 'postgres':
@@ -2090,4 +2091,4 @@
 	}
 }
 
-?>
\ No newline at end of file
+?>
Index: includes/acp/acp_profile.php
===================================================================
--- includes/acp/acp_profile.php	(revision 9326)
+++ includes/acp/acp_profile.php	(working copy)
@@ -1499,7 +1499,43 @@
 				}
 
 			break;
+			
+			case 'monetdb':
 
+				// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
+				$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD COLUMN \"$field_ident\" ";
+
+				switch ($field_type)
+				{
+					case FIELD_STRING:
+						$sql .= ' VARCHAR(255) ';
+					break;
+
+					case FIELD_DATE:
+						$sql .= 'TIMESTAMP ';
+					break;
+
+					case FIELD_TEXT:
+						$sql .= "TEXT";
+		//						ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
+		//						ADD {$field_ident}_bbcode_bitfield INT4 UNSIGNED";
+					break;
+
+					case FIELD_BOOL:
+						$sql .= 'BOOLEAN ';
+					break;
+
+					case FIELD_DROPDOWN:
+						$sql .= 'SMALLINT ';
+					break;
+
+					case FIELD_INT:
+						$sql .= 'INTEGER ';
+					break;
+				}
+
+			break;
+
 			case 'postgres':
 
 				// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
Index: includes/acp/acp_database.php
===================================================================
--- includes/acp/acp_database.php	(revision 9326)
+++ includes/acp/acp_database.php	(working copy)
@@ -94,6 +94,10 @@
 								$extractor = new mysql_extractor($download, $store, $format, $filename, $time);
 							break;
 
+							case 'monetdb':
+								$extractor = new monetdb_extractor($download, $store, $format, $filename, $time);
+							break;
+
 							case 'sqlite':
 								$extractor = new sqlite_extractor($download, $store, $format, $filename, $time);
 							break;
@@ -130,6 +134,7 @@
 								// We might wanna empty out all that junk :D
 								switch ($db->sql_layer)
 								{
+									case 'monetdb':
 									case 'sqlite':
 									case 'firebird':
 										$extractor->flush('DELETE FROM ' . $table_name . ";\n");
@@ -2302,4 +2307,4 @@
 	return false;
 }
 
-?>
\ No newline at end of file
+?>
Index: includes/functions_install.php
===================================================================
--- includes/functions_install.php	(revision 9326)
+++ includes/functions_install.php	(working copy)
@@ -92,6 +92,28 @@
 			'AVAILABLE'		=> true,
 			'2.0.x'			=> false,
 		),
+/*
+		'monetdb_odbc'=>	array(
+			'LABEL'			=> 'MonetDB',
+			'SCHEMA'		=> 'monetdb',
+			'MODULE'		=> 'monetdb',
+			'DELIM'			=> 'GO',
+			'COMMENTS'		=> 'remove_comments',
+			'DRIVER'		=> 'monetdb',
+			'AVAILABLE'		=> true,
+			'2.0.x'			=> true,
+		),
+*/
+		'monetdb_odbc'=>	array(
+			'LABEL'			=> 'MonetDB [ ODBC ]',
+			'SCHEMA'		=> 'monetdb',
+			'MODULE'		=> 'odbc',
+			'DELIM'			=> 'GO',
+			'COMMENTS'		=> 'remove_comments',
+			'DRIVER'		=> 'monetdb_odbc',
+			'AVAILABLE'		=> true,
+			'2.0.x'			=> true,
+		),
 		'postgres' => array(
 			'LABEL'			=> 'PostgreSQL 7.x/8.x',
 			'SCHEMA'		=> 'postgres',
@@ -205,6 +227,12 @@
 				WHERE type = "table"';
 		break;
 
+		case 'monetdb':
+			$sql = 'SELECT name
+                                FROM tables
+				WHERE type = 0';
+		break;
+
 		case 'mssql':
 		case 'mssql_odbc':
 			$sql = "SELECT name
@@ -294,6 +322,8 @@
 
 		// no break;
 
+		case 'monetdb_odbc':
+		case 'monetdb': /* TODO MONETDB: did not check */
 		case 'postgres':
 			$prefix_length = 36;
 		break;
@@ -531,4 +561,4 @@
 	}
 }
 
-?>
\ No newline at end of file
+?>
Index: install/schemas/monetdb_schema.sql
===================================================================
--- install/schemas/monetdb_schema.sql	(revision 0)
+++ install/schemas/monetdb_schema.sql	(revision 0)
@@ -0,0 +1,1066 @@
+/*
+
+ $Id: monetdb_schema.sql $
+
+*/
+
+START TRANSACTION;
+
+/*
+	Table: 'phpbb_attachments'
+*/
+CREATE SEQUENCE "sys"."phpbb_attachments_seq" AS INTEGER;
+
+CREATE TABLE phpbb_attachments (
+	attach_id integer DEFAULT next value for "sys"."phpbb_attachments_seq",
+	post_msg_id integer DEFAULT '0' NOT NULL CHECK (post_msg_id >= 0),
+	topic_id integer DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+	in_message smallint DEFAULT '0' NOT NULL CHECK (in_message >= 0),
+	poster_id integer DEFAULT '0' NOT NULL CHECK (poster_id >= 0),
+	is_orphan smallint DEFAULT '1' NOT NULL CHECK (is_orphan >= 0),
+	physical_filename varchar(255) DEFAULT '' NOT NULL,
+	real_filename varchar(255) DEFAULT '' NOT NULL,
+	download_count integer DEFAULT '0' NOT NULL CHECK (download_count >= 0),
+	attach_comment varchar(4000) DEFAULT '' NOT NULL,
+	extension varchar(100) DEFAULT '' NOT NULL,
+	mimetype varchar(100) DEFAULT '' NOT NULL,
+	filesize integer DEFAULT '0' NOT NULL CHECK (filesize >= 0),
+	filetime integer DEFAULT '0' NOT NULL CHECK (filetime >= 0),
+	thumbnail smallint DEFAULT '0' NOT NULL CHECK (thumbnail >= 0),
+	PRIMARY KEY (attach_id)
+);
+
+/*
+	Table: 'phpbb_acl_groups'
+*/
+CREATE TABLE phpbb_acl_groups (
+	group_id integer DEFAULT '0' NOT NULL CHECK (group_id >= 0),
+	forum_id integer DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+	auth_option_id integer DEFAULT '0' NOT NULL CHECK (auth_option_id >= 0),
+	auth_role_id integer DEFAULT '0' NOT NULL CHECK (auth_role_id >= 0),
+	auth_setting smallint DEFAULT '0' NOT NULL
+);
+
+/*
+	Table: 'phpbb_acl_options'
+*/
+CREATE SEQUENCE "sys"."phpbb_acl_options_seq" AS INTEGER;
+
+CREATE TABLE phpbb_acl_options (
+	auth_option_id integer DEFAULT next value for "sys"."phpbb_acl_options_seq",
+	auth_option varchar(50) DEFAULT '' NOT NULL,
+	is_global smallint DEFAULT '0' NOT NULL CHECK (is_global >= 0),
+	is_local smallint DEFAULT '0' NOT NULL CHECK (is_local >= 0),
+	founder_only smallint DEFAULT '0' NOT NULL CHECK (founder_only >= 0),
+	PRIMARY KEY (auth_option_id)
+);
+
+/*
+	Table: 'phpbb_acl_roles'
+*/
+CREATE SEQUENCE "sys"."phpbb_acl_roles_seq" AS INTEGER;
+
+CREATE TABLE phpbb_acl_roles (
+	role_id integer DEFAULT next value for "sys"."phpbb_acl_roles_seq",
+	role_name varchar(255) DEFAULT '' NOT NULL,
+	role_description varchar(4000) DEFAULT '' NOT NULL,
+	role_type varchar(10) DEFAULT '' NOT NULL,
+	role_order smallint DEFAULT '0' NOT NULL CHECK (role_order >= 0),
+	PRIMARY KEY (role_id)
+);
+
+/*
+	Table: 'phpbb_acl_roles_data'
+*/
+CREATE TABLE phpbb_acl_roles_data (
+	role_id integer DEFAULT '0' NOT NULL CHECK (role_id >= 0),
+	auth_option_id integer DEFAULT '0' NOT NULL CHECK (auth_option_id >= 0),
+	auth_setting smallint DEFAULT '0' NOT NULL,
+	PRIMARY KEY (role_id, auth_option_id)
+);
+
+/*
+	Table: 'phpbb_acl_users'
+*/
+CREATE TABLE phpbb_acl_users (
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	forum_id integer DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+	auth_option_id integer DEFAULT '0' NOT NULL CHECK (auth_option_id >= 0),
+	auth_role_id integer DEFAULT '0' NOT NULL CHECK (auth_role_id >= 0),
+	auth_setting smallint DEFAULT '0' NOT NULL
+);
+
+/*
+	Table: 'phpbb_banlist'
+*/
+CREATE SEQUENCE "sys"."phpbb_banlist_seq" AS INTEGER;
+
+CREATE TABLE phpbb_banlist (
+	ban_id integer DEFAULT next value for "sys"."phpbb_banlist_seq",
+	ban_userid integer DEFAULT '0' NOT NULL CHECK (ban_userid >= 0),
+	ban_ip varchar(40) DEFAULT '' NOT NULL,
+	ban_email varchar(100) DEFAULT '' NOT NULL,
+	ban_start integer DEFAULT '0' NOT NULL CHECK (ban_start >= 0),
+	ban_end integer DEFAULT '0' NOT NULL CHECK (ban_end >= 0),
+	ban_exclude smallint DEFAULT '0' NOT NULL CHECK (ban_exclude >= 0),
+	ban_reason varchar(255) DEFAULT '' NOT NULL,
+	ban_give_reason varchar(255) DEFAULT '' NOT NULL,
+	PRIMARY KEY (ban_id)
+);
+
+/*
+	Table: 'phpbb_bbcodes'
+*/
+CREATE TABLE phpbb_bbcodes (
+	bbcode_id smallint DEFAULT '0' NOT NULL,
+	bbcode_tag varchar(16) DEFAULT '' NOT NULL,
+	bbcode_helpline varchar(255) DEFAULT '' NOT NULL,
+	display_on_posting smallint DEFAULT '0' NOT NULL CHECK (display_on_posting >= 0),
+	bbcode_match varchar(4000) DEFAULT '' NOT NULL,
+	bbcode_tpl TEXT DEFAULT '' NOT NULL,
+	first_pass_match TEXT DEFAULT '' NOT NULL,
+	first_pass_replace TEXT DEFAULT '' NOT NULL,
+	second_pass_match TEXT DEFAULT '' NOT NULL,
+	second_pass_replace TEXT DEFAULT '' NOT NULL,
+	PRIMARY KEY (bbcode_id)
+);
+
+/*
+	Table: 'phpbb_bookmarks'
+*/
+CREATE TABLE phpbb_bookmarks (
+	topic_id integer DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	PRIMARY KEY (topic_id, user_id)
+);
+
+
+/*
+	Table: 'phpbb_bots'
+*/
+CREATE SEQUENCE "sys"."phpbb_bots_seq" AS INTEGER;
+
+CREATE TABLE phpbb_bots (
+	bot_id integer DEFAULT next value for "sys"."phpbb_bots_seq",
+	bot_active smallint DEFAULT '1' NOT NULL CHECK (bot_active >= 0),
+	bot_name varchar(255) DEFAULT '' NOT NULL,
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	bot_agent varchar(255) DEFAULT '' NOT NULL,
+	bot_ip varchar(255) DEFAULT '' NOT NULL,
+	PRIMARY KEY (bot_id)
+);
+
+/*
+	Table: 'phpbb_config'
+*/
+CREATE TABLE phpbb_config (
+	config_name varchar(255) DEFAULT '' NOT NULL,
+	config_value varchar(255) DEFAULT '' NOT NULL,
+	is_dynamic smallint DEFAULT '0' NOT NULL CHECK (is_dynamic >= 0),
+	PRIMARY KEY (config_name)
+);
+
+/*
+	Table: 'phpbb_confirm'
+*/
+CREATE TABLE phpbb_confirm (
+	confirm_id char(32) DEFAULT '' NOT NULL,
+	session_id char(32) DEFAULT '' NOT NULL,
+	confirm_type smallint DEFAULT '0' NOT NULL,
+	code varchar(8) DEFAULT '' NOT NULL,
+	seed integer DEFAULT '0' NOT NULL CHECK (seed >= 0),
+	PRIMARY KEY (session_id, confirm_id)
+);
+
+/*
+	Table: 'phpbb_disallow'
+*/
+CREATE SEQUENCE "sys"."phpbb_disallow_seq" AS INTEGER;
+
+CREATE TABLE phpbb_disallow (
+	disallow_id integer DEFAULT next value for "sys"."phpbb_disallow_seq",
+	disallow_username varchar(255) DEFAULT '' NOT NULL,
+	PRIMARY KEY (disallow_id)
+);
+
+
+/*
+	Table: 'phpbb_drafts'
+*/
+CREATE SEQUENCE "sys"."phpbb_drafts_seq" AS INTEGER;
+
+CREATE TABLE phpbb_drafts (
+	draft_id integer DEFAULT next value for "sys"."phpbb_drafts_seq",
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	topic_id integer DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+	forum_id integer DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+	save_time integer DEFAULT '0' NOT NULL CHECK (save_time >= 0),
+	draft_subject varchar(255) DEFAULT '' NOT NULL,
+	draft_message TEXT DEFAULT '' NOT NULL,
+	PRIMARY KEY (draft_id)
+);
+
+/*
+	Table: 'phpbb_extensions'
+*/
+CREATE SEQUENCE "sys"."phpbb_extensions_seq" AS INTEGER;
+
+CREATE TABLE phpbb_extensions (
+	extension_id integer DEFAULT next value for "sys"."phpbb_extensions_seq",
+	group_id integer DEFAULT '0' NOT NULL CHECK (group_id >= 0),
+	extension varchar(100) DEFAULT '' NOT NULL,
+	PRIMARY KEY (extension_id)
+);
+
+
+/*
+	Table: 'phpbb_extension_groups'
+*/
+CREATE SEQUENCE "sys"."phpbb_extension_groups_seq" AS INTEGER;
+
+CREATE TABLE phpbb_extension_groups (
+	group_id integer DEFAULT next value for "sys"."phpbb_extension_groups_seq",
+	group_name varchar(255) DEFAULT '' NOT NULL,
+	cat_id smallint DEFAULT '0' NOT NULL,
+	allow_group smallint DEFAULT '0' NOT NULL CHECK (allow_group >= 0),
+	download_mode smallint DEFAULT '1' NOT NULL CHECK (download_mode >= 0),
+	upload_icon varchar(255) DEFAULT '' NOT NULL,
+	max_filesize integer DEFAULT '0' NOT NULL CHECK (max_filesize >= 0),
+	allowed_forums varchar(8000) DEFAULT '' NOT NULL,
+	allow_in_pm smallint DEFAULT '0' NOT NULL CHECK (allow_in_pm >= 0),
+	PRIMARY KEY (group_id)
+);
+
+
+/*
+	Table: 'phpbb_forums'
+*/
+CREATE SEQUENCE "sys"."phpbb_forums_seq" AS INTEGER;
+
+CREATE TABLE phpbb_forums (
+	forum_id integer DEFAULT next value for "sys"."phpbb_forums_seq",
+	parent_id integer DEFAULT '0' NOT NULL CHECK (parent_id >= 0),
+	left_id integer DEFAULT '0' NOT NULL CHECK (left_id >= 0),
+	right_id integer DEFAULT '0' NOT NULL CHECK (right_id >= 0),
+	forum_parents TEXT DEFAULT '' NOT NULL,
+	forum_name varchar(255) DEFAULT '' NOT NULL,
+	forum_desc varchar(4000) DEFAULT '' NOT NULL,
+	forum_desc_bitfield varchar(255) DEFAULT '' NOT NULL,
+	forum_desc_options integer DEFAULT '7' NOT NULL CHECK (forum_desc_options >= 0),
+	forum_desc_uid varchar(8) DEFAULT '' NOT NULL,
+	forum_link varchar(255) DEFAULT '' NOT NULL,
+	forum_password varchar(40) DEFAULT '' NOT NULL,
+	forum_style integer DEFAULT '0' NOT NULL CHECK (forum_style >= 0),
+	forum_image varchar(255) DEFAULT '' NOT NULL,
+	forum_rules varchar(4000) DEFAULT '' NOT NULL,
+	forum_rules_link varchar(255) DEFAULT '' NOT NULL,
+	forum_rules_bitfield varchar(255) DEFAULT '' NOT NULL,
+	forum_rules_options integer DEFAULT '7' NOT NULL CHECK (forum_rules_options >= 0),
+	forum_rules_uid varchar(8) DEFAULT '' NOT NULL,
+	forum_topics_per_page smallint DEFAULT '0' NOT NULL,
+	forum_type smallint DEFAULT '0' NOT NULL,
+	forum_status smallint DEFAULT '0' NOT NULL,
+	forum_posts integer DEFAULT '0' NOT NULL CHECK (forum_posts >= 0),
+	forum_topics integer DEFAULT '0' NOT NULL CHECK (forum_topics >= 0),
+	forum_topics_real integer DEFAULT '0' NOT NULL CHECK (forum_topics_real >= 0),
+	forum_last_post_id integer DEFAULT '0' NOT NULL CHECK (forum_last_post_id >= 0),
+	forum_last_poster_id integer DEFAULT '0' NOT NULL CHECK (forum_last_poster_id >= 0),
+	forum_last_post_subject varchar(255) DEFAULT '' NOT NULL,
+	forum_last_post_time integer DEFAULT '0' NOT NULL CHECK (forum_last_post_time >= 0),
+	forum_last_poster_name varchar(255) DEFAULT '' NOT NULL,
+	forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL,
+	forum_flags smallint DEFAULT '32' NOT NULL,
+	display_subforum_list smallint DEFAULT '1' NOT NULL CHECK (display_subforum_list >= 0),
+	display_on_index smallint DEFAULT '1' NOT NULL CHECK (display_on_index >= 0),
+	enable_indexing smallint DEFAULT '1' NOT NULL CHECK (enable_indexing >= 0),
+	enable_icons smallint DEFAULT '1' NOT NULL CHECK (enable_icons >= 0),
+	enable_prune smallint DEFAULT '0' NOT NULL CHECK (enable_prune >= 0),
+	prune_next integer DEFAULT '0' NOT NULL CHECK (prune_next >= 0),
+	prune_days integer DEFAULT '0' NOT NULL CHECK (prune_days >= 0),
+	prune_viewed integer DEFAULT '0' NOT NULL CHECK (prune_viewed >= 0),
+	prune_freq integer DEFAULT '0' NOT NULL CHECK (prune_freq >= 0),
+	PRIMARY KEY (forum_id)
+);
+
+/*
+	Table: 'phpbb_forums_access'
+*/
+CREATE TABLE phpbb_forums_access (
+	forum_id integer DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	session_id char(32) DEFAULT '' NOT NULL,
+	PRIMARY KEY (forum_id, user_id, session_id)
+);
+
+
+/*
+	Table: 'phpbb_forums_track'
+*/
+CREATE TABLE phpbb_forums_track (
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	forum_id integer DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+	mark_time integer DEFAULT '0' NOT NULL CHECK (mark_time >= 0),
+	PRIMARY KEY (user_id, forum_id)
+);
+
+
+/*
+	Table: 'phpbb_forums_watch'
+*/
+CREATE TABLE phpbb_forums_watch (
+	forum_id integer DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	notify_status smallint DEFAULT '0' NOT NULL CHECK (notify_status >= 0)
+);
+
+/*
+	Table: 'phpbb_groups'
+*/
+CREATE SEQUENCE "sys"."phpbb_groups_seq" AS INTEGER;
+
+CREATE TABLE phpbb_groups (
+	group_id integer DEFAULT next value for "sys"."phpbb_groups_seq",
+	group_type smallint DEFAULT '1' NOT NULL,
+	group_founder_manage smallint DEFAULT '0' NOT NULL CHECK (group_founder_manage >= 0),
+	group_name varchar(255) DEFAULT '' NOT NULL,
+	group_desc varchar(4000) DEFAULT '' NOT NULL,
+	group_desc_bitfield varchar(255) DEFAULT '' NOT NULL,
+	group_desc_options integer DEFAULT '7' NOT NULL CHECK (group_desc_options >= 0),
+	group_desc_uid varchar(8) DEFAULT '' NOT NULL,
+	group_display smallint DEFAULT '0' NOT NULL CHECK (group_display >= 0),
+	group_avatar varchar(255) DEFAULT '' NOT NULL,
+	group_avatar_type smallint DEFAULT '0' NOT NULL,
+	group_avatar_width smallint DEFAULT '0' NOT NULL CHECK (group_avatar_width >= 0),
+	group_avatar_height smallint DEFAULT '0' NOT NULL CHECK (group_avatar_height >= 0),
+	group_rank integer DEFAULT '0' NOT NULL CHECK (group_rank >= 0),
+	group_colour varchar(6) DEFAULT '' NOT NULL,
+	group_sig_chars integer DEFAULT '0' NOT NULL CHECK (group_sig_chars >= 0),
+	group_receive_pm smallint DEFAULT '0' NOT NULL CHECK (group_receive_pm >= 0),
+	group_message_limit integer DEFAULT '0' NOT NULL CHECK (group_message_limit >= 0),
+	group_max_recipients integer DEFAULT '0' NOT NULL CHECK (group_max_recipients >= 0),
+	group_legend smallint DEFAULT '1' NOT NULL CHECK (group_legend >= 0),
+	PRIMARY KEY (group_id)
+);
+
+/*
+	Table: 'phpbb_icons'
+*/
+CREATE SEQUENCE "sys"."phpbb_icons_seq" AS INTEGER;
+
+CREATE TABLE phpbb_icons (
+	icons_id integer DEFAULT next value for "sys"."phpbb_icons_seq",
+	icons_url varchar(255) DEFAULT '' NOT NULL,
+	icons_width smallint DEFAULT '0' NOT NULL,
+	icons_height smallint DEFAULT '0' NOT NULL,
+	icons_order integer DEFAULT '0' NOT NULL CHECK (icons_order >= 0),
+	display_on_posting smallint DEFAULT '1' NOT NULL CHECK (display_on_posting >= 0),
+	PRIMARY KEY (icons_id)
+);
+
+/*
+	Table: 'phpbb_lang'
+*/
+CREATE SEQUENCE "sys"."phpbb_lang_seq" AS INTEGER;
+
+CREATE TABLE phpbb_lang (
+	lang_id smallint DEFAULT next value for "sys"."phpbb_lang_seq",
+	lang_iso varchar(30) DEFAULT '' NOT NULL,
+	lang_dir varchar(30) DEFAULT '' NOT NULL,
+	lang_english_name varchar(100) DEFAULT '' NOT NULL,
+	lang_local_name varchar(255) DEFAULT '' NOT NULL,
+	lang_author varchar(255) DEFAULT '' NOT NULL,
+	PRIMARY KEY (lang_id)
+);
+
+/*
+	Table: 'phpbb_log'
+*/
+CREATE SEQUENCE "sys"."phpbb_log_seq" AS INTEGER;
+
+CREATE TABLE phpbb_log (
+	log_id integer DEFAULT next value for "sys"."phpbb_log_seq",
+	log_type smallint DEFAULT '0' NOT NULL,
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	forum_id integer DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+	topic_id integer DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+	reportee_id integer DEFAULT '0' NOT NULL CHECK (reportee_id >= 0),
+	log_ip varchar(40) DEFAULT '' NOT NULL,
+	log_time integer DEFAULT '0' NOT NULL CHECK (log_time >= 0),
+	log_operation varchar(4000) DEFAULT '' NOT NULL,
+	log_data TEXT DEFAULT '' NOT NULL,
+	PRIMARY KEY (log_id)
+);
+
+/*
+	Table: 'phpbb_moderator_cache'
+*/
+CREATE TABLE phpbb_moderator_cache (
+	forum_id integer DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	username varchar(255) DEFAULT '' NOT NULL,
+	group_id integer DEFAULT '0' NOT NULL CHECK (group_id >= 0),
+	group_name varchar(255) DEFAULT '' NOT NULL,
+	display_on_index smallint DEFAULT '1' NOT NULL CHECK (display_on_index >= 0)
+);
+
+/*
+	Table: 'phpbb_modules'
+*/
+CREATE SEQUENCE "sys"."phpbb_modules_seq" AS INTEGER;
+
+CREATE TABLE phpbb_modules (
+	module_id integer DEFAULT next value for "sys"."phpbb_modules_seq",
+	module_enabled smallint DEFAULT '1' NOT NULL CHECK (module_enabled >= 0),
+	module_display smallint DEFAULT '1' NOT NULL CHECK (module_display >= 0),
+	module_basename varchar(255) DEFAULT '' NOT NULL,
+	module_class varchar(10) DEFAULT '' NOT NULL,
+	parent_id integer DEFAULT '0' NOT NULL CHECK (parent_id >= 0),
+	left_id integer DEFAULT '0' NOT NULL CHECK (left_id >= 0),
+	right_id integer DEFAULT '0' NOT NULL CHECK (right_id >= 0),
+	module_langname varchar(255) DEFAULT '' NOT NULL,
+	module_mode varchar(255) DEFAULT '' NOT NULL,
+	module_auth varchar(255) DEFAULT '' NOT NULL,
+	PRIMARY KEY (module_id)
+);
+
+/*
+	Table: 'phpbb_poll_options'
+*/
+CREATE TABLE phpbb_poll_options (
+	poll_option_id smallint DEFAULT '0' NOT NULL,
+	topic_id integer DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+	poll_option_text varchar(4000) DEFAULT '' NOT NULL,
+	poll_option_total integer DEFAULT '0' NOT NULL CHECK (poll_option_total >= 0)
+);
+
+/*
+	Table: 'phpbb_poll_votes'
+*/
+CREATE TABLE phpbb_poll_votes (
+	topic_id integer DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+	poll_option_id smallint DEFAULT '0' NOT NULL,
+	vote_user_id integer DEFAULT '0' NOT NULL CHECK (vote_user_id >= 0),
+	vote_user_ip varchar(40) DEFAULT '' NOT NULL
+);
+
+/*
+	Table: 'phpbb_posts'
+*/
+CREATE SEQUENCE "sys"."phpbb_posts_seq" AS INTEGER;
+
+CREATE TABLE phpbb_posts (
+	post_id integer DEFAULT next value for "sys"."phpbb_posts_seq",
+	topic_id integer DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+	forum_id integer DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+	poster_id integer DEFAULT '0' NOT NULL CHECK (poster_id >= 0),
+	icon_id integer DEFAULT '0' NOT NULL CHECK (icon_id >= 0),
+	poster_ip varchar(40) DEFAULT '' NOT NULL,
+	post_time integer DEFAULT '0' NOT NULL CHECK (post_time >= 0),
+	post_approved smallint DEFAULT '1' NOT NULL CHECK (post_approved >= 0),
+	post_reported smallint DEFAULT '0' NOT NULL CHECK (post_reported >= 0),
+	enable_bbcode smallint DEFAULT '1' NOT NULL CHECK (enable_bbcode >= 0),
+	enable_smilies smallint DEFAULT '1' NOT NULL CHECK (enable_smilies >= 0),
+	enable_magic_url smallint DEFAULT '1' NOT NULL CHECK (enable_magic_url >= 0),
+	enable_sig smallint DEFAULT '1' NOT NULL CHECK (enable_sig >= 0),
+	post_username varchar(255) DEFAULT '' NOT NULL,
+	post_subject varchar(255) DEFAULT '' NOT NULL,
+	post_text TEXT DEFAULT '' NOT NULL,
+	post_checksum varchar(32) DEFAULT '' NOT NULL,
+	post_attachment smallint DEFAULT '0' NOT NULL CHECK (post_attachment >= 0),
+	bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
+	bbcode_uid varchar(8) DEFAULT '' NOT NULL,
+	post_postcount smallint DEFAULT '1' NOT NULL CHECK (post_postcount >= 0),
+	post_edit_time integer DEFAULT '0' NOT NULL CHECK (post_edit_time >= 0),
+	post_edit_reason varchar(255) DEFAULT '' NOT NULL,
+	post_edit_user integer DEFAULT '0' NOT NULL CHECK (post_edit_user >= 0),
+	post_edit_count smallint DEFAULT '0' NOT NULL CHECK (post_edit_count >= 0),
+	post_edit_locked smallint DEFAULT '0' NOT NULL CHECK (post_edit_locked >= 0),
+	PRIMARY KEY (post_id)
+);
+
+/*
+	Table: 'phpbb_privmsgs'
+*/
+CREATE SEQUENCE "sys"."phpbb_privmsgs_seq" AS INTEGER;
+
+CREATE TABLE phpbb_privmsgs (
+	msg_id integer DEFAULT next value for "sys"."phpbb_privmsgs_seq",
+	root_level integer DEFAULT '0' NOT NULL CHECK (root_level >= 0),
+	author_id integer DEFAULT '0' NOT NULL CHECK (author_id >= 0),
+	icon_id integer DEFAULT '0' NOT NULL CHECK (icon_id >= 0),
+	author_ip varchar(40) DEFAULT '' NOT NULL,
+	message_time integer DEFAULT '0' NOT NULL CHECK (message_time >= 0),
+	enable_bbcode smallint DEFAULT '1' NOT NULL CHECK (enable_bbcode >= 0),
+	enable_smilies smallint DEFAULT '1' NOT NULL CHECK (enable_smilies >= 0),
+	enable_magic_url smallint DEFAULT '1' NOT NULL CHECK (enable_magic_url >= 0),
+	enable_sig smallint DEFAULT '1' NOT NULL CHECK (enable_sig >= 0),
+	message_subject varchar(255) DEFAULT '' NOT NULL,
+	message_text TEXT DEFAULT '' NOT NULL,
+	message_edit_reason varchar(255) DEFAULT '' NOT NULL,
+	message_edit_user integer DEFAULT '0' NOT NULL CHECK (message_edit_user >= 0),
+	message_attachment smallint DEFAULT '0' NOT NULL CHECK (message_attachment >= 0),
+	bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
+	bbcode_uid varchar(8) DEFAULT '' NOT NULL,
+	message_edit_time integer DEFAULT '0' NOT NULL CHECK (message_edit_time >= 0),
+	message_edit_count smallint DEFAULT '0' NOT NULL CHECK (message_edit_count >= 0),
+	to_address varchar(4000) DEFAULT '' NOT NULL,
+	bcc_address varchar(4000) DEFAULT '' NOT NULL,
+	PRIMARY KEY (msg_id)
+);
+
+/*
+	Table: 'phpbb_privmsgs_folder'
+*/
+CREATE SEQUENCE "sys"."phpbb_privmsgs_folder_seq" AS INTEGER;
+
+CREATE TABLE phpbb_privmsgs_folder (
+	folder_id integer DEFAULT next value for "sys"."phpbb_privmsgs_folder_seq",
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	folder_name varchar(255) DEFAULT '' NOT NULL,
+	pm_count integer DEFAULT '0' NOT NULL CHECK (pm_count >= 0),
+	PRIMARY KEY (folder_id)
+);
+
+/*
+	Table: 'phpbb_privmsgs_rules'
+*/
+CREATE SEQUENCE "sys"."phpbb_privmsgs_rules_seq" AS INTEGER;
+
+CREATE TABLE phpbb_privmsgs_rules (
+	rule_id integer DEFAULT next value for "sys"."phpbb_privmsgs_rules_seq",
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	rule_check integer DEFAULT '0' NOT NULL CHECK (rule_check >= 0),
+	rule_connection integer DEFAULT '0' NOT NULL CHECK (rule_connection >= 0),
+	rule_string varchar(255) DEFAULT '' NOT NULL,
+	rule_user_id integer DEFAULT '0' NOT NULL CHECK (rule_user_id >= 0),
+	rule_group_id integer DEFAULT '0' NOT NULL CHECK (rule_group_id >= 0),
+	rule_action integer DEFAULT '0' NOT NULL CHECK (rule_action >= 0),
+	rule_folder_id integer DEFAULT '0' NOT NULL,
+	PRIMARY KEY (rule_id)
+);
+
+/*
+	Table: 'phpbb_privmsgs_to'
+*/
+CREATE TABLE phpbb_privmsgs_to (
+	msg_id integer DEFAULT '0' NOT NULL CHECK (msg_id >= 0),
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	author_id integer DEFAULT '0' NOT NULL CHECK (author_id >= 0),
+	pm_deleted smallint DEFAULT '0' NOT NULL CHECK (pm_deleted >= 0),
+	pm_new smallint DEFAULT '1' NOT NULL CHECK (pm_new >= 0),
+	pm_unread smallint DEFAULT '1' NOT NULL CHECK (pm_unread >= 0),
+	pm_replied smallint DEFAULT '0' NOT NULL CHECK (pm_replied >= 0),
+	pm_marked smallint DEFAULT '0' NOT NULL CHECK (pm_marked >= 0),
+	pm_forwarded smallint DEFAULT '0' NOT NULL CHECK (pm_forwarded >= 0),
+	folder_id integer DEFAULT '0' NOT NULL
+);
+
+/*
+	Table: 'phpbb_profile_fields'
+*/
+CREATE SEQUENCE "sys"."phpbb_profile_fields_seq" AS INTEGER;
+
+CREATE TABLE phpbb_profile_fields (
+	field_id integer DEFAULT next value for "sys"."phpbb_profile_fields_seq",
+	field_name varchar(255) DEFAULT '' NOT NULL,
+	field_type smallint DEFAULT '0' NOT NULL,
+	field_ident varchar(20) DEFAULT '' NOT NULL,
+	field_length varchar(20) DEFAULT '' NOT NULL,
+	field_minlen varchar(255) DEFAULT '' NOT NULL,
+	field_maxlen varchar(255) DEFAULT '' NOT NULL,
+	field_novalue varchar(255) DEFAULT '' NOT NULL,
+	field_default_value varchar(255) DEFAULT '' NOT NULL,
+	field_validation varchar(20) DEFAULT '' NOT NULL,
+	field_required smallint DEFAULT '0' NOT NULL CHECK (field_required >= 0),
+	field_show_on_reg smallint DEFAULT '0' NOT NULL CHECK (field_show_on_reg >= 0),
+	field_show_profile smallint DEFAULT '0' NOT NULL CHECK (field_show_profile >= 0),
+	field_hide smallint DEFAULT '0' NOT NULL CHECK (field_hide >= 0),
+	field_no_view smallint DEFAULT '0' NOT NULL CHECK (field_no_view >= 0),
+	field_active smallint DEFAULT '0' NOT NULL CHECK (field_active >= 0),
+	field_order integer DEFAULT '0' NOT NULL CHECK (field_order >= 0),
+	PRIMARY KEY (field_id)
+);
+
+/*
+	Table: 'phpbb_profile_fields_data'
+*/
+CREATE TABLE phpbb_profile_fields_data (
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	PRIMARY KEY (user_id)
+);
+
+
+/*
+	Table: 'phpbb_profile_fields_lang'
+*/
+CREATE TABLE phpbb_profile_fields_lang (
+	field_id integer DEFAULT '0' NOT NULL CHECK (field_id >= 0),
+	lang_id integer DEFAULT '0' NOT NULL CHECK (lang_id >= 0),
+	option_id integer DEFAULT '0' NOT NULL CHECK (option_id >= 0),
+	field_type smallint DEFAULT '0' NOT NULL,
+	lang_value varchar(255) DEFAULT '' NOT NULL,
+	PRIMARY KEY (field_id, lang_id, option_id)
+);
+
+
+/*
+	Table: 'phpbb_profile_lang'
+*/
+CREATE TABLE phpbb_profile_lang (
+	field_id integer DEFAULT '0' NOT NULL CHECK (field_id >= 0),
+	lang_id integer DEFAULT '0' NOT NULL CHECK (lang_id >= 0),
+	lang_name varchar(255) DEFAULT '' NOT NULL,
+	lang_explain varchar(4000) DEFAULT '' NOT NULL,
+	lang_default_value varchar(255) DEFAULT '' NOT NULL,
+	PRIMARY KEY (field_id, lang_id)
+);
+
+
+/*
+	Table: 'phpbb_ranks'
+*/
+CREATE SEQUENCE "sys"."phpbb_ranks_seq" AS INTEGER;
+
+CREATE TABLE phpbb_ranks (
+	rank_id integer DEFAULT next value for "sys"."phpbb_ranks_seq",
+	rank_title varchar(255) DEFAULT '' NOT NULL,
+	rank_min integer DEFAULT '0' NOT NULL CHECK (rank_min >= 0),
+	rank_special smallint DEFAULT '0' NOT NULL CHECK (rank_special >= 0),
+	rank_image varchar(255) DEFAULT '' NOT NULL,
+	PRIMARY KEY (rank_id)
+);
+
+
+/*
+	Table: 'phpbb_reports'
+*/
+CREATE SEQUENCE "sys"."phpbb_reports_seq" AS INTEGER;
+
+CREATE TABLE phpbb_reports (
+	report_id integer DEFAULT next value for "sys"."phpbb_reports_seq",
+	reason_id smallint DEFAULT '0' NOT NULL CHECK (reason_id >= 0),
+	post_id integer DEFAULT '0' NOT NULL CHECK (post_id >= 0),
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	user_notify smallint DEFAULT '0' NOT NULL CHECK (user_notify >= 0),
+	report_closed smallint DEFAULT '0' NOT NULL CHECK (report_closed >= 0),
+	report_time integer DEFAULT '0' NOT NULL CHECK (report_time >= 0),
+	report_text TEXT DEFAULT '' NOT NULL,
+	PRIMARY KEY (report_id)
+);
+
+
+/*
+	Table: 'phpbb_reports_reasons'
+*/
+CREATE SEQUENCE "sys"."phpbb_reports_reasons_seq" AS INTEGER;
+
+CREATE TABLE phpbb_reports_reasons (
+	reason_id smallint DEFAULT next value for "sys"."phpbb_reports_reasons_seq",
+	reason_title varchar(255) DEFAULT '' NOT NULL,
+	reason_description TEXT DEFAULT '' NOT NULL,
+	reason_order smallint DEFAULT '0' NOT NULL CHECK (reason_order >= 0),
+	PRIMARY KEY (reason_id)
+);
+
+
+/*
+	Table: 'phpbb_search_results'
+*/
+CREATE TABLE phpbb_search_results (
+	search_key varchar(32) DEFAULT '' NOT NULL,
+	search_time integer DEFAULT '0' NOT NULL CHECK (search_time >= 0),
+	search_keywords TEXT DEFAULT '' NOT NULL,
+	search_authors TEXT DEFAULT '' NOT NULL,
+	PRIMARY KEY (search_key)
+);
+
+
+/*
+	Table: 'phpbb_search_wordlist'
+*/
+CREATE SEQUENCE "sys"."phpbb_search_wordlist_seq" AS INTEGER;
+
+CREATE TABLE phpbb_search_wordlist (
+	word_id integer DEFAULT next value for "sys"."phpbb_search_wordlist_seq",
+	word_text varchar(255) DEFAULT '' NOT NULL,
+	word_common smallint DEFAULT '0' NOT NULL CHECK (word_common >= 0),
+	word_count integer DEFAULT '0' NOT NULL CHECK (word_count >= 0),
+	PRIMARY KEY (word_id),
+	UNIQUE(word_text)
+);
+
+/*
+	Table: 'phpbb_search_wordmatch'
+*/
+CREATE TABLE phpbb_search_wordmatch (
+	post_id integer DEFAULT '0' NOT NULL CHECK (post_id >= 0),
+	word_id integer DEFAULT '0' NOT NULL CHECK (word_id >= 0),
+	title_match smallint DEFAULT '0' NOT NULL CHECK (title_match >= 0),
+	UNIQUE (word_id, post_id, title_match)
+);
+
+/*
+	Table: 'phpbb_sessions'
+*/
+CREATE TABLE phpbb_sessions (
+	session_id char(32) DEFAULT '' NOT NULL,
+	session_user_id integer DEFAULT '0' NOT NULL CHECK (session_user_id >= 0),
+	session_forum_id integer DEFAULT '0' NOT NULL CHECK (session_forum_id >= 0),
+	session_last_visit integer DEFAULT '0' NOT NULL CHECK (session_last_visit >= 0),
+	session_start integer DEFAULT '0' NOT NULL CHECK (session_start >= 0),
+	session_time integer DEFAULT '0' NOT NULL CHECK (session_time >= 0),
+	session_ip varchar(40) DEFAULT '' NOT NULL,
+	session_browser varchar(150) DEFAULT '' NOT NULL,
+	session_forwarded_for varchar(255) DEFAULT '' NOT NULL,
+	session_page varchar(255) DEFAULT '' NOT NULL,
+	session_viewonline smallint DEFAULT '1' NOT NULL CHECK (session_viewonline >= 0),
+	session_autologin smallint DEFAULT '0' NOT NULL CHECK (session_autologin >= 0),
+	session_admin smallint DEFAULT '0' NOT NULL CHECK (session_admin >= 0),
+	PRIMARY KEY (session_id)
+);
+
+/*
+	Table: 'phpbb_sessions_keys'
+*/
+CREATE TABLE phpbb_sessions_keys (
+	key_id char(32) DEFAULT '' NOT NULL,
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	last_ip varchar(40) DEFAULT '' NOT NULL,
+	last_login integer DEFAULT '0' NOT NULL CHECK (last_login >= 0),
+	PRIMARY KEY (key_id, user_id)
+);
+
+/*
+	Table: 'phpbb_sitelist'
+*/
+CREATE SEQUENCE "sys"."phpbb_sitelist_seq" AS INTEGER;
+
+CREATE TABLE phpbb_sitelist (
+	site_id integer DEFAULT next value for "sys"."phpbb_sitelist_seq",
+	site_ip varchar(40) DEFAULT '' NOT NULL,
+	site_hostname varchar(255) DEFAULT '' NOT NULL,
+	ip_exclude smallint DEFAULT '0' NOT NULL CHECK (ip_exclude >= 0),
+	PRIMARY KEY (site_id)
+);
+
+
+/*
+	Table: 'phpbb_smilies'
+*/
+CREATE SEQUENCE "sys"."phpbb_smilies_seq" AS INTEGER;
+
+CREATE TABLE phpbb_smilies (
+	smiley_id integer DEFAULT next value for "sys"."phpbb_smilies_seq",
+	code varchar(50) DEFAULT '' NOT NULL,
+	emotion varchar(50) DEFAULT '' NOT NULL,
+	smiley_url varchar(50) DEFAULT '' NOT NULL,
+	smiley_width smallint DEFAULT '0' NOT NULL CHECK (smiley_width >= 0),
+	smiley_height smallint DEFAULT '0' NOT NULL CHECK (smiley_height >= 0),
+	smiley_order integer DEFAULT '0' NOT NULL CHECK (smiley_order >= 0),
+	display_on_posting smallint DEFAULT '1' NOT NULL CHECK (display_on_posting >= 0),
+	PRIMARY KEY (smiley_id)
+);
+
+/*
+	Table: 'phpbb_styles'
+*/
+CREATE SEQUENCE "sys"."phpbb_styles_seq" AS INTEGER;
+
+CREATE TABLE phpbb_styles (
+	style_id integer DEFAULT next value for "sys"."phpbb_styles_seq",
+	style_name varchar(255) DEFAULT '' NOT NULL,
+	style_copyright varchar(255) DEFAULT '' NOT NULL,
+	style_active smallint DEFAULT '1' NOT NULL CHECK (style_active >= 0),
+	template_id integer DEFAULT '0' NOT NULL CHECK (template_id >= 0),
+	theme_id integer DEFAULT '0' NOT NULL CHECK (theme_id >= 0),
+	imageset_id integer DEFAULT '0' NOT NULL CHECK (imageset_id >= 0),
+	PRIMARY KEY (style_id),
+	UNIQUE (style_name)
+);
+
+/*
+	Table: 'phpbb_styles_template'
+*/
+CREATE SEQUENCE "sys"."phpbb_styles_template_seq" AS INTEGER;
+
+CREATE TABLE phpbb_styles_template (
+	template_id integer DEFAULT next value for "sys"."phpbb_styles_template_seq",
+	template_name varchar(255) DEFAULT '' NOT NULL,
+	template_copyright varchar(255) DEFAULT '' NOT NULL,
+	template_path varchar(100) DEFAULT '' NOT NULL,
+	bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL,
+	template_storedb smallint DEFAULT '0' NOT NULL CHECK (template_storedb >= 0),
+	template_inherits_id integer DEFAULT '0' NOT NULL CHECK (template_inherits_id >= 0),
+	template_inherit_path varchar(255) DEFAULT '' NOT NULL,
+	PRIMARY KEY (template_id),
+	UNIQUE (template_name)
+);
+
+/*
+	Table: 'phpbb_styles_template_data'
+*/
+CREATE TABLE phpbb_styles_template_data (
+	template_id integer DEFAULT '0' NOT NULL CHECK (template_id >= 0),
+	template_filename varchar(100) DEFAULT '' NOT NULL,
+	template_included varchar(8000) DEFAULT '' NOT NULL,
+	template_mtime integer DEFAULT '0' NOT NULL CHECK (template_mtime >= 0),
+	template_data TEXT DEFAULT '' NOT NULL
+);
+
+/*
+	Table: 'phpbb_styles_theme'
+*/
+CREATE SEQUENCE "sys"."phpbb_styles_theme_seq" AS INTEGER;
+
+CREATE TABLE phpbb_styles_theme (
+	theme_id integer DEFAULT next value for "sys"."phpbb_styles_theme_seq",
+	theme_name varchar(255) DEFAULT '' NOT NULL,
+	theme_copyright varchar(255) DEFAULT '' NOT NULL,
+	theme_path varchar(100) DEFAULT '' NOT NULL,
+	theme_storedb smallint DEFAULT '0' NOT NULL CHECK (theme_storedb >= 0),
+	theme_mtime integer DEFAULT '0' NOT NULL CHECK (theme_mtime >= 0),
+	theme_data TEXT DEFAULT '' NOT NULL,
+	PRIMARY KEY (theme_id),
+	UNIQUE (theme_name)
+);
+
+/*
+	Table: 'phpbb_styles_imageset'
+*/
+CREATE SEQUENCE "sys"."phpbb_styles_imageset_seq" AS INTEGER;
+
+CREATE TABLE phpbb_styles_imageset (
+	imageset_id integer DEFAULT next value for "sys"."phpbb_styles_imageset_seq",
+	imageset_name varchar(255) DEFAULT '' NOT NULL,
+	imageset_copyright varchar(255) DEFAULT '' NOT NULL,
+	imageset_path varchar(100) DEFAULT '' NOT NULL,
+	PRIMARY KEY (imageset_id),
+	UNIQUE (imageset_name)
+);
+
+/*
+	Table: 'phpbb_styles_imageset_data'
+*/
+CREATE SEQUENCE "sys"."phpbb_styles_imageset_data_seq" AS INTEGER;
+
+CREATE TABLE phpbb_styles_imageset_data (
+	image_id integer DEFAULT next value for "sys"."phpbb_styles_imageset_data_seq",
+	image_name varchar(200) DEFAULT '' NOT NULL,
+	image_filename varchar(200) DEFAULT '' NOT NULL,
+	image_lang varchar(30) DEFAULT '' NOT NULL,
+	image_height smallint DEFAULT '0' NOT NULL CHECK (image_height >= 0),
+	image_width smallint DEFAULT '0' NOT NULL CHECK (image_width >= 0),
+	imageset_id integer DEFAULT '0' NOT NULL CHECK (imageset_id >= 0),
+	PRIMARY KEY (image_id)
+);
+
+/*
+	Table: 'phpbb_topics'
+*/
+CREATE SEQUENCE "sys"."phpbb_topics_seq" AS INTEGER;
+
+CREATE TABLE phpbb_topics (
+	topic_id integer DEFAULT next value for "sys"."phpbb_topics_seq",
+	forum_id integer DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+	icon_id integer DEFAULT '0' NOT NULL CHECK (icon_id >= 0),
+	topic_attachment smallint DEFAULT '0' NOT NULL CHECK (topic_attachment >= 0),
+	topic_approved smallint DEFAULT '1' NOT NULL CHECK (topic_approved >= 0),
+	topic_reported smallint DEFAULT '0' NOT NULL CHECK (topic_reported >= 0),
+	topic_title varchar(255) DEFAULT '' NOT NULL,
+	topic_poster integer DEFAULT '0' NOT NULL CHECK (topic_poster >= 0),
+	topic_time integer DEFAULT '0' NOT NULL CHECK (topic_time >= 0),
+	topic_time_limit integer DEFAULT '0' NOT NULL CHECK (topic_time_limit >= 0),
+	topic_views integer DEFAULT '0' NOT NULL CHECK (topic_views >= 0),
+	topic_replies integer DEFAULT '0' NOT NULL CHECK (topic_replies >= 0),
+	topic_replies_real integer DEFAULT '0' NOT NULL CHECK (topic_replies_real >= 0),
+	topic_status smallint DEFAULT '0' NOT NULL,
+	topic_type smallint DEFAULT '0' NOT NULL,
+	topic_first_post_id integer DEFAULT '0' NOT NULL CHECK (topic_first_post_id >= 0),
+	topic_first_poster_name varchar(255) DEFAULT '' NOT NULL,
+	topic_first_poster_colour varchar(6) DEFAULT '' NOT NULL,
+	topic_last_post_id integer DEFAULT '0' NOT NULL CHECK (topic_last_post_id >= 0),
+	topic_last_poster_id integer DEFAULT '0' NOT NULL CHECK (topic_last_poster_id >= 0),
+	topic_last_poster_name varchar(255) DEFAULT '' NOT NULL,
+	topic_last_poster_colour varchar(6) DEFAULT '' NOT NULL,
+	topic_last_post_subject varchar(255) DEFAULT '' NOT NULL,
+	topic_last_post_time integer DEFAULT '0' NOT NULL CHECK (topic_last_post_time >= 0),
+	topic_last_view_time integer DEFAULT '0' NOT NULL CHECK (topic_last_view_time >= 0),
+	topic_moved_id integer DEFAULT '0' NOT NULL CHECK (topic_moved_id >= 0),
+	topic_bumped smallint DEFAULT '0' NOT NULL CHECK (topic_bumped >= 0),
+	topic_bumper integer DEFAULT '0' NOT NULL CHECK (topic_bumper >= 0),
+	poll_title varchar(255) DEFAULT '' NOT NULL,
+	poll_start integer DEFAULT '0' NOT NULL CHECK (poll_start >= 0),
+	poll_length integer DEFAULT '0' NOT NULL CHECK (poll_length >= 0),
+	poll_max_options smallint DEFAULT '1' NOT NULL,
+	poll_last_vote integer DEFAULT '0' NOT NULL CHECK (poll_last_vote >= 0),
+	poll_vote_change smallint DEFAULT '0' NOT NULL CHECK (poll_vote_change >= 0),
+	PRIMARY KEY (topic_id)
+);
+
+/*
+	Table: 'phpbb_topics_track'
+*/
+CREATE TABLE phpbb_topics_track (
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	topic_id integer DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+	forum_id integer DEFAULT '0' NOT NULL CHECK (forum_id >= 0),
+	mark_time integer DEFAULT '0' NOT NULL CHECK (mark_time >= 0),
+	PRIMARY KEY (user_id, topic_id)
+);
+
+/*
+	Table: 'phpbb_topics_posted'
+*/
+CREATE TABLE phpbb_topics_posted (
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	topic_id integer DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+	topic_posted smallint DEFAULT '0' NOT NULL CHECK (topic_posted >= 0),
+	PRIMARY KEY (user_id, topic_id)
+);
+
+
+/*
+	Table: 'phpbb_topics_watch'
+*/
+CREATE TABLE phpbb_topics_watch (
+	topic_id integer DEFAULT '0' NOT NULL CHECK (topic_id >= 0),
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	notify_status smallint DEFAULT '0' NOT NULL CHECK (notify_status >= 0)
+);
+
+
+/*
+	Table: 'phpbb_user_group'
+*/
+CREATE TABLE phpbb_user_group (
+	group_id integer DEFAULT '0' NOT NULL CHECK (group_id >= 0),
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	group_leader smallint DEFAULT '0' NOT NULL CHECK (group_leader >= 0),
+	user_pending smallint DEFAULT '1' NOT NULL CHECK (user_pending >= 0)
+);
+
+/*
+	Table: 'phpbb_users'
+*/
+CREATE SEQUENCE "sys"."phpbb_users_seq" AS INTEGER;
+
+CREATE TABLE phpbb_users (
+	user_id integer DEFAULT next value for "sys"."phpbb_users_seq",
+	user_type smallint DEFAULT '0' NOT NULL,
+	group_id integer DEFAULT '3' NOT NULL CHECK (group_id >= 0),
+	user_permissions TEXT DEFAULT '' NOT NULL,
+	user_perm_from integer DEFAULT '0' NOT NULL CHECK (user_perm_from >= 0),
+	user_ip varchar(40) DEFAULT '' NOT NULL,
+	user_regdate integer DEFAULT '0' NOT NULL CHECK (user_regdate >= 0),
+	username varchar(255) DEFAULT '' NOT NULL,
+	username_clean varchar(255) DEFAULT '' NOT NULL,
+	user_password varchar(40) DEFAULT '' NOT NULL,
+	user_passchg integer DEFAULT '0' NOT NULL CHECK (user_passchg >= 0),
+	user_pass_convert smallint DEFAULT '0' NOT NULL CHECK (user_pass_convert >= 0),
+	user_email varchar(100) DEFAULT '' NOT NULL,
+	user_email_hash BIGINT DEFAULT 0 NOT NULL,
+	user_birthday varchar(10) DEFAULT '' NOT NULL,
+	user_lastvisit integer DEFAULT '0' NOT NULL CHECK (user_lastvisit >= 0),
+	user_lastmark integer DEFAULT '0' NOT NULL CHECK (user_lastmark >= 0),
+	user_lastpost_time integer DEFAULT '0' NOT NULL CHECK (user_lastpost_time >= 0),
+	user_lastpage varchar(200) DEFAULT '' NOT NULL,
+	user_last_confirm_key varchar(10) DEFAULT '' NOT NULL,
+	user_last_search integer DEFAULT '0' NOT NULL CHECK (user_last_search >= 0),
+	user_warnings smallint DEFAULT '0' NOT NULL,
+	user_last_warning integer DEFAULT '0' NOT NULL CHECK (user_last_warning >= 0),
+	user_login_attempts smallint DEFAULT '0' NOT NULL,
+	user_inactive_reason smallint DEFAULT '0' NOT NULL,
+	user_inactive_time integer DEFAULT '0' NOT NULL CHECK (user_inactive_time >= 0),
+	user_posts integer DEFAULT '0' NOT NULL CHECK (user_posts >= 0),
+	user_lang varchar(30) DEFAULT '' NOT NULL,
+	user_timezone decimal(5,2) DEFAULT '0.0' NOT NULL,
+	user_dst smallint DEFAULT '0' NOT NULL CHECK (user_dst >= 0),
+	user_dateformat varchar(30) DEFAULT 'd M Y H:i' NOT NULL,
+	user_style integer DEFAULT '0' NOT NULL CHECK (user_style >= 0),
+	user_rank integer DEFAULT '0' NOT NULL CHECK (user_rank >= 0),
+	user_colour varchar(6) DEFAULT '' NOT NULL,
+	user_new_privmsg integer DEFAULT '0' NOT NULL,
+	user_unread_privmsg integer DEFAULT '0' NOT NULL,
+	user_last_privmsg integer DEFAULT '0' NOT NULL CHECK (user_last_privmsg >= 0),
+	user_message_rules smallint DEFAULT '0' NOT NULL CHECK (user_message_rules >= 0),
+	user_full_folder integer DEFAULT '-3' NOT NULL,
+	user_emailtime integer DEFAULT '0' NOT NULL CHECK (user_emailtime >= 0),
+	user_topic_show_days smallint DEFAULT '0' NOT NULL CHECK (user_topic_show_days >= 0),
+	user_topic_sortby_type varchar(1) DEFAULT 't' NOT NULL,
+	user_topic_sortby_dir varchar(1) DEFAULT 'd' NOT NULL,
+	user_post_show_days smallint DEFAULT '0' NOT NULL CHECK (user_post_show_days >= 0),
+	user_post_sortby_type varchar(1) DEFAULT 't' NOT NULL,
+	user_post_sortby_dir varchar(1) DEFAULT 'a' NOT NULL,
+	user_notify smallint DEFAULT '0' NOT NULL CHECK (user_notify >= 0),
+	user_notify_pm smallint DEFAULT '1' NOT NULL CHECK (user_notify_pm >= 0),
+	user_notify_type smallint DEFAULT '0' NOT NULL,
+	user_allow_pm smallint DEFAULT '1' NOT NULL CHECK (user_allow_pm >= 0),
+	user_allow_viewonline smallint DEFAULT '1' NOT NULL CHECK (user_allow_viewonline >= 0),
+	user_allow_viewemail smallint DEFAULT '1' NOT NULL CHECK (user_allow_viewemail >= 0),
+	user_allow_massemail smallint DEFAULT '1' NOT NULL CHECK (user_allow_massemail >= 0),
+	user_options integer DEFAULT '895' NOT NULL CHECK (user_options >= 0),
+	user_avatar varchar(255) DEFAULT '' NOT NULL,
+	user_avatar_type smallint DEFAULT '0' NOT NULL,
+	user_avatar_width smallint DEFAULT '0' NOT NULL CHECK (user_avatar_width >= 0),
+	user_avatar_height smallint DEFAULT '0' NOT NULL CHECK (user_avatar_height >= 0),
+	user_sig TEXT DEFAULT '' NOT NULL,
+	user_sig_bbcode_uid varchar(8) DEFAULT '' NOT NULL,
+	user_sig_bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
+	user_from varchar(100) DEFAULT '' NOT NULL,
+	user_icq varchar(15) DEFAULT '' NOT NULL,
+	user_aim varchar(255) DEFAULT '' NOT NULL,
+	user_yim varchar(255) DEFAULT '' NOT NULL,
+	user_msnm varchar(255) DEFAULT '' NOT NULL,
+	user_jabber varchar(255) DEFAULT '' NOT NULL,
+	user_website varchar(200) DEFAULT '' NOT NULL,
+	user_occ varchar(4000) DEFAULT '' NOT NULL,
+	user_interests varchar(4000) DEFAULT '' NOT NULL,
+	user_actkey varchar(32) DEFAULT '' NOT NULL,
+	user_newpasswd varchar(40) DEFAULT '' NOT NULL,
+	user_form_salt varchar(32) DEFAULT '' NOT NULL,
+	PRIMARY KEY (user_id),
+	UNIQUE (username_clean)
+);
+
+/*
+	Table: 'phpbb_warnings'
+*/
+CREATE SEQUENCE "sys"."phpbb_warnings_seq" AS INTEGER;
+
+CREATE TABLE phpbb_warnings (
+	warning_id integer DEFAULT next value for "sys"."phpbb_warnings_seq",
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	post_id integer DEFAULT '0' NOT NULL CHECK (post_id >= 0),
+	log_id integer DEFAULT '0' NOT NULL CHECK (log_id >= 0),
+	warning_time integer DEFAULT '0' NOT NULL CHECK (warning_time >= 0),
+	PRIMARY KEY (warning_id)
+);
+
+
+/*
+	Table: 'phpbb_words'
+*/
+CREATE SEQUENCE "sys"."phpbb_words_seq" AS INTEGER;
+
+CREATE TABLE phpbb_words (
+	word_id integer DEFAULT next value for "sys"."phpbb_words_seq",
+	word varchar(255) DEFAULT '' NOT NULL,
+	replacement varchar(255) DEFAULT '' NOT NULL,
+	PRIMARY KEY (word_id)
+);
+
+
+/*
+	Table: 'phpbb_zebra'
+*/
+CREATE TABLE phpbb_zebra (
+	user_id integer DEFAULT '0' NOT NULL CHECK (user_id >= 0),
+	zebra_id integer DEFAULT '0' NOT NULL CHECK (zebra_id >= 0),
+	friend smallint DEFAULT '0' NOT NULL CHECK (friend >= 0),
+	foe smallint DEFAULT '0' NOT NULL CHECK (foe >= 0),
+	PRIMARY KEY (user_id, zebra_id)
+);
+
+
+
+COMMIT;
Index: install/convertors/functions_phpbb20.php
===================================================================
--- install/convertors/functions_phpbb20.php	(revision 9326)
+++ install/convertors/functions_phpbb20.php	(working copy)
@@ -1728,7 +1728,12 @@
 		case 'mssql_odbc':
 			$map_dbms = 'mssql';
 		break;
-	
+		
+		case 'monetdb':
+		case 'monetdb_odbc':
+			$map_dbms = 'monetdb';
+		break;
+
 		default:
 			$map_dbms = $db->sql_layer;
 		break;
@@ -1863,4 +1868,4 @@
 	$db->sql_query($drop_sql);
 }
 
-?>
\ No newline at end of file
+?>
Index: install/database_update.php
===================================================================
--- install/database_update.php	(revision 9326)
+++ install/database_update.php	(working copy)
@@ -621,6 +621,11 @@
 	case 'mssql_odbc':
 		$map_dbms = 'mssql';
 	break;
+	
+	case 'monetdb':
+	case 'monetdb_odbc':
+		$map_dbms = 'monetdb';
+	break;
 
 	default:
 		$map_dbms = $db->sql_layer;
@@ -1561,6 +1566,7 @@
 							// last version, firebird, oracle, postgresql and sqlite all got bad index names
 							// we got kinda lucky, tho: they all support the same syntax
 							case 'firebird':
+							case 'monetdb':
 							case 'oracle':
 							case 'postgres':
 							case 'sqlite':
