 # Table structure for table `spiders`
 #
 
-CREATE TABLE {$db_prefix}spiders (
-  id_spider smallint(5) unsigned NOT NULL auto_increment,
-  spider_name varchar(255) NOT NULL default '',
-  user_agent varchar(255) NOT NULL default '',
-  ip_info varchar(255) NOT NULL default '',
-  PRIMARY KEY id_spider(id_spider)
-) ENGINE=MyISAM;
+$db_table->db_create_table('{db_prefix}spiders',
+	array(
+		array('name' => 'id_spider',   'type' => 'smallint', 'size' => 5, 'unsigned' => true, 'auto' => true),
+		array('name' => 'spider_name', 'type' => 'varchar', 'size' => 255, 'default' => ''),
+		array('name' => 'user_agent',  'type' => 'varchar', 'size' => 255, 'default' => ''),
+		array('name' => 'ip_info',     'type' => 'varchar', 'size' => 255, 'default' => ''),
+	),
+	array(
+		array('name' => 'id_spider', 'columns' => array('id_spider'), 'type' => 'primary'),
+	)
+);
 
 #
 # Dumping data for table `spiders`

# Table structure for table `permission_profiles`
#

CREATE TABLE {$db_prefix}permission_profiles (
  id_profile smallint(5) NOT NULL auto_increment,
  profile_name varchar(255) NOT NULL default '',
  PRIMARY KEY (id_profile)
) ENGINE=MyISAM;

#
# Dumping data for table `permission_profiles`

# Table structure for table `message_likes`
#

$db_table->db_create_table('{db_prefix}message_likes',
	array(
		array('name' => 'id_member', 'type' => 'mediumint', 'size' => 8, 'unsigned' => true, 'default' => 0),
		array('name' => 'id_msg',    'type' => 'mediumint', 'size' => 8, 'unsigned' => true, 'default' => 0),
		array('name' => 'id_poster', 'type' => 'mediumint', 'size' => 8, 'unsigned' => true, 'default' => 0),
	),
	array(
		array('name' => 'id_msg',    'columns' => array('id_msg', 'id_member'), 'type' => 'primary'),
		array('name' => 'id_member', 'columns' => array('id_member'), 'type' => 'key'),
		array('name' => 'id_poster', 'columns' => array('id_poster'), 'type' => 'key'),
	)
);

#
# Table structure for table `messages`
#

$db_table->db_create_table('{db_prefix}messages',
	array(
		array('name' => 'id_msg',          'type' => 'int', 'size' => 10, 'unsigned' => true, 'auto' => true),
		array('name' => 'id_topic',        'type' => 'mediumint', 'size' => 8, 'unsigned' => true, 'default' => 0),
		array('name' => 'id_board',        'type' => 'smallint', 'size' => 5, 'unsigned' => true, 'default' => 0),
		array('name' => 'poster_time',     'type' => 'int', 'size' => 10, 'unsigned' => true, 'default' => 0),
		array('name' => 'id_member',       'type' => 'mediumint', 'size' => 8, 'unsigned' => true, 'default' => 0),
		array('name' => 'id_msg_modified', 'type' => 'int', 'size' => 10, 'unsigned' => true, 'default' => 0),
		array('name' => 'subject',         'type' => 'varchar', 'size' => 255, 'default' => ''),
		array('name' => 'poster_name',     'type' => 'varchar', 'size' => 255, 'default' => ''),
		array('name' => 'poster_email',    'type' => 'varchar', 'size' => 255, 'default' => ''),
		array('name' => 'poster_ip',       'type' => 'varchar', 'size' => 255, 'default' => ''),
		array('name' => 'smileys_enabled', 'type' => 'tinyint', 'size' => 4, 'default' => 1),
		array('name' => 'modified_time',   'type' => 'int', 'size' => 10, 'unsigned' => true, 'default' => 0),
		array('name' => 'modified_name',   'type' => 'varchar', 'size' => 255, 'default' => ''),
		array('name' => 'body',            'type' => 'text'),
		array('name' => 'icon',            'type' => 'varchar', 'size' => 16, 'default' => 'xx'),
		array('name' => 'approved',        'type' => 'tinyint', 'size' => 3, 'default' => 1),
	),
	array(
		array('name' => 'id_msg',        'columns' => array('id_msg'), 'type' => 'primary'),
		array('name' => 'topic',         'columns' => array('id_topic', 'id_msg'), 'type' => 'unique'),
		array('name' => 'id_board',      'columns' => array('id_board', 'id_msg'), 'type' => 'unique'),
		array('name' => 'id_member',     'columns' => array('id_member', 'id_msg'), 'type' => 'unique'),
		array('name' => 'approved',      'columns' => array('approved'), 'type' => 'key'),
		array('name' => 'ip_index',      'columns' => array('poster_ip(15)', 'id_topic'), 'type' => 'key'),
		array('name' => 'participation', 'columns' => array('id_member', 'id_topic'), 'type' => 'key'),
		array('name' => 'show_posts',    'columns' => array('id_member', 'id_board'), 'type' => 'key'),
		array('name' => 'id_topic',      'columns' => array('id_topic'), 'type' => 'key'),
		array('name' => 'id_member_msg', 'columns' => array('id_member', 'approved', 'id_msg'), 'type' => 'key'),
		array('name' => 'current_topic', 'columns' => array('id_topic', 'id_msg', 'id_member', 'approved'), 'type' => 'key'),
		array('name' => 'related_ip',    'columns' => array('id_member', 'poster_ip', 'id_msg'), 'type' => 'key'),
	)
);

#
# Dumping data for table `messages`
