From e675daa3405946729357befbf60e4f1a725c0587 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 25 Aug 2019 04:14:04 -0400 Subject: first pass at an implementation --- data/schema.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 data/schema.sql (limited to 'data') diff --git a/data/schema.sql b/data/schema.sql new file mode 100644 index 0000000..2c859ef --- /dev/null +++ b/data/schema.sql @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS holdings; +DROP TABLE IF EXISTS categories; + +CREATE TABLE categories ( + name text PRIMARY KEY, + target_allocation integer +); + +CREATE TABLE holdings ( + account text, + symbol text, + name text, + category text REFERENCES categories(name), + shares numeric(10, 3), + price numeric(10, 2), + expense_ratio numeric(5, 2), + PRIMARY KEY (account, symbol, category) +); -- cgit v1.2.3-54-g00ecf