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@latest
This 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
sql
file in this format [timestamp]-[name].sql - Migrate with this commands.
Action option can be the followings.
gograte migrate [db_driver] [db_url] [action]
up
up-one
up-to
(exampleup-to [version]
)down
down-one
down-to
(exampledown-to [version]
)
- Help
gograte --help