summaryrefslogtreecommitdiff
path: root/haskell
diff options
context:
space:
mode:
authorJulien Dessaux2023-10-18 22:58:23 +0200
committerJulien Dessaux2023-10-18 22:58:23 +0200
commit4dd8a2e90f3cc7a2534af8fe7da6bd6e31ef6c28 (patch)
treeda21aa1cdb22c9a15966783b4506361e6a093216 /haskell
parent[haskell] updated main, init and server reset handling (diff)
downloadspacetraders-4dd8a2e90f3cc7a2534af8fe7da6bd6e31ef6c28.tar.gz
spacetraders-4dd8a2e90f3cc7a2534af8fe7da6bd6e31ef6c28.tar.bz2
spacetraders-4dd8a2e90f3cc7a2534af8fe7da6bd6e31ef6c28.zip
[haskell] add missing indices
Diffstat (limited to '')
-rw-r--r--haskell/src/SpaceTraders/Database/000_init.sql3
1 files changed, 3 insertions, 0 deletions
diff --git a/haskell/src/SpaceTraders/Database/000_init.sql b/haskell/src/SpaceTraders/Database/000_init.sql
index 78a62cd..08a8553 100644
--- a/haskell/src/SpaceTraders/Database/000_init.sql
+++ b/haskell/src/SpaceTraders/Database/000_init.sql
@@ -13,11 +13,14 @@ CREATE TABLE contracts (
id INTEGER PRIMARY KEY,
data TEXT NOT NULL
);
+CREATE UNIQUE INDEX contracts_data_id ON contracts (json_extract(data, '$.id'));
+CREATE UNIQUE INDEX contracts_data_fulfilled ON contracts (json_extract(data, '$.fulfilled'));
CREATE TABLE ships (
id INTEGER PRIMARY KEY,
data TEXT NOT NULL
);
CREATE UNIQUE INDEX ships_data_symbol ON ships (json_extract(data, '$.symbol'));
+CREATE INDEX ships_data_nav_systemSymbol ON ships (json_extract(data, '$.nav.systemSymbol'));
CREATE TABLE systems (
id INTEGER PRIMARY KEY,
data TEXT NOT NULL