1 -- $Id: mysql-test-initialize.sql,v 1.3 2004-12-22 15:05:18 rurban Exp $
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,
61 CREATE TABLE test_session (
62 sess_id CHAR(32) NOT NULL DEFAULT '',
63 sess_data BLOB NOT NULL,
64 sess_date INT UNSIGNED NOT NULL,
65 sess_ip CHAR(15) NOT NULL,
66 PRIMARY KEY (sess_id),
68 ); -- TYPE=heap; -- if your Mysql supports it and you have enough RAM
70 -- upgrade to 1.3.8: (see lib/upgrade.php)
71 -- ALTER TABLE session ADD sess_ip CHAR(15) NOT NULL;
72 -- CREATE INDEX sess_date on session (sess_date);
73 -- update to 1.3.10: (see lib/upgrade.php)
74 -- ALTER TABLE page CHANGE id id INT NOT NULL AUTO_INCREMENT;
76 -- Optional DB Auth and Prefs
77 -- For these tables below the default table prefix must be used
78 -- in the DBAuthParam SQL statements also.
80 CREATE TABLE test_pref (
81 userid CHAR(48) BINARY NOT NULL UNIQUE,
82 prefs TEXT NULL DEFAULT '',
86 -- better use the extra pref table where such users can be created easily
88 CREATE TABLE test_user (
89 userid CHAR(48) BINARY NOT NULL UNIQUE,
90 passwd CHAR(48) BINARY DEFAULT '',
91 -- prefs TEXT NULL DEFAULT '',
92 -- groupname CHAR(48) BINARY DEFAULT 'users',
96 -- only if you plan to use the wikilens theme
97 CREATE TABLE test_rating (
98 dimension INT(4) NOT NULL,
99 raterpage INT(11) NOT NULL,
100 rateepage INT(11) NOT NULL,
101 ratingvalue FLOAT NOT NULL,
102 rateeversion INT(11) NOT NULL,
103 tstamp TIMESTAMP(14) NOT NULL,
104 PRIMARY KEY (dimension, raterpage, rateepage)
107 -- only if you need fast log-analysis (spam prevention, recent referrers)
108 -- see http://www.outoforder.cc/projects/apache/mod_log_sql/docs-2.0/#id2756178
109 CREATE TABLE test_accesslog (
110 time_stamp int unsigned,
111 remote_host varchar(50),
112 remote_user varchar(50),
113 request_method varchar(10),
114 request_line varchar(255),
115 request_args varchar(255),
116 request_file varchar(255),
117 request_uri varchar(255),
118 request_time char(28),
119 status smallint unsigned,
120 bytes_sent smallint unsigned,
121 referer varchar(255),
123 request_duration float
125 CREATE INDEX log_time ON test_accesslog (time_stamp);
126 CREATE INDEX log_host ON test_accesslog (remote_host);