alert service
This commit is contained in:
parent
0e73841b3e
commit
608561ab38
8 changed files with 283 additions and 8 deletions
|
|
@ -1,4 +1,5 @@
|
|||
drop table if exists alert;
|
||||
drop type alert_condition;
|
||||
drop table if exists instrument;
|
||||
drop table if exists currency;
|
||||
drop table if exists users;
|
||||
|
|
|
|||
|
|
@ -17,12 +17,15 @@ create table if not exists instrument (
|
|||
UNIQUE (base_currency_id, quoted_currency_id)
|
||||
);
|
||||
|
||||
create type alert_condition as enum ('above', 'below');
|
||||
|
||||
create table if not exists alert (
|
||||
id uuid primary key not null default gen_random_uuid(),
|
||||
user_id uuid references users(id) not null,
|
||||
instrument_id uuid references instrument(id) not null,
|
||||
price text not null,
|
||||
active bool not null default true
|
||||
active bool not null default true,
|
||||
condition alert_condition not null
|
||||
);
|
||||
|
||||
insert into currency(symbol) values ('USDT'), ('BTC'), ('ETH'), ('SOL');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue