mattes / migrate

Database migrations. CLI and Golang library.
Other
2.29k stars 326 forks source link

"Error: File does not exist" when trying to update migrations with path flag #312

Closed timkellogg closed 6 years ago

timkellogg commented 6 years ago

I have a directory structure like this:

|── main.go
|── migrations/
         |── 1511129424_create_users.down.sql
        └─ 1511129424_create_users.up.sql

I run this from the root of the project: migrate -path ./migrations -database postgres://localhost:5432/app_development?sslmode=disable up

I get this: error: file does not exist

This seems to be the same thing that is recommended in this PR: https://github.com/mattes/migrate/issues/230.

I would just like to run the migrations from the migrations folder and apply them to the passed in db. What am I doing wrong?

timkellogg commented 6 years ago

Found a solution - I had to manually delete the schema_migration version inside of my database.