Skip to content

Commit

Permalink
Added new tables for FDevID -> EDDN mapping.
Browse files Browse the repository at this point in the history
Ignore the corresponding csv files because these should be downloaded from
https://github.com/EDCD/FDevIDs
  • Loading branch information
bgol committed Jul 2, 2016
1 parent 96cec80 commit d5e73fb
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ data/*.ini
data/extra-stars.txt
data/*.txt
data/edapi.cookies
data/FDevShipyard.csv
data/FDevOutfitting.csv

*.prices
*.suo
Expand Down
48 changes: 47 additions & 1 deletion data/TradeDangerous.sql
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ CREATE TABLE Item
ON DELETE CASCADE
);


CREATE TABLE StationItem
(
station_id INTEGER NOT NULL,
Expand Down Expand Up @@ -238,5 +239,50 @@ SELECT station_id,
WHERE supply_price > 0
;

COMMIT;

--
-- The next two tables (FDevShipyard, FDevOutfitting) are
-- used to map the FDev API IDs to data ready for EDDN.
--
-- The column names are the same as the header line from
-- the EDCD/FDevIDs csv files, so we can just download the
-- files (shipyard.csv, outfitting.csv) and save them
-- as (FDevShipyard.csv, FDevOutfitting.csv) into the
-- data directory.
--
-- see https://github.com/EDCD/FDevIDs
--
-- The commodity.csv is not needed because TD and EDDN
-- are using the same names.
--
-- -Bernd

CREATE TABLE FDevShipyard
(
id INTEGER NOT NULL,
name VARCHAR(40) COLLATE nocase,

UNIQUE (id)
);


CREATE TABLE FDevOutfitting
(
id INTEGER NOT NULL,
category CHAR(10)
CHECK (category IN ('hardpoint','internal','standard','utility')),
name VARCHAR(40) COLLATE nocase,
mount CHAR(10)
CHECK (mount IN (NULL, 'Fixed','Gimballed','Turreted')),
guidance CHAR(10)
CHECK (guidance IN (NULL, 'Dumbfire','Seeker','Swarm')),
ship VARCHAR(40) COLLATE nocase,
class CHAR(1) NOT NULL,
rating CHAR(1) NOT NULL,
entitlement CHAR(10),

UNIQUE (id)
);


COMMIT;
2 changes: 2 additions & 0 deletions tradedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,8 @@ class TradeDB(object):
('Category.csv', 'Category'),
('Item.csv', 'Item'),
('RareItem.csv', 'RareItem'),
('FDevShipyard.csv', 'FDevShipyard'),
('FDevOutfitting.csv', 'FDevOutfitting'),
)

# Translation matrixes for attributes -> common presentation
Expand Down

0 comments on commit d5e73fb

Please sign in to comment.