summaryrefslogtreecommitdiffstats
path: root/data/investments-sheet-schema.sql
blob: d538ec63cb03332b0c4cd63c6c86e56ee75b1964 (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 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)
);