From c7815088622d39b8792c072366c72836fce3a932 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 27 Aug 2019 01:55:59 -0400 Subject: make load script handle the whole database --- data/investments-sheet-schema.sql | 18 ++++++++++++++++++ data/schema.sql | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 data/investments-sheet-schema.sql delete mode 100644 data/schema.sql (limited to 'data') 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) +); diff --git a/data/schema.sql b/data/schema.sql deleted file mode 100644 index 2c859ef..0000000 --- a/data/schema.sql +++ /dev/null @@ -1,18 +0,0 @@ -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