DROP TABLE IF EXISTS transmuting;
CREATE TABLE transmuting (
	tier_id   INTEGER PRIMARY KEY,
	min_level INTEGER NOT NULL,
	max_level INTEGER NOT NULL,
	fragment  INTEGER NOT NULL,
	powder    INTEGER NOT NULL,
	infusion  INTEGER NOT NULL,
	mana      INTEGER NOT NULL,
	FOREIGN KEY (fragment) REFERENCES items(id) ON UPDATE CASCADE,
	FOREIGN KEY (powder) REFERENCES items(id) ON UPDATE CASCADE,
	FOREIGN KEY (infusion) REFERENCES items(id) ON UPDATE CASCADE,
	FOREIGN KEY (mana) REFERENCES items(id) ON UPDATE CASCADE
);
CREATE INDEX idx_transmuting_fragment ON transmuting(fragment);
CREATE INDEX idx_transmuting_powder ON transmuting(powder);
CREATE INDEX idx_transmuting_infusion ON transmuting(infusion);
CREATE INDEX idx_transmuting_mana ON transmuting(mana);

INSERT INTO transmuting VALUES
(1,1,9,8711,14777,8330,11372),
(2,10,19,5498,3308,8328,11107),
(3,20,29,8460,10377,8332,5040),
(4,30,39,10176,6922,8337,11148),
(5,40,49,11732,13162,8334,10008),
(6,50,59,10343,15264,8329,5103),
(7,60,69,9230,8258,8333,8053),
(8,70,79,6742,11845,8335,6178),
(9,80,90,15093,15280,8336,6495);
