go-pg / migrations

SQL database migrations for Golang go-pg and PostgreSQL
https://godoc.org/github.com/go-pg/migrations
BSD 2-Clause "Simplified" License
309 stars 59 forks source link

[Google App Engine Standard Environment] no such file or directory #73

Closed Terminator637 closed 5 years ago

Terminator637 commented 5 years ago

When i run migrations in the Google App Engine Standard Environment i got the next error:

panic: open /tmp/staging/srv/internal/app/someapp/repository/migrations: no such file or directory goroutine 1 [running]: github.com/go-pg/migrations.(*Collection).MustRegisterTx(...) /go/pkg/mod/github.com/go-pg/migrations@v6.7.3+incompatible/collection.go:333 github.com/go-pg/migrations.MustRegisterTx(0xc000407f58, 0x2, 0x2) /go/pkg/mod/github.com/go-pg/migrations@v6.7.3+incompatible/default.go:35 +0x7f some.website.net/example/project/internal/app/someapp/repository/migrations.init.0() /tmp/staging/srv/internal/app/someapp/repository/migrations/1562685639_initialize_db.go:41 +0x4ad

I am sure that this is due to the fact that in this environment writing / reading of the file system is prohibited. Is there any way around this problem?

vmihailenco commented 5 years ago

You can try to disable sql auto discover via https://godoc.org/github.com/go-pg/migrations#Collection.DisableSQLAutodiscover

Terminator637 commented 5 years ago

You can try to disable sql auto discover via https://godoc.org/github.com/go-pg/migrations#Collection.DisableSQLAutodiscover

It works! Thank you!