add funding_fees table migrations

This commit is contained in:
c9s 2024-01-03 18:07:20 +08:00
parent 665d4ed94b
commit ed6a401dec
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 62 additions and 0 deletions

View 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

View 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