]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - tests/unit/mysql-test-initialize.sql
pcre crash and mysql helpers
[SourceForge/phpwiki.git] / tests / unit / mysql-test-initialize.sql
1 -- $Id: mysql-test-initialize.sql,v 1.1 2004-11-03 16:55:03 rurban Exp $
2 -- for the regression suite
3
4 CREATE TABLE test_page (
5         id              INT NOT NULL AUTO_INCREMENT,
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 CREATE TABLE test_version (
14         id              INT NOT NULL,
15         version         INT NOT NULL,
16         mtime           INT NOT NULL,
17         minor_edit      TINYINT DEFAULT 0,
18         content         MEDIUMTEXT NOT NULL DEFAULT '',
19         versiondata     MEDIUMTEXT NOT NULL DEFAULT '',
20         PRIMARY KEY (id,version),
21         INDEX (mtime)
22 );
23
24 CREATE TABLE test_recent (
25         id              INT NOT NULL,
26         latestversion   INT,
27         latestmajor     INT,
28         latestminor     INT,
29         PRIMARY KEY (id)
30 );
31
32 CREATE TABLE test_nonempty (
33         id              INT NOT NULL,
34         PRIMARY KEY (id)
35 );
36
37 CREATE TABLE test_link (
38         linkfrom        INT NOT NULL,
39         linkto          INT NOT NULL,
40         INDEX (linkfrom),
41         INDEX (linkto)
42 );
43
44 CREATE TABLE test_session (
45         sess_id         CHAR(32) NOT NULL DEFAULT '',
46         sess_data       BLOB NOT NULL,
47         sess_date       INT UNSIGNED NOT NULL,
48         sess_ip         CHAR(15) NOT NULL,
49         PRIMARY KEY (sess_id),
50         INDEX (sess_date)
51 ); -- TYPE=heap; -- if your Mysql supports it and you have enough RAM
52
53 -- upgrade to 1.3.8: (see lib/upgrade.php)
54 -- ALTER TABLE session ADD sess_ip CHAR(15) NOT NULL;
55 -- CREATE INDEX sess_date on session (sess_date);
56 -- update to 1.3.10: (see lib/upgrade.php)
57 -- ALTER TABLE page CHANGE id id INT NOT NULL AUTO_INCREMENT;
58
59 -- Optional DB Auth and Prefs
60 -- For these tables below the default table prefix must be used 
61 -- in the DBAuthParam SQL statements also.
62
63 CREATE TABLE test_pref (
64         userid  CHAR(48) BINARY NOT NULL UNIQUE,
65         prefs   TEXT NULL DEFAULT '',
66         PRIMARY KEY (userid)
67 ) TYPE=MyISAM;
68
69 -- better use the extra pref table where such users can be created easily 
70 -- without password.
71 CREATE TABLE test_user (
72         userid  CHAR(48) BINARY NOT NULL UNIQUE,
73         passwd  CHAR(48) BINARY DEFAULT '',
74 --      prefs   TEXT NULL DEFAULT '',
75 --      groupname CHAR(48) BINARY DEFAULT 'users',
76         PRIMARY KEY (userid)
77 ) TYPE=MyISAM;
78
79 -- only if you plan to use the wikilens theme
80 CREATE TABLE test_rating (
81         dimension INT(4) NOT NULL,
82         raterpage INT(11) NOT NULL,
83         rateepage INT(11) NOT NULL,
84         ratingvalue FLOAT NOT NULL,
85         rateeversion INT(11) NOT NULL,
86         tstamp TIMESTAMP(14) NOT NULL,
87         PRIMARY KEY (dimension, raterpage, rateepage)
88 );