]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - schemas/mysql.sql
sess_date in the session table should be an INT, not a TIMESTAMP
[SourceForge/phpwiki.git] / schemas / mysql.sql
1 -- $Id: mysql.sql,v 1.4 2003-03-04 05:26:49 dairiki Exp $
2
3 drop table if exists page;
4 CREATE TABLE page (
5         id              INT NOT NULL,
6         pagename        VARCHAR(100) BINARY NOT NULL,
7         hits            INT NOT NULL DEFAULT 0,
8         pagedata        MEDIUMTEXT NOT NULL DEFAULT '',
9         PRIMARY KEY (id),
10         UNIQUE KEY (pagename)
11 );
12
13 drop table if exists version;
14 CREATE TABLE version (
15         id              INT NOT NULL,
16         version         INT NOT NULL,
17         mtime           INT NOT NULL,
18         minor_edit      TINYINT DEFAULT 0,
19         content         MEDIUMTEXT NOT NULL DEFAULT '',
20         versiondata     MEDIUMTEXT NOT NULL DEFAULT '',
21         PRIMARY KEY (id,version),
22         INDEX (mtime)
23 );
24
25 drop table if exists recent;
26 CREATE TABLE recent (
27         id              INT NOT NULL,
28         latestversion   INT,
29         latestmajor     INT,
30         latestminor     INT,
31         PRIMARY KEY (id)
32 );
33
34 drop table if exists nonempty;
35 CREATE TABLE nonempty (
36         id              INT NOT NULL,
37         PRIMARY KEY (id)
38 );
39
40 drop table if exists link;
41 CREATE TABLE link (
42         linkfrom        INT NOT NULL,
43         linkto          INT NOT NULL,
44         INDEX (linkfrom),
45         INDEX (linkto)
46 );
47
48 drop table if exists session;
49 CREATE TABLE session (
50     sess_id varchar(32) not null default '',
51     sess_data blob not null,
52     sess_date INT UNSIGNED NOT NULL,
53     PRIMARY KEY (sess_id)
54 );