
-- main table
CREATE TABLE mainTable (propName VARCHAR PRIMARY KEY, propValue VARCHAR);
INSERT INTO mainTable (propName, propValue) VALUES ("ver","1");






-- CHARACTERS
-- positions
CREATE TABLE charaWorldPositions (playerId INTEGER PRIMARY KEY, id INTEGER, posX INTEGER, posY INTEGER);
CREATE INDEX charaWorldPositionsIDIndex ON charaWorldPositions (id);
CREATE INDEX charaWorldPositionsPosIndex ON charaWorldPositions (posX, posY);

-- real positions of characters (ie player's characters)
CREATE TABLE charaRealPos (id INTEGER PRIMARY KEY NOT NULL, x REAL NOT NULL, y REAL NOT NULL, z REAL NOT NULL);

-- data
CREATE TABLE charaData (id INTEGER PRIMARY KEY AUTOINCREMENT, playerId INTEGER, dataVal VARCHAR);
CREATE INDEX charaDataIDIndex ON charaData (id);






-- AUTH
-- accounts definition
CREATE TABLE accounts (
	id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
	username TEXT NOT NULL,
	pwdhash TEXT NOT NULL
);











