go-migrate-cli is a custom command-line interface (CLI) tool built using golang-migrate for managing database migrations in Go projects. This CLI simplifies the process of applying and managing database schema changes, making it easier to version-control and collaborate on database changes within your projects.
The goal of this repository is to provide a seamless solution for incorporating database migrations into your CI/CD pipelines without the need to install additional libraries or programming languages. By utilizing go-migrate-cli, you can automate the database migration process within your pipelines, ensuring consistency and reliability across your development and deployment workflows.
- Simplified Migration Management: Manage database migrations effortlessly using a familiar command-line interface.
- Support for Multiple Database Engines: Utilize golang-migrate's support for various database engines including MySQL, PostgreSQL, SQLite, and more. [currently just support MySQL]
- Version Control Integration: Seamlessly integrate database migrations with your version control system (VCS) for collaborative development.
- Customizable Workflow: Tailor the migration workflow to fit your project's specific requirements with configurable options.
- Easily Extensible: Extend the CLI's functionality by integrating additional plugins or custom scripts as needed.
To start using go-migration-cli, follow these steps:
- build go-migrate-cli
make build-cli
- update permissions of executable file
sudo chmod +x mcli
- move into your local bin
sudo cp mcli /usr/local/bin/
- run migration-up
mcli migrate up -H 127.0.0.1:3006 -N database_name -P pwd -U root --path /database/migrations
- run migration-down
mcli migrate down -H 127.0.0.1:3006 -N database_name -P pwd -U root --path /database/migrations
Contributions are welcome! If you encounter any issues, have feature requests, or would like to contribute enhancements, please open an issue or submit a pull request on the GitHub repository.
This project is licensed under the MIT License - see the LICENSE file for details.