DROP TABLE IF EXISTS login_characters;
CREATE TABLE login_characters (
	id                      INTEGER PRIMARY KEY,
	account_id              INTEGER NOT NULL DEFAULT 0,
	server_id               INTEGER NOT NULL DEFAULT 0,
	name                    TEXT    NOT NULL DEFAULT '',
	race                    INTEGER NOT NULL DEFAULT 0,
	class                   INTEGER NOT NULL DEFAULT 0,
	gender                  INTEGER NOT NULL DEFAULT 0,
	deity                   INTEGER NOT NULL DEFAULT 0,
	body_size               REAL    NOT NULL DEFAULT 0,
	body_age                REAL    NOT NULL DEFAULT 0,
	current_zone            TEXT    NOT NULL DEFAULT 'antonica',
	current_zone_id         INTEGER NOT NULL DEFAULT 0,
	level                   INTEGER NOT NULL DEFAULT 1,
	tradeskill_class        INTEGER NOT NULL DEFAULT 0,
	tradeskill_level        INTEGER NOT NULL DEFAULT 1,
	soga_wing_type          INTEGER NOT NULL,
	soga_chest_type         INTEGER NOT NULL,
	soga_legs_type          INTEGER NOT NULL,
	soga_hair_type          INTEGER NOT NULL,
	soga_facial_hair_type   INTEGER NOT NULL DEFAULT 0,
	legs_type               INTEGER NOT NULL,
	chest_type              INTEGER NOT NULL,
	wing_type               INTEGER NOT NULL,
	hair_type               INTEGER NOT NULL,
	facial_hair_type        INTEGER NOT NULL DEFAULT 0,
	deleted                 INTEGER NOT NULL DEFAULT 0,
	unix_timestamp          INTEGER NOT NULL DEFAULT 0,
	created_date            INTEGER NOT NULL DEFAULT (strftime('%s', 'now')),
	last_played             INTEGER NOT NULL DEFAULT 0,
	char_id                 INTEGER NOT NULL DEFAULT 0,
	soga_model_type         INTEGER NOT NULL DEFAULT 0,
	model_type              INTEGER NOT NULL DEFAULT 0
);
CREATE INDEX idx_login_characters_server ON login_characters(account_id, server_id, char_id);
