mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
add script for testing sqlite3 migration
This commit is contained in:
parent
16b7944b92
commit
ccb1708fd9
|
@ -9,4 +9,5 @@ before_script:
|
|||
- go get github.com/c9s/rockhopper
|
||||
- go mod download
|
||||
script:
|
||||
- bash scripts/test-sqlite3-migrations.sh
|
||||
- go test -v ./pkg/...
|
||||
|
|
|
@ -4,6 +4,6 @@ CREATE INDEX trades_symbol_fee_currency ON trades(symbol, fee_currency, traded_a
|
|||
CREATE INDEX trades_traded_at_symbol ON trades(traded_at, symbol);
|
||||
|
||||
-- +down
|
||||
DROP INDEX trades_symbol ON trades;
|
||||
DROP INDEX trades_symbol_fee_currency ON trades;
|
||||
DROP INDEX trades_traded_at_symbol ON trades;
|
||||
DROP INDEX trades_symbol;
|
||||
DROP INDEX trades_symbol_fee_currency;
|
||||
DROP INDEX trades_traded_at_symbol;
|
||||
|
|
|
@ -8,9 +8,9 @@ CREATE INDEX trades_symbol_fee_currency ON trades (exchange, symbol, fee_currenc
|
|||
CREATE INDEX trades_traded_at_symbol ON trades (exchange, traded_at, symbol);
|
||||
|
||||
-- +down
|
||||
DROP INDEX IF EXISTS trades_symbol ON trades;
|
||||
DROP INDEX IF EXISTS trades_symbol_fee_currency ON trades;
|
||||
DROP INDEX IF EXISTS trades_traded_at_symbol ON trades;
|
||||
DROP INDEX IF EXISTS trades_symbol;
|
||||
DROP INDEX IF EXISTS trades_symbol_fee_currency;
|
||||
DROP INDEX IF EXISTS trades_traded_at_symbol;
|
||||
|
||||
CREATE INDEX trades_symbol ON trades (symbol);
|
||||
CREATE INDEX trades_symbol_fee_currency ON trades (symbol, fee_currency, traded_at);
|
||||
|
|
2
scripts/test-sqlite3-migrations.sh
Executable file
2
scripts/test-sqlite3-migrations.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
rm -v bbgo.sqlite3 && rockhopper --config rockhopper_sqlite.yaml up && rockhopper --config rockhopper_sqlite.yaml down --to 1
|
Loading…
Reference in New Issue
Block a user