
users:
+-------------+------------------+------+-----+---------------------+----------------+
| Field       | Type             | Null | Key | Default             | Extra          |
+-------------+------------------+------+-----+---------------------+----------------+
| user_id     | int(10) unsigned | NO   | PRI | NULL                | auto_increment |
| username    | varchar(128)     | NO   | MUL | NULL                |                |
| mail_host   | varchar(128)     | NO   |     | NULL                |                |
| created     | datetime         | NO   |     | 1000-01-01 00:00:00 |                |
| last_login  | datetime         | YES  |     | NULL                |                |
| language    | varchar(5)       | YES  |     | NULL                |                |
| preferences | longtext         | YES  |     | NULL                |                |
+-------------+------------------+------+-----+---------------------+----------------+

mysql> describe contacts;
+------------+------------------+------+-----+---------------------+----------------+
| Field      | Type             | Null | Key | Default             | Extra          |
+------------+------------------+------+-----+---------------------+----------------+
| contact_id | int(10) unsigned | NO   | PRI | NULL                | auto_increment |
| changed    | datetime         | NO   |     | 1000-01-01 00:00:00 |                |
| del        | tinyint(1)       | NO   |     | 0                   |                |
| name       | varchar(128)     | NO   |     |                     |                |
| email      | text             | NO   |     | NULL                |                |
| firstname  | varchar(128)     | NO   |     |                     |                |
| surname    | varchar(128)     | NO   |     |                     |                |
| vcard      | longtext         | YES  |     | NULL                |                |
| words      | text             | YES  |     | NULL                |                |
| user_id    | int(10) unsigned | NO   | MUL | NULL                |                |
+------------+------------------+------+-----+---------------------+----------------+

TODO: support also automatic_addressbook plugin which creates a new table:

CREATE TABLE `collected_contacts` (
 `contact_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
 `del` tinyint(1) NOT NULL DEFAULT '0',
 `name` varchar(128) NOT NULL DEFAULT '',
 `email` text NOT NULL,
 `firstname` varchar(128) NOT NULL DEFAULT '',
 `surname` varchar(128) NOT NULL DEFAULT '',
 `vcard` longtext NULL,
 `words` text NULL,
 `user_id` int(10) UNSIGNED NOT NULL,
 PRIMARY KEY(`contact_id`),
 CONSTRAINT `user_id_fk_collected_contacts` FOREIGN KEY (`user_id`)
   REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
 INDEX `user_collected_contacts_index` (`user_id`,`del`)
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
