db: add 001_schema_asset & 002_table_stock

This commit is contained in:
realaltffour 2020-07-01 13:56:21 +03:00
parent ece474b285
commit 7621406965
No known key found for this signature in database
GPG Key ID: C1265D839D44DCB1
3 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,5 @@
CREATE TABLE companies (
id SERIAL PRIMARY KEY
id BIGSERIAL PRIMARY KEY
symbol text UNIQUE NOT NULL
isin text UNIQUE NOT NULL
company_name text NOT NULL
@ -7,5 +7,5 @@ CREATE TABLE companies (
sector text NOT NULL
industry text NOT NULL
primary_sic_code text NOT NULL
employees integer NOT NULL
employees bigint NOT NULL
)

View File

@ -0,0 +1 @@
CREATE SCHEMA asset;

View File

@ -0,0 +1,8 @@
CREATE TABLE asset.stock_vals (
id BIGSERIAL PRIMARY KEY
isin text NOT NULL
time_since_epoch timestamp NOT NULL
ask_price numeric NOT NULL
bid_price numeric NOT NULL
volume bigint NOT NULL
)