DROP TABLE IF EXISTS dialog_flavors;
CREATE TABLE dialog_flavors (
	id             INTEGER PRIMARY KEY,
	voiceover_id   INTEGER,
	text_id        INTEGER NOT NULL,
	language       INTEGER NOT NULL DEFAULT 0,
	understood     INTEGER NOT NULL DEFAULT 0,
	emote          TEXT    NOT NULL DEFAULT '',
	emote_text_id  INTEGER,
	unknown4       INTEGER NOT NULL DEFAULT 0,
	log_id         INTEGER NOT NULL,
	FOREIGN KEY (text_id) REFERENCES dialog_text(id) ON UPDATE CASCADE,
	FOREIGN KEY (emote_text_id) REFERENCES dialog_text(id) ON DELETE CASCADE ON UPDATE CASCADE,
	FOREIGN KEY (voiceover_id) REFERENCES dialog_voiceovers(id) ON UPDATE CASCADE
);
CREATE INDEX idx_dialog_flavors_emote ON dialog_flavors(emote);
CREATE INDEX idx_dialog_flavors_text_id ON dialog_flavors(text_id);
CREATE INDEX idx_dialog_flavors_voiceover_id ON dialog_flavors(voiceover_id);
CREATE INDEX idx_dialog_flavors_emote_text_id ON dialog_flavors(emote_text_id);
