DEV Community

Discussion on: How to write & run database migration in Golang

Collapse
 
lil5 profile image
Lucian I. Last

Please use go install github.com/golang-migrate/migrate/v4 and add go’s bin directory to your PATH. Using brew for a go package doesn’t sound like a good idea, considering version differences

Collapse
 
thewackyindian profile image
Raj Karan Singh

I am on windows and did this, like ran this command on the terminal, it ran and installed it and said package is not a main package
then i ran the migrate --version command
and its not able to find it like not installed or something, confused with gobin and gopath.

Collapse
 
lil5 profile image
Lucian I. Last • Edited

I think your first problem is that you’re running Windows but further you might want to add your ~/go/bin directory to your PATH env in bashrc

Collapse
 
athulmuralidhar profile image
Athul Muralidhar

cant stress this one enough