init rust db backend
This commit is contained in:
0
lootalot_db/migrations/.gitkeep
Normal file
0
lootalot_db/migrations/.gitkeep
Normal file
@@ -0,0 +1,2 @@
|
||||
DROP TABLE items;
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
CREATE TABLE items (
|
||||
id INTEGER PRIMARY KEY,
|
||||
name VARCHAR NOT NULL,
|
||||
base_price INTEGER NOT NULL
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
DROP TABLE players;
|
||||
@@ -0,0 +1,9 @@
|
||||
CREATE TABLE players (
|
||||
id INTEGER PRIMARY KEY,
|
||||
name VARCHAR NOT NULL,
|
||||
debt INTEGER DEFAULT 0, -- debt to the group in copper pieces
|
||||
cp INTEGER DEFAULT 0,
|
||||
sp INTEGER DEFAULT 0,
|
||||
gp INTEGER DEFAULT 0,
|
||||
pp INTEGER DEFAULT 0
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
DROP TABLE looted;
|
||||
@@ -0,0 +1,8 @@
|
||||
CREATE TABLE looted (
|
||||
id INTEGER PRIMARY KEY,
|
||||
player_id INTEGER NOT NULL,
|
||||
item_id INTEGER NOT NULL,
|
||||
acquired_date DATE DEFAULT NOW,
|
||||
FOREIGN KEY (player_id) REFERENCES players(id),
|
||||
FOREIGN KEY (item_id) REFERENCES items(id)
|
||||
);
|
||||
Reference in New Issue
Block a user