add: sql init scripts execution

This commit is contained in:
realaltffour 2020-07-20 11:43:25 +03:00
parent 21ca337e7f
commit 462ee42f98
No known key found for this signature in database
GPG Key ID: C1265D839D44DCB1
4 changed files with 17 additions and 16 deletions

View File

@ -13,6 +13,7 @@ services:
- 5432:5432
volumes:
- ./.db:/var/lib/postgresql/data
- ../src/libtrader/db/sql:/docker-entrypoint-initdb.d/
adminer:
container_name: pt_admin
image: adminer

View File

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

View File

@ -1,8 +1,8 @@
CREATE TABLE asset_schema.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
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
)

View File

@ -1,6 +1,6 @@
CREATE TABLE sessions_schema.sessions (
sess_id text NOT NULL
client_ip text NOT NULL
expiry_date timestamp NOT NULL
sess_id text NOT NULL,
client_ip text NOT NULL,
expiry_date timestamp NOT NULL,
is_active bool NOT NULL
)