In our project we are using vfsgen for embed static content like go templates and database migrations. Unfortunately go-pg migrations only supports the os filesystem and the files have to exist on production systems. We took a look around for other migration frameworks but decided to add the vfs feature to go-pg because its already running and we also like to work with the orm.
Changes:
added method DiscoverSQLMigrationsFromFilesystem(fs http.FileSystem, dir string) which we can use with a filesystem generated by vfsgen
the file contents also loaded using the given fs instead of os.open
In the testcase you can see some generated code by vfsgen which is used for discover the SQL.
In our project we are using vfsgen for embed static content like go templates and database migrations. Unfortunately go-pg migrations only supports the os filesystem and the files have to exist on production systems. We took a look around for other migration frameworks but decided to add the vfs feature to go-pg because its already running and we also like to work with the orm.
Changes:
In the testcase you can see some generated code by vfsgen which is used for discover the SQL.
Thanks in advance, Stephan