diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3e9a76d..53e7b1f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version: 1.20 - name: Build run: go build -v ./... diff --git a/README.md b/README.md index 9e77da7..db6bb0b 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ About --------- -Once I faced with a issue to change our corporate migrations library in Golang from [rubenv/sql-migrate](https://github.com/rubenv/sql-migrate) +Once I faced with an issue to change our corporate migrations library in Golang from [rubenv/sql-migrate](https://github.com/rubenv/sql-migrate) to [golang-migrate](https://github.com/golang-migrate) and it was so hard. There are several caveats that you should know about, so it can save you some time: - You have to split each sql-migrate file in 2 files: up and down migration. - - By default migrations in sql-migrate are running in transaction-default mode, but in golang-migrate you have to wrap it in BEGIN;COMMIT; for transactions. + - By default, migrations in sql-migrate are running in transaction-default mode, but in golang-migrate you have to wrap it in BEGIN;COMMIT; for transactions. - Golang-migrate [doesn't like](https://github.com/golang-migrate/migrate/issues/731) the same timestamp for different files. - You [can't](https://github.com/golang-migrate/migrate/issues/284) create several indexes concurrently without adding x-multi-statement=true flag for DB connection. However, please note that this flag [will break](https://github.com/golang-migrate/migrate/issues/590) your CREATE FUNCTION ... AS $$ symbol.