sql-migrate icon indicating copy to clipboard operation
sql-migrate copied to clipboard

Update gorp dependency to gorp.v2

Open jamesatwill-okta opened this issue 3 years ago • 8 comments

Hi! Could I convince you to migrate from gorp.v1 to gorp.v2?

There's only one note in the migration guide: https://github.com/go-gorp/gorp#pre-v2-to-v2

jamesatwill-okta avatar Jan 25 '22 01:01 jamesatwill-okta

It's probably about time we do that indeed!

Could you send a PR?

rubenv avatar Jan 27 '22 13:01 rubenv

https://github.com/rubenv/sql-migrate/pull/206 bumps to the latest gorp which is backwards compatible with v2.2.0 except it cleans up its go.mod handling. HTH!

idcmp avatar Jan 27 '22 20:01 idcmp

Closed in #206, thanks @idcmp

rubenv avatar Jan 28 '22 20:01 rubenv

@jamesatwill-okta @rubenv Found an issue after #206 was merged

$ go get -v github.com/rubenv/sql-migrate/...
github.com/rubenv/sql-migrate (download)
github.com/go-gorp/gorp (download)
package github.com/rubenv/sql-migrate: cannot find package "github.com/go-gorp/gorp/v3" in any of:
	/usr/local/go/src/github.com/go-gorp/gorp/v3 (from $GOROOT)
	/go/src/github.com/go-gorp/gorp/v3 (from $GOPATH)

wonsikin avatar Jan 31 '22 02:01 wonsikin

@wonsikin Had the same error too. If you do export GO111MODULE=on before running go get -v github.com/rubenv/sql-migrate/... this fixes the issue.

slee500 avatar Jan 31 '22 02:01 slee500

@slee500 @wonsikin I did export GO111MODULE=on before running go get -v github.com/rubenv/sql-migrate/.... But I had same error too. My Golang version is 1.15.0.

joj0hq avatar Jan 31 '22 09:01 joj0hq

I'm sorry. I had mistake. If you do export GO111MODULE=on before running go get -v github.com/rubenv/sql-migrate/... this fixes the issue. But I don't know this reason.

joj0hq avatar Feb 01 '22 03:02 joj0hq

@jotaro-biz here's a good writeup on what export GO111MODULE=on does. https://maelvls.dev/go111module-everywhere/

slee500 avatar Feb 15 '22 06:02 slee500