DROP TABLE IF EXISTS character_instances;
CREATE TABLE character_instances (
	id                      INTEGER PRIMARY KEY,
	char_id                 INTEGER NOT NULL DEFAULT 0,
	instance_id             INTEGER NOT NULL DEFAULT 0,
	instance_zone_name      TEXT    NOT NULL,
	instance_type           INTEGER NOT NULL DEFAULT 0,
	last_success_timestamp  INTEGER NOT NULL DEFAULT 0,
	last_failure_timestamp  INTEGER NOT NULL DEFAULT 0,
	success_lockout_time    INTEGER NOT NULL DEFAULT 0,
	failure_lockout_time    INTEGER NOT NULL DEFAULT 0
);
CREATE INDEX idx_character_instances_char_id ON character_instances(char_id);
CREATE INDEX idx_character_instances_instance_zone_name ON character_instances(instance_zone_name);
