CREATE TABLE `posts` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ,
`author` INT UNSIGNED DEFAULT '0' NOT NULL,
`title` VARCHAR(100) DEFAULT'' NOT NULL,
`message` TEXT DEFAULT'' NOT NULL,
`date_create` DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL,
`date_edit` DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL,
`count_edit` INT UNSIGNED DEFAULT '0' NOT NULL,
`thread` INT UNSIGNED DEFAULT '0' NOT NULL,
`board` INT UNSIGNED DEFAULT '0' NOT NULL,
`flags` VARCHAR(3) DEFAULT'111' NOT NULL,
PRIMARY KEY (`id`)
);
# thread und board geben den primär
# schlüssel der entsprechenden verbindung an
CREATE TABLE `threads` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ,
`author` INT UNSIGNED DEFAULT '0' NOT NULL,
`title` VARCHAR(100) DEFAULT'' NOT NULL,
`date_create` DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL,
`date_reply` DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL,
`posts` INT UNSIGNED DEFAULT '0' NOT NULL,
`board` INT UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (`id`)
);
# hier ist es board
CREATE TABLE `boards` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ,
`title` VARCHAR(100) DEFAULT '' NOT NULL,
`description` VARCHAR(255) DEFAULT '' NOT NULL,
`count_threads` INT UNSIGNED DEFAULT '0' NOT NULL,
`count_posts` INT UNSIGNED DEFAULT '0' NOT NULL,
`change_date` DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL,
`change_author` INT UNSIGNED DEFAULT '0' NOT NULL,
`change_thread` INT UNSIGNED DEFAULT '0' NOT NULL,
`categorie` INT UNSIGNED DEFAULT '0' NOT NULL,
`ordinal` INT UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (`id`)
);
# hier categorie
CREATE TABLE `categories`
(
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ,
`title` VARCHAR(100) NOT NULL,
`ordinal` INT UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (`id`)
);