-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can you guys just provide some good documentation and some examples with mysql also? #611
Comments
Thanks for the feedback, there's definitely room for improvement.
We've been meaning to find time to update the examples, docs and add more tutorials, examples and in-depth posts, but with a small team of maintainers it's been challenging. |
Actually I went through it used the same example.. but it's not working properly. I wrote simple migration in go and then did binary build of it and then ran it as said in the example but I am getting this error: $ ./goose-custom mysql "api:password@/goose_test?parseTime=true" up my folder structure is this: migrations please tell me what to do here!. |
I am getting this error also even tho I did a binary build it's still saying the same. 2023/10/13 09:05:54 Goose failed: ERROR migrations/20231012171221_init_db.go: failed to run Go migration: Go functions must be registered and built into a custom binary (see https://github.com/pressly/goose/tree/master/examples/go-migrations) |
You typically have to do a blank import of the package your go migrations are in. I updated a goose demo repository that does both embedding and go migrations, which can be found here: https://github.com/mfridman/goose-demo If you put together a reproducible example and push it up to GitHub I can take a look at what's wrong. The most important thing is this line: import (
"database/sql"
"log"
"os"
# In this example we're importing migrations because we're also embedding, if you're not embedding,
# then you'll need to have a blank import like so:
- "github.com/mfridman/goose-demo/migrations"
+ _ "github.com/mfridman/goose-demo/migrations"
"github.com/pressly/goose/v3"
_ "modernc.org/sqlite"
) |
There are literally no help for some commands like build and init.. and there is literally no documentation for initial setup Please make a good documentation. Also if possible add some example for .go file migrations with mysql as the driver.
The text was updated successfully, but these errors were encountered: