-- This schema contains only the commands necessary to upgrade 
-- a Pg/MySQL 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: 8 Jul 2006

-- Add the sess_ip column and some indexes
ALTER TABLE session ADD COLUMN sess_ip char(15);
ALTER TABLE session ALTER sess_ip SET NOT NULL;

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)
);
