Created
November 29, 2017 03:38
-
-
Save awreece/aeacbc818277c7c6d99477645e7fcd03 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE metrics ( | |
id bytea NOT NULL primary key, | |
description text, | |
name text COLLATE pg_catalog."C" | |
); | |
CREATE TABLE contribution_metrics ( | |
last_update_on timestamp with time zone, | |
metric bytea NOT NULL, | |
projected double precision, | |
contribution_id bytea NOT NULL, | |
primary key (contribution_id, metric) | |
); | |
CREATE INDEX on contribution_metrics (contribution_id, metric, last_updated_on DESC); | |
CREATE TABLE contributions ( | |
id bytea NOT NULL PRIMARY KEY, | |
amount double precision, | |
investment_id bytea, | |
metadata jsonb | |
); | |
CREATE INDEX ON contributions (investment_id); | |
create table earnings ( | |
id bytea not null primary key, | |
note_id bytea not null, | |
amount int | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment