DROP TABLE IF EXISTS character_achievements;
CREATE TABLE character_achievements (
	id             INTEGER PRIMARY KEY,
	char_id        INTEGER NOT NULL DEFAULT 0,
	achievement_id INTEGER NOT NULL DEFAULT 0,
	completed_date INTEGER NOT NULL DEFAULT 0,
	FOREIGN KEY (char_id) REFERENCES characters(id) ON UPDATE CASCADE
);
CREATE INDEX idx_character_achievements_char_id ON character_achievements(char_id);
