2 -- for the regression suite
4 drop table if exists test_page;
5 drop table if exists test_version;
6 drop table if exists test_recent;
7 drop table if exists test_nonempty;
8 drop table if exists test_link;
9 drop table if exists test_session;
13 drop table if exists test_pref;
14 drop table if exists test_user;
15 drop table if exists test_member;
17 drop table if exists test_rating;
18 drop table if exists test_accesslog;
20 CREATE TABLE test_page (
21 id INT NOT NULL AUTO_INCREMENT,
22 pagename VARCHAR(100) BINARY NOT NULL,
23 hits INT NOT NULL DEFAULT 0,
24 pagedata MEDIUMTEXT NOT NULL DEFAULT '',
25 cached_html MEDIUMBLOB,
30 CREATE TABLE test_version (
34 minor_edit TINYINT DEFAULT 0,
35 content MEDIUMTEXT NOT NULL DEFAULT '',
36 versiondata MEDIUMTEXT NOT NULL DEFAULT '',
37 PRIMARY KEY (id,version),
41 CREATE TABLE test_recent (
49 CREATE TABLE test_nonempty (
54 CREATE TABLE test_link (
55 linkfrom INT NOT NULL,
57 relation INT DEFAULT 0,
63 CREATE TABLE test_session (
64 sess_id CHAR(32) NOT NULL DEFAULT '',
65 sess_data BLOB NOT NULL,
66 sess_date INT UNSIGNED NOT NULL,
67 sess_ip CHAR(15) NOT NULL,
68 PRIMARY KEY (sess_id),
70 ); -- TYPE=heap; -- if your Mysql supports it and you have enough RAM
72 -- upgrade to 1.3.8: (see lib/upgrade.php)
73 -- ALTER TABLE session ADD sess_ip CHAR(15) NOT NULL;
74 -- CREATE INDEX sess_date on session (sess_date);
75 -- update to 1.3.10: (see lib/upgrade.php)
76 -- ALTER TABLE page CHANGE id id INT NOT NULL AUTO_INCREMENT;
78 -- Optional DB Auth and Prefs
79 -- For these tables below the default table prefix must be used
80 -- in the DBAuthParam SQL statements also.
82 CREATE TABLE test_pref (
83 userid CHAR(48) BINARY NOT NULL UNIQUE,
84 prefs TEXT NULL DEFAULT '',
88 -- better use the extra pref table where such users can be created easily
90 --CREATE TABLE test_user (
91 -- userid CHAR(48) BINARY NOT NULL UNIQUE,
92 -- passwd CHAR(48) BINARY DEFAULT '',
93 -- prefs TEXT NULL DEFAULT '',
94 -- groupname CHAR(48) BINARY DEFAULT 'users',
95 -- PRIMARY KEY (userid)
98 -- only if you plan to use the wikilens theme
99 CREATE TABLE test_rating (
100 dimension INT(4) NOT NULL,
101 raterpage INT(11) NOT NULL,
102 rateepage INT(11) NOT NULL,
103 ratingvalue FLOAT NOT NULL,
104 rateeversion INT(11) NOT NULL,
105 tstamp TIMESTAMP(14) NOT NULL,
106 PRIMARY KEY (dimension, raterpage, rateepage)
109 -- only if you need fast log-analysis (spam prevention, recent referrers)
110 -- see http://www.outoforder.cc/projects/apache/mod_log_sql/docs-2.0/#id2756178
111 CREATE TABLE test_accesslog (
112 time_stamp int unsigned,
113 remote_host varchar(50),
114 remote_user varchar(50),
115 request_method varchar(10),
116 request_line varchar(255),
117 request_args varchar(255),
118 request_file varchar(255),
119 request_uri varchar(255),
120 request_time char(28),
121 status smallint unsigned,
122 bytes_sent smallint unsigned,
123 referer varchar(255),
125 request_duration float
127 CREATE INDEX log_time ON test_accesslog (time_stamp);
128 CREATE INDEX log_host ON test_accesslog (remote_host);