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