Subversion Repositories taios

Rev

Rev 1 | Rev 10 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 tom 1
DROP DATABASE Tim32;
2
CREATE DATABASE Tim32;
3
 
4
USE Tim32;
5
 
6
CREATE TABLE Users
7
(
8
    ID INT NOT NULL AUTO_INCREMENT,
9
    AccessID INT,
10
    Username TEXT,
11
    Password TEXT,
12
    EmailAddress TEXT,
13
    Name TEXT,
14
    ChallengeID INT,
15
    PRIMARY KEY(ID)
16
);
17
 
18
CREATE TABLE BlogPosts
19
(
20
    ID INT NOT NULL AUTO_INCREMENT,
21
    AuthorID INT,
22
    Title TEXT,
23
    Content TEXT,
24
    DatePosted DATETIME,
25
    Category TEXT,
26
    PRIMARY KEY(ID)
27
);
28
 
7 tom 29
CREATE TABLE BlogComments
30
(
31
    ID INT NOT NULL AUTO_INCREMENT,
32
    AuthorID INT,
33
    PostID INT,
34
    Title TEXT,
35
    Content TEXT,
36
    DatePosted DATETIME,
37
    Spam BOOLEAN,
38
    PRIMARY KEY(ID)
39
);
40
 
41
CREATE TABLE Projects
42
(
43
    ID INT NOT NULL AUTO_INCREMENT,
44
    AuthorID INT,
45
    Title TEXT,
46
    Description TEXT,
47
    LogoURL TEXT,
48
    WebsiteURL TEXT,
49
    LatestVersion TEXT,
50
    PRIMARY KEY(ID)
51
);
52
 
53
CREATE TABLE ForumCategories
54
(
55
    ID INT NOT NULL AUTO_INCREMENT,
56
    ParentID INT,
57
    Title TEXT,
58
    Description TEXT,
59
    PRIMARY KEY(ID)
60
);
61
 
62
CREATE TABLE ForumTopics
63
(
64
    ID INT NOT NULL AUTO_INCREMENT,
65
    AuthorID INT,
66
    CategoryID INT,
67
    Title TEXT,
68
    DatePosted DATETIME,
69
    PRIMARY KEY(ID)
70
);
71
 
72
CREATE TABLE ForumPosts
73
(
74
    ID INT NOT NULL AUTO_INCREMENT,
75
    AuthorID INT,
76
    TopicID INT,
77
    Title TEXT,
78
    Content TEXT,
79
    DatePosted DATETIME,
80
    Spam BOOLEAN,
81
    PRIMARY KEY(ID)
82
);
83
 
1 tom 84
INSERT INTO Users VALUES (1, 0, "admin", SHA1("password"), "admins@tim32.org", "Tim32 Admin", 0);
85
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");