summaryrefslogtreecommitdiffstats
path: root/data/investments-sheet-schema.sql
blob: 566b9684abab5f4f416b6f9fc000ec66e434888d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
DROP TABLE IF EXISTS holdings;
DROP TABLE IF EXISTS investment_categories;

CREATE TABLE investment_categories (
    name text PRIMARY KEY,
    target_allocation integer
);

CREATE TABLE holdings (
    account text,
    symbol text,
    name text,
    category text REFERENCES investment_categories(name),
    shares numeric(10, 3),
    price numeric(10, 2),
    expense_ratio numeric(5, 2),
    PRIMARY KEY (account, symbol, category)
);