mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
fix sqlite column modification
This commit is contained in:
parent
075028f8fc
commit
e968688e7f
|
@ -1,7 +1,8 @@
|
|||
-- +up
|
||||
-- +begin
|
||||
ALTER TABLE profits
|
||||
CHANGE symbol symbol VARCHAR(20) NOT NULL;
|
||||
-- We can not change column type in sqlite
|
||||
-- However, SQLite does not enforce the length of a VARCHAR, i.e VARCHAR(8) == VARCHAR(20) == TEXT
|
||||
SELECT 1;
|
||||
-- +end
|
||||
|
||||
-- +down
|
||||
|
|
|
@ -14,7 +14,7 @@ func init() {
|
|||
func upFixProfitSymbolLength(ctx context.Context, tx rockhopper.SQLExecutor) (err error) {
|
||||
// This code is executed when the migration is applied.
|
||||
|
||||
_, err = tx.ExecContext(ctx, "ALTER TABLE profits\n CHANGE symbol symbol VARCHAR(20) NOT NULL;")
|
||||
_, err = tx.ExecContext(ctx, "SELECT 1;")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user