-- This schema contains only the commands necessary to upgrade 
-- a SQL database created by the phpwiki 1.3.7 debian package to the
-- schema used by the 1.3.10 release of PHPwiki.
-- 
-- Author:  Matt Brown <debian@mattb.net.nz>
-- Date: 6 Sep 2005

-- drop the existing session table
DROP TABLE session;

CREATE TABLE session (
	sess_id   char(32) not null default '',
	sess_data blob not null,
	sess_date INT UNSIGNED NOT NULL,
	sess_ip   char(15) not null,
	PRIMARY KEY (sess_id)
);

CREATE INDEX sessdate_index ON session (sess_date);
CREATE INDEX sessip_index ON session (sess_ip);

-- Optional DB Auth and Prefs
-- For these tables below the default table prefix must be used 
-- in the DBAuthParam SQL statements also.

CREATE TABLE pref (
  	userid 	CHAR(48) NOT NULL UNIQUE,
  	prefs  	TEXT NULL DEFAULT '',
  	PRIMARY KEY (userid)
);
