 INSERT INTO zones VALUES('FK', 'Keep of Finn McCumhail');
 INSERT INTO zones VALUES('Jungles of Ssrynss', 'Jungles of Ssrynss');
 INSERT INTO zones VALUES('Hyssk', 'Jungle City of Hyssk');
-INSERT INTO zones VALUES('Izans', E'Izan\'s Floating Fortress');
+INSERT INTO zones VALUES(E'Izan's', E'Izan\'s Floating Fortress');
 INSERT INTO zones VALUES('IxP', 'Ixarkon Prison');
 INSERT INTO zones VALUES('Ix', 'Ixarkon');
 INSERT INTO zones VALUES('Ice Prison', 'Ice Prison');

INSERT INTO specials VALUES('weapon', 'multi', 'Crit Multiplier'); -- varcbonus
INSERT INTO specials VALUES('ammo', 'dice', 'Damage Dice'); -- vardice
CREATE TABLE items(
item_id serial PRIMARY KEY
,item_name varchar(100) NOT NULL
,keywords varchar(100)
,weight integer
,c_value integer
,item_type varchar(10) REFERENCES item_types(type_abbr)
,attrib1 varchar(25) REFERENCES attribs(attrib_abbr)
,attrib1_value integer
,attrib2 varchar(25) REFERENCES attribs(attrib_abbr)
,attrib2_value integer
,from_zone varchar(25) REFERENCES zones(zone_abbr)
,from_mob varchar(150) REFERENCES mobs(mob_name)
,no_identify boolean
,is_rare boolean
,from_store boolean
,from_quest boolean
,for_quest boolean
,from_invasion boolean
,out_of_game boolean
,short_stats varchar(450)
,long_stats varchar(900)
,full_stats text
,comments text
,last_id date
,tsv tsvector
);
CREATE INDEX idx_item_name ON items (item_name);
UPDATE items SET tsv =

INSERT INTO classes VALUES('Illusionist', 'Ill', 'Mage', 'ANTI-ILLUSIONIST');
INSERT INTO classes VALUES('Psionicist', 'Psi', 'Mage', 'ANTI-PSIONICIST');
INSERT INTO classes VALUES('Lich', 'Lic', 'Mage', 'ANTI-LICH');
CREATE TABLE accounts(
	account_name varchar(30) PRIMARY KEY
	,player_name varchar(30)
);
CREATE TABLE chars(
	account_name varchar(30) REFERENCES accounts(account_name)
	,char_name varchar(30)
	,class_name varchar(30) REFERENCES classes(class_name)
	,char_race varchar(20) REFERENCES races(race_name)
	,char_level integer
	,last_seen timestamp
	,vis boolean
	,PRIMARY KEY (account_name, char_name)
);
CREATE INDEX idx_chars_name ON chars (LOWER(char_name));


-- create new boot/load report tables and populate with base data
CREATE TABLE boots(
	boot_id serial PRIMARY KEY
	,boot_time timestamp NOT NULL
	,uptime varchar(10) NOT NULL
);
INSERT INTO boots (boot_time, uptime) VALUES(CURRENT_TIMESTAMP - interval '00:35:00', '0:34:10');
CREATE TABLE loads(
	boot_id integer REFERENCES boots(boot_id) NOT NULL
	,report_time timestamp NOT NULL
	,report_text varchar(320) NOT NULL
	,char_name varchar(30) NOT NULL
	,deleted boolean NOT NULL
	,PRIMARY KEY (boot_id, report_time)
);


-- create new item stat tables and populate with base data
CREATE TABLE enchants(
	ench_name varchar(25) PRIMARY KEY
	,ench_desc varchar(100)
);
INSERT INTO enchants VALUES('Flaming', '+2d4 fire damage per hit');
INSERT INTO enchants VALUES('Flaming Burst', '(+5d10 * crit mod of weapon) fire damage on critical hit');
INSERT INTO enchants VALUES('Shocking', '+2d4 electricity damage per hit');
