Update server/src/schema.sql
This commit is contained in:
@@ -1,14 +1,10 @@
|
|||||||
CREATE TABLE IF NOT EXISTS users (
|
-- Characters are now the primary login entity.
|
||||||
id SERIAL PRIMARY KEY,
|
-- Each character has its own username + password hash.
|
||||||
username TEXT UNIQUE NOT NULL,
|
|
||||||
passhash TEXT NOT NULL,
|
|
||||||
created_at TIMESTAMPTZ DEFAULT now()
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS characters (
|
CREATE TABLE IF NOT EXISTS characters (
|
||||||
id SERIAL PRIMARY KEY,
|
id SERIAL PRIMARY KEY,
|
||||||
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
|
username TEXT UNIQUE NOT NULL,
|
||||||
name TEXT NOT NULL,
|
passhash TEXT NOT NULL,
|
||||||
x INTEGER NOT NULL DEFAULT 100,
|
x INTEGER NOT NULL DEFAULT 100,
|
||||||
y INTEGER NOT NULL DEFAULT 100,
|
y INTEGER NOT NULL DEFAULT 100,
|
||||||
level INTEGER NOT NULL DEFAULT 1,
|
level INTEGER NOT NULL DEFAULT 1,
|
||||||
@@ -31,4 +27,4 @@ CREATE TABLE IF NOT EXISTS inventory (
|
|||||||
);
|
);
|
||||||
|
|
||||||
CREATE UNIQUE INDEX IF NOT EXISTS inventory_unique_item
|
CREATE UNIQUE INDEX IF NOT EXISTS inventory_unique_item
|
||||||
ON inventory (character_id, item_key);
|
ON inventory (character_id, item_key);
|
||||||
|
|||||||
Reference in New Issue
Block a user