diff --git a/migrations/sqlite3/20220512170330_fix_profit_symbol_length.sql b/migrations/sqlite3/20220512170330_fix_profit_symbol_length.sql index 60bc96be9..583c4051e 100644 --- a/migrations/sqlite3/20220512170330_fix_profit_symbol_length.sql +++ b/migrations/sqlite3/20220512170330_fix_profit_symbol_length.sql @@ -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 diff --git a/pkg/migrations/sqlite3/20220512170330_fix_profit_symbol_length.go b/pkg/migrations/sqlite3/20220512170330_fix_profit_symbol_length.go index c3c8744c6..31b378360 100644 --- a/pkg/migrations/sqlite3/20220512170330_fix_profit_symbol_length.go +++ b/pkg/migrations/sqlite3/20220512170330_fix_profit_symbol_length.go @@ -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 }