CREATE TABLE guestbook
(
	guestbook_id INTEGER NOT NULL IDENTITY (1, 1),
	profile_id VARCHAR(128) NOT NULL DEFAULT 'default',
	guestbook_ip VARCHAR(15) NOT NULL,
	guestbook_name VARCHAR(128) NOT NULL,
	guestbook_message TEXT NOT NULL,
	guestbook_mail VARCHAR(255) NULL,
	guestbook_homepage TEXT NULL,
	guestbook_hometown VARCHAR(100) NULL,
	guestbook_messenger VARCHAR(255) NULL,
	guestbook_msgtyp VARCHAR(5) NULL,
	guestbook_opinion INTEGER NULL,
	guestbook_date INTEGER NOT NULL DEFAULT 0,
	guestbook_comment TEXT NULL,
	guestbook_is_registered TINYINT NOT NULL
);
ALTER TABLE guestbook ADD CONSTRAINT pkguestbook
	PRIMARY KEY (guestbook_id);

CREATE NONCLUSTERED INDEX guestbook_comment ON guestbook (guestbook_comment);
CREATE NONCLUSTERED INDEX guestbook_message ON guestbook (guestbook_message);