migrate icon indicating copy to clipboard operation
migrate copied to clipboard

Error: no schema SQLite3

Open yosa12978 opened this issue 2 years ago • 1 comments

When i type migrate -path "./migrations" -database "./database.db" up 1 it returns error: no schema. But i have an up and down migrations in migrations folder. What should i do to make a migration?

yosa12978 avatar Oct 23 '22 18:10 yosa12978

I believe you forgot to specify the driver.

Look here:

https://github.com/golang-migrate/migrate/blob/31791adbc0e4f45e0cb13fbc3d13095b78709dc6/internal/url/url.go#L12-L25

You should do:

migrate -path "./migrations" -database "sqlite:///database.db" up 1

or removing one slash

migrate -path "./migrations" -database "sqlite://database.db" up 1

Look more here.

CaioTeixeira95 avatar Dec 01 '22 15:12 CaioTeixeira95