-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.sql
46 lines (41 loc) · 1.04 KB
/
db.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
CREATE DATABASE core;
USE core;
CREATE TABLE `position` (
txid VARCHAR(48) NOT NULL,
closing_txid VARCHAR(48) NOT NULL,
`type` VARCHAR(8),
closed_at DATETIME,
primary key (txid)
);
CREATE TABLE `order` (
txid VARCHAR(48) NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
pair VARCHAR(8),
`type` VARCHAR(8),
volume FLOAT(8),
price FLOAT(8),
cost FLOAT(8),
time_frame INT,
status VARCHAR(8),
closed_at DATETIME,
primary key (txid)
);
CREATE TABLE `trade` (
txid VARCHAR(48) NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
pair VARCHAR(32),
cost FLOAT(8),
fee FLOAT(8),
price FLOAT(8),
closed_at DATETIME,
primary key (txid)
);
CREATE TABLE `settings` (
id BIGINT(8) AUTO_INCREMENT NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
setting VARCHAR(32),
enabled BIT,
primary key (id)
);
INSERT INTO `settings` (setting, enabled) VALUES ('trading_enabled', 0);
INSERT INTO `settings` (setting, enabled) VALUES ('created_at', 1);