This project is highly inspired by Goose which is also a database migration tool. I was susprised by the simplicity of this tool. So, I wanted to build by myself. This project includes most of the features Goose offers.
go install github.com/Shin-Thant/gograte/cmd/gograte@latestThis will install the gograte binary to your $GOPATH/bin directory.
Move to cmd/gograte directory and run go install.
Then you are good to go.
Move to your project and use those commands.
- Init your migration.
gograte init
- Create your migration sql file.
This will create
gograte create first
sqlfile in this format [timestamp]-[name].sql - Migrate with this commands.
Action option can be the followings.
gograte migrate [db_driver] [db_url] [action]
upup-oneup-to(exampleup-to [version])downdown-onedown-to(exampledown-to [version])
- Help
gograte --help