Git Product home page Git Product logo

Comments (5)

miguelmota avatar miguelmota commented on June 2, 2024 1

Found a workaround:

fsrc, err := (&file.File{}).Open("file://migrations")
if err != nil {
	return err
}

m, err := migrate.NewWithInstance(
	"file",
	fsrc,
	"postgres",
	driver,
)

However, I'm getting file does not exist after I've ran first migration successfully.

from migrate.

Kiura avatar Kiura commented on June 2, 2024

I have the same error when using cli tool, how do I import driver in cli?

from migrate.

Kiura avatar Kiura commented on June 2, 2024

solved my issue by downloading release version with curl

from migrate.

nutmix avatar nutmix commented on June 2, 2024

@Kiura how did you solve this exactly? I am having the same issue. built using:

$ go get -u -d github.com/mattes/migrate/cli github.com/go-sql-driver/mysql
$ go install -tags 'mysql'  github.com/mattes/migrate/cli

run using:

$ cli -database "mysql://xxx:yyy@/zzz" -source file://go/src/github.com/xxx/xxx.org/db/schema up

from migrate.

kiura24metrics avatar kiura24metrics commented on June 2, 2024

@nutmix I can't remember exactly how I did it back then, but try this:

curl -L https://github.com/golang-migrate/migrate/releases/download/$version/migrate.$platform-amd64.tar.gz | tar xvz

NOTE: replace $version and $platform.

for example:

curl -L https://github.com/golang-migrate/migrate/releases/download/v3.2.0/migrate.darwin-amd64.tar.gz | tar xvz

from migrate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.