DROP TABLE IF EXISTS character_skillbar;
CREATE TABLE character_skillbar (
	id       INTEGER PRIMARY KEY,
	char_id  INTEGER NOT NULL DEFAULT 0,
	type     INTEGER NOT NULL DEFAULT 1,
	hotbar   INTEGER NOT NULL DEFAULT 0,
	spell_id INTEGER NOT NULL DEFAULT 0,
	tier     INTEGER NOT NULL DEFAULT 1,
	slot     INTEGER NOT NULL DEFAULT 0,
	text_val TEXT    NOT NULL DEFAULT 'Unused',
	UNIQUE(hotbar, char_id, slot),
	FOREIGN KEY (char_id) REFERENCES characters(id) ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE INDEX idx_character_skillbar_char_id ON character_skillbar(char_id);
