diff --git a/README.md b/README.md index 359aa90..fb513c0 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,50 @@ Included Files: 2) funct.py -> main bbs functions 3) head.seq -> a sequence (random chars) file generated with http://petscii.krissz.hu/ this is just to have "something" to show to the user. + +## To start, first create the needed databases in MySQL with the following commands: + +CREATE DATABASE `cbmbbs` /*!40100 DEFAULT CHARACTER SET utf8 */; + +CREATE TABLE `accounts` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `username` varchar(50) NOT NULL, + `password` varchar(255) NOT NULL, + `email` varchar(100) NOT NULL, + `active` int(11) NOT NULL, + `level` int(11) NOT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `idx_accounts_username` (`username`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; + +CREATE TABLE `posts` ( + `idmessage` int(11) NOT NULL AUTO_INCREMENT, + `date` datetime DEFAULT NULL, + `subject` varchar(128) DEFAULT NULL, + `userid` int(11) DEFAULT NULL, + `idboard` int(11) DEFAULT NULL, + `body` blob DEFAULT NULL, + `status` int(11) DEFAULT NULL, + `idreply` int(11) DEFAULT NULL, + PRIMARY KEY (`idmessage`), + KEY `idx_boardmessages_userid` (`userid`), + KEY `idx_boardmessages_boardid` (`idboard`), + KEY `idx_boardmessages_date` (`date`), + KEY `idx_boardmessages_replyid` (`idreply`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `posts` ( + `idmessage` int(11) NOT NULL AUTO_INCREMENT, + `date` datetime DEFAULT NULL, + `subject` varchar(128) DEFAULT NULL, + `userid` int(11) DEFAULT NULL, + `idboard` int(11) DEFAULT NULL, + `body` blob DEFAULT NULL, + `status` int(11) DEFAULT NULL, + `idreply` int(11) DEFAULT NULL, + PRIMARY KEY (`idmessage`), + KEY `idx_boardmessages_userid` (`userid`), + KEY `idx_boardmessages_boardid` (`idboard`), + KEY `idx_boardmessages_date` (`date`), + KEY `idx_boardmessages_replyid` (`idreply`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8;