diff --git a/migrations/mysql/20200721225616_trades.sql b/migrations/mysql/20200721225616_trades.sql index 98ba49b3e..11ea95dd6 100644 --- a/migrations/mysql/20200721225616_trades.sql +++ b/migrations/mysql/20200721225616_trades.sql @@ -1,3 +1,4 @@ +-- !txn -- +up CREATE TABLE `trades` ( diff --git a/migrations/mysql/20201102222546_orders.sql b/migrations/mysql/20201102222546_orders.sql index 32a85e708..51b3edb54 100644 --- a/migrations/mysql/20201102222546_orders.sql +++ b/migrations/mysql/20201102222546_orders.sql @@ -1,3 +1,4 @@ +-- !txn -- +up CREATE TABLE `orders` ( diff --git a/migrations/sqlite3/20200721225616_trades.sql b/migrations/sqlite3/20200721225616_trades.sql index fcd5f8f50..ad1d4b2ca 100644 --- a/migrations/sqlite3/20200721225616_trades.sql +++ b/migrations/sqlite3/20200721225616_trades.sql @@ -1,3 +1,4 @@ +-- !txn -- +up CREATE TABLE `trades` ( diff --git a/migrations/sqlite3/20200819054742_trade_index.sql b/migrations/sqlite3/20200819054742_trade_index.sql index e6dba452b..a627a462d 100644 --- a/migrations/sqlite3/20200819054742_trade_index.sql +++ b/migrations/sqlite3/20200819054742_trade_index.sql @@ -1,3 +1,4 @@ +-- !txn -- +up CREATE INDEX trades_symbol ON trades(symbol); CREATE INDEX trades_symbol_fee_currency ON trades(symbol, fee_currency, traded_at); diff --git a/migrations/sqlite3/20201102222546_orders.sql b/migrations/sqlite3/20201102222546_orders.sql index 561afd06a..c89a562d4 100644 --- a/migrations/sqlite3/20201102222546_orders.sql +++ b/migrations/sqlite3/20201102222546_orders.sql @@ -1,3 +1,4 @@ +-- !txn -- +up CREATE TABLE `orders` ( diff --git a/migrations/sqlite3/20201103173342_trades_add_order_id.sql b/migrations/sqlite3/20201103173342_trades_add_order_id.sql index f337eb231..fc2f8ff30 100644 --- a/migrations/sqlite3/20201103173342_trades_add_order_id.sql +++ b/migrations/sqlite3/20201103173342_trades_add_order_id.sql @@ -1,5 +1,9 @@ -- +up +-- +begin ALTER TABLE `trades` ADD COLUMN `order_id` INTEGER; +-- +end -- +down +-- +begin ALTER TABLE `trades` RENAME COLUMN `order_id` TO `order_id_deleted`; +-- +end diff --git a/migrations/sqlite3/20201106114742_klines.sql b/migrations/sqlite3/20201106114742_klines.sql index f8ea6bacb..27e064370 100644 --- a/migrations/sqlite3/20201106114742_klines.sql +++ b/migrations/sqlite3/20201106114742_klines.sql @@ -1,11 +1,12 @@ +-- !txn -- +up -- +begin CREATE TABLE `klines` ( `gid` INTEGER PRIMARY KEY AUTOINCREMENT, `exchange` VARCHAR(10) NOT NULL, - `start_time` DATETIME(3) NOT NULL, - `end_time` DATETIME(3) NOT NULL, + `start_time` DATETIME(3) NOT NULL, + `end_time` DATETIME(3) NOT NULL, `interval` VARCHAR(3) NOT NULL, `symbol` VARCHAR(7) NOT NULL, `open` DECIMAL(16, 8) NOT NULL, @@ -25,8 +26,8 @@ CREATE TABLE `okex_klines` ( `gid` INTEGER PRIMARY KEY AUTOINCREMENT, `exchange` VARCHAR(10) NOT NULL, - `start_time` DATETIME(3) NOT NULL, - `end_time` DATETIME(3) NOT NULL, + `start_time` DATETIME(3) NOT NULL, + `end_time` DATETIME(3) NOT NULL, `interval` VARCHAR(3) NOT NULL, `symbol` VARCHAR(7) NOT NULL, `open` DECIMAL(16, 8) NOT NULL, @@ -45,8 +46,8 @@ CREATE TABLE `binance_klines` ( `gid` INTEGER PRIMARY KEY AUTOINCREMENT, `exchange` VARCHAR(10) NOT NULL, - `start_time` DATETIME(3) NOT NULL, - `end_time` DATETIME(3) NOT NULL, + `start_time` DATETIME(3) NOT NULL, + `end_time` DATETIME(3) NOT NULL, `interval` VARCHAR(3) NOT NULL, `symbol` VARCHAR(7) NOT NULL, `open` DECIMAL(16, 8) NOT NULL, @@ -65,8 +66,8 @@ CREATE TABLE `max_klines` ( `gid` INTEGER PRIMARY KEY AUTOINCREMENT, `exchange` VARCHAR(10) NOT NULL, - `start_time` DATETIME(3) NOT NULL, - `end_time` DATETIME(3) NOT NULL, + `start_time` DATETIME(3) NOT NULL, + `end_time` DATETIME(3) NOT NULL, `interval` VARCHAR(3) NOT NULL, `symbol` VARCHAR(7) NOT NULL, `open` DECIMAL(16, 8) NOT NULL, diff --git a/migrations/sqlite3/20201211175751_fix_symbol_length.sql b/migrations/sqlite3/20201211175751_fix_symbol_length.sql deleted file mode 100644 index 06569c667..000000000 --- a/migrations/sqlite3/20201211175751_fix_symbol_length.sql +++ /dev/null @@ -1,5 +0,0 @@ --- +up -SELECT 1; - --- +down -SELECT 1; diff --git a/migrations/sqlite3/20210223080622_add_rewards_table.sql b/migrations/sqlite3/20210223080622_add_rewards_table.sql index ff6b3ae58..5679c19db 100644 --- a/migrations/sqlite3/20210223080622_add_rewards_table.sql +++ b/migrations/sqlite3/20210223080622_add_rewards_table.sql @@ -1,3 +1,4 @@ +-- !txn -- +up CREATE TABLE `rewards` ( diff --git a/migrations/sqlite3/20210301140656_add_withdraws_table.sql b/migrations/sqlite3/20210301140656_add_withdraws_table.sql index d1b2cb282..47030cd23 100644 --- a/migrations/sqlite3/20210301140656_add_withdraws_table.sql +++ b/migrations/sqlite3/20210301140656_add_withdraws_table.sql @@ -1,3 +1,4 @@ +-- !txn -- +up -- +begin CREATE TABLE `withdraws` diff --git a/migrations/sqlite3/20210307201830_add_deposits_table.sql b/migrations/sqlite3/20210307201830_add_deposits_table.sql index 2c8e0baf8..4b1beec22 100644 --- a/migrations/sqlite3/20210307201830_add_deposits_table.sql +++ b/migrations/sqlite3/20210307201830_add_deposits_table.sql @@ -1,3 +1,4 @@ +-- !txn -- +up -- +begin CREATE TABLE `deposits` diff --git a/migrations/sqlite3/20211211020303_add_ftx_kline.sql b/migrations/sqlite3/20211211020303_add_ftx_kline.sql index 0b34d02e8..fdcc7250b 100644 --- a/migrations/sqlite3/20211211020303_add_ftx_kline.sql +++ b/migrations/sqlite3/20211211020303_add_ftx_kline.sql @@ -1,3 +1,4 @@ +-- !txn -- +up -- +begin diff --git a/migrations/sqlite3/20211211034818_add_nav_history_details.sql b/migrations/sqlite3/20211211034818_add_nav_history_details.sql index 56860040c..a8c2ddc8f 100644 --- a/migrations/sqlite3/20211211034818_add_nav_history_details.sql +++ b/migrations/sqlite3/20211211034818_add_nav_history_details.sql @@ -1,3 +1,4 @@ +-- !txn -- +up -- +begin CREATE TABLE `nav_history_details` diff --git a/migrations/sqlite3/20211226022411_add_kucoin_klines.sql b/migrations/sqlite3/20211226022411_add_kucoin_klines.sql index c53a00193..c87f5ab94 100644 --- a/migrations/sqlite3/20211226022411_add_kucoin_klines.sql +++ b/migrations/sqlite3/20211226022411_add_kucoin_klines.sql @@ -1,3 +1,4 @@ +-- !txn -- +up -- +begin CREATE TABLE `kucoin_klines` diff --git a/migrations/sqlite3/20220304153309_add_profit_table.sql b/migrations/sqlite3/20220304153309_add_profit_table.sql index 290d32539..65a417181 100644 --- a/migrations/sqlite3/20220304153309_add_profit_table.sql +++ b/migrations/sqlite3/20220304153309_add_profit_table.sql @@ -1,3 +1,4 @@ +-- !txn -- +up CREATE TABLE `profits` ( diff --git a/migrations/sqlite3/20220531012226_margin_loans.sql b/migrations/sqlite3/20220531012226_margin_loans.sql index 2569e671a..88dbda030 100644 --- a/migrations/sqlite3/20220531012226_margin_loans.sql +++ b/migrations/sqlite3/20220531012226_margin_loans.sql @@ -1,3 +1,4 @@ +-- !txn -- +up CREATE TABLE `margin_loans` ( diff --git a/migrations/sqlite3/20220531013327_margin_repays.sql b/migrations/sqlite3/20220531013327_margin_repays.sql index c9f612365..8a918982d 100644 --- a/migrations/sqlite3/20220531013327_margin_repays.sql +++ b/migrations/sqlite3/20220531013327_margin_repays.sql @@ -1,3 +1,4 @@ +-- !txn -- +up CREATE TABLE `margin_repays` ( diff --git a/migrations/sqlite3/20220531013541_margin_interests.sql b/migrations/sqlite3/20220531013541_margin_interests.sql index f088f2581..333947299 100644 --- a/migrations/sqlite3/20220531013541_margin_interests.sql +++ b/migrations/sqlite3/20220531013541_margin_interests.sql @@ -1,3 +1,4 @@ +-- !txn -- +up CREATE TABLE `margin_interests` ( diff --git a/migrations/sqlite3/20220531015005_margin_liquidations.sql b/migrations/sqlite3/20220531015005_margin_liquidations.sql index 5a99afc36..e0f9bdee9 100644 --- a/migrations/sqlite3/20220531015005_margin_liquidations.sql +++ b/migrations/sqlite3/20220531015005_margin_liquidations.sql @@ -1,3 +1,4 @@ +-- !txn -- +up CREATE TABLE `margin_liquidations` ( diff --git a/migrations/sqlite3/20230815173104_add_bybit_klines.sql b/migrations/sqlite3/20230815173104_add_bybit_klines.sql index 7ad92fdac..6ab194410 100644 --- a/migrations/sqlite3/20230815173104_add_bybit_klines.sql +++ b/migrations/sqlite3/20230815173104_add_bybit_klines.sql @@ -1,3 +1,4 @@ +-- !txn -- +up -- +begin CREATE TABLE `bybit_klines`