DROP TABLE IF EXISTS starting_titles;
CREATE TABLE starting_titles (
	id        INTEGER PRIMARY KEY,
	race_id   INTEGER NOT NULL DEFAULT 255,
	class_id  INTEGER NOT NULL DEFAULT 255,
	gender_id INTEGER NOT NULL DEFAULT 255,
	title_id  INTEGER NOT NULL DEFAULT 0,
	UNIQUE(race_id, class_id, gender_id, title_id),
	FOREIGN KEY (title_id) REFERENCES titles(id) ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE INDEX idx_starting_titles_title_id ON starting_titles(title_id);

INSERT INTO starting_titles VALUES
(5,255,255,1,467),
(6,255,255,2,313),
(4,255,255,255,21);
