bbgo_origin/pkg/migrations/sqlite3/20220520140707_kline_unique_idx.go

35 lines
641 B
Go
Raw Normal View History

2022-05-20 08:29:45 +00:00
package sqlite3
import (
"context"
"github.com/c9s/rockhopper"
)
func init() {
AddMigration(upKlineUniqueIdx, downKlineUniqueIdx)
}
func upKlineUniqueIdx(ctx context.Context, tx rockhopper.SQLExecutor) (err error) {
// This code is executed when the migration is applied.
_, err = tx.ExecContext(ctx, "SELECT 'up SQL query';")
if err != nil {
return err
}
return err
}
func downKlineUniqueIdx(ctx context.Context, tx rockhopper.SQLExecutor) (err error) {
// This code is executed when the migration is rolled back.
_, err = tx.ExecContext(ctx, "SELECT 'down SQL query';")
if err != nil {
return err
}
return err
}