From 8edb4351dd9f84785754a56440b9c14870dcf2b8 Mon Sep 17 00:00:00 2001 From: vlad zverzhkhovskiy Date: Tue, 2 Sep 2025 14:43:43 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BC=D0=B8=D0=B3=D1=80=D0=B0=D1=86=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../postgres/migration3.sql | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/KLHZ.Trader.Infrastructure/postgres/migration3.sql b/KLHZ.Trader.Infrastructure/postgres/migration3.sql index 52606f7..e5c2e44 100644 --- a/KLHZ.Trader.Infrastructure/postgres/migration3.sql +++ b/KLHZ.Trader.Infrastructure/postgres/migration3.sql @@ -1,12 +1,14 @@ -drop table if exists instrument_trades; -create table instrument_trades +drop table if exists orderbook_items; +create table orderbook_items ( - trade_id bigserial, - bought_at timestamp default current_timestamp, + id bigserial, + time timestamp default current_timestamp, figi text not null, ticker text not null, price decimal not null, - count decimal not null, - direction int not null default 1, - primary key (trade_id) -); \ No newline at end of file + count bigint not null, + item_type int not null default 1, + primary key (id) +); + +CREATE INDEX orderbook_items_index ON orderbook_items USING btree(figi, time, item_type); \ No newline at end of file