doc: update readme document for migration

This commit is contained in:
TonyQ 2021-12-11 10:40:57 +08:00
parent c38564dcc7
commit 1118453b96
3 changed files with 25 additions and 0 deletions

View File

@ -562,6 +562,14 @@ Then run the following command to compile the migration files into go files:
make migrations
```
or
```shell
rockhopper compile --config rockhopper_mysql.yaml --output pkg/migrations/mysql
rockhopper compile --config rockhopper_sqlite.yaml --output pkg/migrations/sqlite3
git add -v pkg/migrations && git commit -m "compile and update migration package" pkg/migrations || true
```
If you want to override the DSN and the Driver defined in the YAML config file, you can add some env vars in your dotenv file like this:

View File

@ -0,0 +1,9 @@
-- +up
-- +begin
ALTER TABLE trades CHANGE fee_currency fee_currency varchar(10) NOT NULL;
-- +end
-- +down
-- +begin
ALTER TABLE trades CHANGE fee_currency fee_currency varchar(4) NOT NULL;
-- +end

View File

@ -0,0 +1,8 @@
-- +up
-- +begin
-- +end
-- +down
-- +begin
-- +end