/* * search-create.sql * * Database creation script for chrysophylax-search. * Copyright (C) 2002, Edmund Horner. * * This file may be read and distributed by the curious, * but must not form part of a working application without * the consent of the author. For further information * talk to search@chrysophylax.cjb.net. */ /* * Create the database. */ CREATE DATABASE IF NOT EXISTS chrysophylax; USE chrysophylax; /* * Allow access to the database for chrysophylax. */ GRANT CREATE, INSERT, DELETE, UPDATE ON chrysophylax.* TO chrysophylax@localhost; /* * Create the tables. */ CREATE TABLE search_hosts ( id int(11) NOT NULL auto_increment, name varchar(255) default NULL, last_accessed datetime default NULL, server varchar(255) default NULL, PRIMARY KEY (id), UNIQUE KEY name (name) ) CREATE TABLE search_pages ( id int(11) NOT NULL auto_increment, host_id int(11) default NULL, name blob, last_updated datetime default NULL, content_type varchar(255) default NULL, size int(10) unsigned default NULL, no_robots enum('N','Y') NOT NULL default 'N', title varchar(255) default NULL, status int(11) default NULL, referrer int(11) default NULL, content mediumblob, content_md5 varchar(32) default NULL, headers blob, PRIMARY KEY (id), KEY status (status), KEY host_id (host_id), KEY name (name(255)), KEY referrer (referrer), KEY content_type (content_type), KEY no_robots (no_robots), KEY last_updated (last_updated) ) CREATE TABLE search_links ( id int(11) NOT NULL auto_increment, from_id int(11) default NULL, to_id int(11) default NULL, strength int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY from_id_to_id (from_id,to_id) ) CREATE TABLE search_words ( word varchar(255) default NULL, pages mediumblob, UNIQUE KEY word (word) ) /* * Provide the seed for indexing. */ INSERT INTO search_hosts (id,name) VALUES (1,'chrysophylax.cjb.net'); INSERT INTO search_pages (id,host_id,name) VALUES (1,1,'/');