Subversion Repositories taios

Rev

Rev 7 | Rev 14 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

DROP DATABASE Tim32;
CREATE DATABASE Tim32;

USE Tim32;

CREATE TABLE Users
(
    ID INT NOT NULL AUTO_INCREMENT,
    AccessID INT,
    Username TEXT,
    Password TEXT,
    EmailAddress TEXT,
    Name TEXT,
    ChallengeID INT,
    PRIMARY KEY(ID)
);

CREATE TABLE BlogPosts
(
    ID INT NOT NULL AUTO_INCREMENT,
    AuthorID INT,
    Title TEXT,
    Content TEXT,
    DatePosted DATETIME,
    Category TEXT,
    PRIMARY KEY(ID)
);

CREATE TABLE BlogComments
(
    ID INT NOT NULL AUTO_INCREMENT,
    ParentID INT,
    AuthorID INT,
    PostID INT,
    Title TEXT,
    Content TEXT,
    DatePosted DATETIME,
    Spam BOOLEAN,
    PRIMARY KEY(ID)
);

CREATE TABLE Projects
(
    ID INT NOT NULL AUTO_INCREMENT,
    AuthorID INT,
    Title TEXT,
    Description TEXT,
    LogoURL TEXT,
    WebsiteURL TEXT,
    LatestVersion TEXT,
    PRIMARY KEY(ID)
);

CREATE TABLE ForumCategories
(
    ID INT NOT NULL AUTO_INCREMENT,
    ParentID INT,
    Title TEXT,
    Description TEXT,
    PRIMARY KEY(ID)
);

CREATE TABLE ForumTopics
(
    ID INT NOT NULL AUTO_INCREMENT,
    AuthorID INT,
    CategoryID INT,
    Title TEXT,
    DatePosted DATETIME,
    PRIMARY KEY(ID)
);

CREATE TABLE ForumPosts
(
    ID INT NOT NULL AUTO_INCREMENT,
    AuthorID INT,
    TopicID INT,
    Title TEXT,
    Content TEXT,
    DatePosted DATETIME,
    Spam BOOLEAN,
    PRIMARY KEY(ID)
);

INSERT INTO Users VALUES (1, 0, "admin", SHA1("password"), "admins@tim32.org", "Tim32 Admin", 0);
INSERT INTO BlogPosts VALUES(1, 1, "Welcome to Tim32!", "Welcome to the new Tim32 website! It has had a complete design re-think to make it simpler and easier to use!", NOW(), "Tim32");