diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-08-27 01:55:59 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-08-27 01:59:08 -0400 |
commit | c7815088622d39b8792c072366c72836fce3a932 (patch) | |
tree | eeac30038c3ced09a127415424c36658d51f3de1 /data/investments-sheet-schema.sql | |
parent | ea9d3dea257b4f1c753b3a6d6c3bb1f20efc0401 (diff) | |
download | metabase-utils-c7815088622d39b8792c072366c72836fce3a932.tar.gz metabase-utils-c7815088622d39b8792c072366c72836fce3a932.zip |
make load script handle the whole database
Diffstat (limited to 'data/investments-sheet-schema.sql')
-rw-r--r-- | data/investments-sheet-schema.sql | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/data/investments-sheet-schema.sql b/data/investments-sheet-schema.sql new file mode 100644 index 0000000..d538ec6 --- /dev/null +++ b/data/investments-sheet-schema.sql @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS holdings; +DROP TABLE IF EXISTS categories; + +CREATE TABLE investment_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) +); |