DROP TABLE IF EXISTS character_buyback;
CREATE TABLE character_buyback (
	id       INTEGER PRIMARY KEY,
	char_id  INTEGER NOT NULL DEFAULT 0,
	item_id  INTEGER NOT NULL DEFAULT 0,
	quantity INTEGER NOT NULL DEFAULT 1,
	price    INTEGER NOT NULL DEFAULT 0,
	FOREIGN KEY (char_id) REFERENCES characters(id) ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE INDEX idx_character_buyback_char_id ON character_buyback(char_id);
