mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 08:11:08 +00:00
add margin history migrations
This commit is contained in:
parent
c3f2c9eb4a
commit
17e575df33
24
migrations/mysql/20220531012226_margin_loans.sql
Normal file
24
migrations/mysql/20220531012226_margin_loans.sql
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
-- +up
|
||||||
|
CREATE TABLE `margin_loans`
|
||||||
|
(
|
||||||
|
`gid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
|
||||||
|
`transaction_id` BIGINT UNSIGNED NOT NULL,
|
||||||
|
|
||||||
|
`exchange` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
`asset` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
`isolated_symbol` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
-- quantity is the quantity of the trade that makes profit
|
||||||
|
`principle` DECIMAL(16, 8) UNSIGNED NOT NULL,
|
||||||
|
|
||||||
|
`time` DATETIME(3) NOT NULL,
|
||||||
|
|
||||||
|
PRIMARY KEY (`gid`),
|
||||||
|
UNIQUE KEY (`transaction_id`)
|
||||||
|
);
|
||||||
|
|
||||||
|
-- +down
|
||||||
|
DROP TABLE IF EXISTS `margin_loans`;
|
24
migrations/mysql/20220531013327_margin_repays.sql
Normal file
24
migrations/mysql/20220531013327_margin_repays.sql
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
-- +up
|
||||||
|
CREATE TABLE `margin_repays`
|
||||||
|
(
|
||||||
|
`gid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
|
||||||
|
`transaction_id` BIGINT UNSIGNED NOT NULL,
|
||||||
|
|
||||||
|
`exchange` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
`asset` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
`isolated_symbol` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
-- quantity is the quantity of the trade that makes profit
|
||||||
|
`principle` DECIMAL(16, 8) UNSIGNED NOT NULL,
|
||||||
|
|
||||||
|
`time` DATETIME(3) NOT NULL,
|
||||||
|
|
||||||
|
PRIMARY KEY (`gid`),
|
||||||
|
UNIQUE KEY (`transaction_id`)
|
||||||
|
);
|
||||||
|
|
||||||
|
-- +down
|
||||||
|
DROP TABLE IF EXISTS `margin_repays`;
|
27
migrations/mysql/20220531013542_margin_interests.sql
Normal file
27
migrations/mysql/20220531013542_margin_interests.sql
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
-- +up
|
||||||
|
CREATE TABLE `margin_interests`
|
||||||
|
(
|
||||||
|
`gid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
|
||||||
|
`transaction_id` BIGINT UNSIGNED NOT NULL,
|
||||||
|
|
||||||
|
`exchange` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
`asset` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
`isolated_symbol` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
`principle` DECIMAL(16, 8) UNSIGNED NOT NULL,
|
||||||
|
|
||||||
|
`interest` DECIMAL(20, 16) UNSIGNED NOT NULL,
|
||||||
|
|
||||||
|
`interest_rate` DECIMAL(20, 16) UNSIGNED NOT NULL,
|
||||||
|
|
||||||
|
`time` DATETIME(3) NOT NULL,
|
||||||
|
|
||||||
|
PRIMARY KEY (`gid`),
|
||||||
|
UNIQUE KEY (`transaction_id`)
|
||||||
|
);
|
||||||
|
|
||||||
|
-- +down
|
||||||
|
DROP TABLE IF EXISTS `margin_interests`;
|
21
migrations/sqlite3/20220531012226_margin_loans.sql
Normal file
21
migrations/sqlite3/20220531012226_margin_loans.sql
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
-- +up
|
||||||
|
CREATE TABLE `margin_loans`
|
||||||
|
(
|
||||||
|
`gid` INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
|
||||||
|
`transaction_id` INTEGER NOT NULL,
|
||||||
|
|
||||||
|
`exchange` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
`asset` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
`isolated_symbol` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
-- quantity is the quantity of the trade that makes profit
|
||||||
|
`principle` DECIMAL(16, 8) NOT NULL,
|
||||||
|
|
||||||
|
`time` DATETIME(3) NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
-- +down
|
||||||
|
DROP TABLE IF EXISTS `margin_loans`;
|
21
migrations/sqlite3/20220531013327_margin_repays.sql
Normal file
21
migrations/sqlite3/20220531013327_margin_repays.sql
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
-- +up
|
||||||
|
CREATE TABLE `margin_repays`
|
||||||
|
(
|
||||||
|
`gid` INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
|
||||||
|
`transaction_id` INTEGER NOT NULL,
|
||||||
|
|
||||||
|
`exchange` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
`asset` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
`isolated_symbol` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
-- quantity is the quantity of the trade that makes profit
|
||||||
|
`principle` DECIMAL(16, 8) NOT NULL,
|
||||||
|
|
||||||
|
`time` DATETIME(3) NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
-- +down
|
||||||
|
DROP TABLE IF EXISTS `margin_repays`;
|
24
migrations/sqlite3/20220531013541_margin_interests.sql
Normal file
24
migrations/sqlite3/20220531013541_margin_interests.sql
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
-- +up
|
||||||
|
CREATE TABLE `margin_interests`
|
||||||
|
(
|
||||||
|
`gid` INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
|
||||||
|
`transaction_id` INTEGER NOT NULL,
|
||||||
|
|
||||||
|
`exchange` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
`asset` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
`isolated_symbol` VARCHAR(24) NOT NULL DEFAULT '',
|
||||||
|
|
||||||
|
`principle` DECIMAL(16, 8) NOT NULL,
|
||||||
|
|
||||||
|
`interest` DECIMAL(20, 16) NOT NULL,
|
||||||
|
|
||||||
|
`interest_rate` DECIMAL(20, 16) NOT NULL,
|
||||||
|
|
||||||
|
`time` DATETIME(3) NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
-- +down
|
||||||
|
DROP TABLE IF EXISTS `margin_interests`;
|
Loading…
Reference in New Issue
Block a user