create table chatterbox (
	id		int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
	login		varchar(40) NOT NULL,
	password	varchar(40) NOT NULL,
	email		varchar(40) NOT NULL,
	numlines	int UNSIGNED NOT NULL DEFAULT 10,
	name		varchar(60) NOT NULL DEFAULT 'Anonymous',
	options		text NOT NULL DEFAULT '',
	profile		text,
	contents	text NOT NULL DEFAULT '',
	updated 	datetime,
	warned		date,
	created		date
	);

create table cbupgrade (
	oldlogin	varchar(40) NOT NULL,
	newlogin	varchar(40) NOT NULL,
	upgraded	datetime
	);

create table cbhistory (
	id              int UNSIGNED NOT NULL PRIMARY KEY,
	history		text
	);

create table cbtrouble (
	id              int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
	login		varchar(40) NOT NULL,
	email           varchar(40) NOT NULL,
	url		varchar(100) NOT NULL,
	problem		text,
	submitted	datetime,
	validation	varchar(10) NOT NULL,
	status		int default 0
	);

create table cbthanks (
	id 		int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
	name		varchar(100),
	url		varchar(100), 
	contrib		varchar(100),
	contriburl	varchar(100),
	date		date
	);

create table cbserver (
	id              int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
	name		varchar(100),
	hostname	varchar(100),
	description	varchar(255),
	numtotal	int unsigned default 0,
	numactive	int unsigned default 0,
	numwarned	int unsigned default 0
	);

create table cbindex (
	id		int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
	login		varchar(40) UNIQUE NOT NULL,
	password	varchar(40) NOT NULL,
	email		varchar(40) NOT NULL,
	server		int UNSIGNED NOT NULL
	);
 
