DROP TABLE IF EXISTS character_houses;
CREATE TABLE character_houses (
	id            INTEGER PRIMARY KEY,
	char_id       INTEGER NOT NULL DEFAULT 0,
	house_id      INTEGER NOT NULL DEFAULT 0,
	instance_id   INTEGER NOT NULL DEFAULT 0,
	upkeep_due    INTEGER NOT NULL DEFAULT 0,
	escrow_coins  INTEGER NOT NULL DEFAULT 0,
	escrow_status INTEGER NOT NULL DEFAULT 0,
	FOREIGN KEY (char_id) REFERENCES characters(id) ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE INDEX idx_character_houses_char_id ON character_houses(char_id);
