mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 00:05:15 +00:00
add funding_fees table migrations
This commit is contained in:
parent
665d4ed94b
commit
ed6a401dec
31
migrations/mysql/20240103175426_add_funding_fees_table.sql
Normal file
31
migrations/mysql/20240103175426_add_funding_fees_table.sql
Normal file
|
@ -0,0 +1,31 @@
|
|||
-- +up
|
||||
-- +begin
|
||||
CREATE TABLE `funding_fees`
|
||||
(
|
||||
`gid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
|
||||
-- transaction id
|
||||
`txn_id` BIGINT UNSIGNED NOT NULL,
|
||||
|
||||
-- for exchange
|
||||
`exchange` VARCHAR(24) NOT NULL DEFAULT '',
|
||||
|
||||
-- asset name, BTC, MAX, USDT ... etc
|
||||
`asset` VARCHAR(5) NOT NULL,
|
||||
|
||||
-- the amount of the funding fee
|
||||
`amount` DECIMAL(16, 8) NOT NULL,
|
||||
|
||||
`funded_at` DATETIME NOT NULL,
|
||||
|
||||
PRIMARY KEY (`gid`),
|
||||
|
||||
UNIQUE KEY `txn_id` (`txn_id`, `exchange`)
|
||||
);
|
||||
-- +end
|
||||
|
||||
-- +down
|
||||
|
||||
-- +begin
|
||||
DROP TABLE `funding_fees`;
|
||||
-- +end
|
31
migrations/sqlite3/20240103175426_add_funding_fees_table.sql
Normal file
31
migrations/sqlite3/20240103175426_add_funding_fees_table.sql
Normal file
|
@ -0,0 +1,31 @@
|
|||
-- +up
|
||||
-- +begin
|
||||
CREATE TABLE `funding_fees`
|
||||
(
|
||||
`gid` INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
|
||||
-- transaction id
|
||||
`txn_id` INTEGER NOT NULL,
|
||||
|
||||
-- for exchange
|
||||
`exchange` VARCHAR(24) NOT NULL DEFAULT '',
|
||||
|
||||
-- asset name, BTC, MAX, USDT ... etc
|
||||
`asset` VARCHAR(5) NOT NULL,
|
||||
|
||||
-- the amount of the funding fee
|
||||
`amount` DECIMAL(16, 8) NOT NULL,
|
||||
|
||||
`funded_at` DATETIME NOT NULL,
|
||||
|
||||
PRIMARY KEY (`gid`),
|
||||
|
||||
UNIQUE KEY `txn_id` (`txn_id`, `exchange`)
|
||||
);
|
||||
-- +end
|
||||
|
||||
-- +down
|
||||
|
||||
-- +begin
|
||||
DROP TABLE `funding_fees`;
|
||||
-- +end
|
Loading…
Reference in New Issue
Block a user