updates table schema
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
DROP TABLE items;
|
||||
DROP TABLE looted;
|
||||
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
-- The global inventory of items
|
||||
CREATE TABLE items (
|
||||
id INTEGER PRIMARY KEY NOT NULL,
|
||||
name VARCHAR NOT NULL,
|
||||
base_price INTEGER NOT NULL
|
||||
);
|
||||
|
||||
-- The items that have been looted
|
||||
CREATE TABLE looted (
|
||||
id INTEGER PRIMARY KEY NOT NULL,
|
||||
name VARCHAR NOT NULL,
|
||||
base_price INTEGER NOT NULL,
|
||||
owner_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (owner_id) REFERENCES players(id)
|
||||
);
|
||||
|
||||
@@ -7,3 +7,5 @@ CREATE TABLE players (
|
||||
gp INTEGER DEFAULT 0 NOT NULL,
|
||||
pp INTEGER DEFAULT 0 NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO players (id, name) VALUES (0, 'Groupe');
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
DROP TABLE looted;
|
||||
@@ -1,8 +0,0 @@
|
||||
CREATE TABLE looted (
|
||||
id INTEGER PRIMARY KEY NOT NULL,
|
||||
player_id INTEGER NOT NULL,
|
||||
item_id INTEGER NOT NULL,
|
||||
acquired_date DATE NOT NULL,
|
||||
FOREIGN KEY (player_id) REFERENCES players(id),
|
||||
FOREIGN KEY (item_id) REFERENCES items(id)
|
||||
);
|
||||
1
lootalot_db/migrations/2019-06-21-113950_claims/down.sql
Normal file
1
lootalot_db/migrations/2019-06-21-113950_claims/down.sql
Normal file
@@ -0,0 +1 @@
|
||||
DROP TABLE claims;
|
||||
8
lootalot_db/migrations/2019-06-21-113950_claims/up.sql
Normal file
8
lootalot_db/migrations/2019-06-21-113950_claims/up.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
CREATE TABLE claims (
|
||||
id INTEGER PRIMARY KEY NOT NULL,
|
||||
player_id INTEGER NOT NULL,
|
||||
loot_id INTEGER NOT NULL,
|
||||
resolve INTEGER NOT NULL DEFAULT 0,
|
||||
FOREIGN KEY (player_id) REFERENCES players(id),
|
||||
FOREIGN KEY (loot_id) REFERENCES looted(id)
|
||||
);
|
||||
Reference in New Issue
Block a user