migrate
migrate copied to clipboard
Error: no schema SQLite3
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?
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.