{"id":50661852,"url":"https://github.com/karol7krawczyk/golang-migrate-tool","last_synced_at":"2026-06-10T01:00:59.817Z","repository":{"id":247534726,"uuid":"819917133","full_name":"karol7krawczyk/golang-migrate-tool","owner":"karol7krawczyk","description":"Language and framework independent database migrations and scripts for MySQL, Postgres and SQLite. Migration is for people who need to run a bash script before executing SQL code or are looking for migrations that execute processes in scripts","archived":false,"fork":false,"pushed_at":"2026-02-19T19:35:42.000Z","size":40,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2026-06-08T03:03:08.162Z","etag":null,"topics":["bash","docker","docker-compose","golang","migration","mysql","postgres","scripts","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karol7krawczyk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-25T12:40:19.000Z","updated_at":"2024-08-08T17:19:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"0b61b30c-ac56-4a15-8291-ce9a256e7753","html_url":"https://github.com/karol7krawczyk/golang-migrate-tool","commit_stats":null,"previous_names":["karol7krawczyk/golang-migrate"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/karol7krawczyk/golang-migrate-tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karol7krawczyk%2Fgolang-migrate-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karol7krawczyk%2Fgolang-migrate-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karol7krawczyk%2Fgolang-migrate-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karol7krawczyk%2Fgolang-migrate-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karol7krawczyk","download_url":"https://codeload.github.com/karol7krawczyk/golang-migrate-tool/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karol7krawczyk%2Fgolang-migrate-tool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34132030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","docker","docker-compose","golang","migration","mysql","postgres","scripts","sqlite"],"created_at":"2026-06-08T03:00:53.150Z","updated_at":"2026-06-10T01:00:59.812Z","avatar_url":"https://github.com/karol7krawczyk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golang Migrate Tool\n\n![License](https://img.shields.io/badge/license-MIT-blue.svg)\n\n## Table of Contents\n- [Overview](#overview)\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Configuration](#configuration)\n- [Command-Line Flags](#command-line-flags)\n- [Testing](#testing)\n- [License](#license)\n\n## Overview\nThe `golang-migrate` project is designed to provide an efficient and easy-to-use solution for database migrations, regardless of programming language or framework. It supports multiple databases and includes features such as version control, rollbacks, and detailed logging. The project is intended for people who need to run a bash script before executing SQL code or are looking for migrations that execute processes in scripts\n\n## Features\n- Supports multiple databases (e.g., MySQL, PostgreSQL, SQLite) and bash script\n- Efficiently using either SQL files and bash scripts.\n- Version control for migrations\n- Rollback functionality\n- Detailed logging\n- Easy configuration\n\n## Installation\nTo get started, clone the repository and install the required dependencies.\n\n### Clone the repository\n```bash\ngit clone https://github.com/Karol7Krawczyk/golang-migrate-tool.git\ncd golang-migrate-tool\n```\n\n### Run in docker\n```bash\nmake build\nmake up\n```\n\n### The binary file is available after building the docker\n```bash\n./migration -up\n```\n\n## Usage\nHere's how you can use the migration tool:\n\n- List of all commands: go run main.go -help\n- Running Migrations: go run main.go -up\n- Rolling Back Migrations: go run main.go -down\n- Create Migration files: go run main.go -create\n\n## Configuration\nConfiguration can be done via environment variables or command-line flags. Here’s an example configuration for your project:\n\n```bash\n    environment:\n      DB_NAME: your-database\n      DB_USER: your-username\n      DB_PASSWORD: your-password\n      DB_HOST: localhost\n      DB_PORT: 3306\n      DB_TYPE: mysql\n      DB_TABLE: migrations\n      MIGRATION_PATH: migrations/data\n```\n\n## Command-Line Flags\nThe migration tool accepts various command-line flags for configuration and commands. You can also use environment variables for configuration.\n\n### Database Configuration\n- `-db-user`: Database user (default: `DB_USER` environment variable)\n- `-db-password`: Database password (default: `DB_PASSWORD` environment variable)\n- `-db-host`: Database host address (default: `DB_HOST` environment variable)\n- `-db-port`: Database port (default: `DB_PORT` environment variable)\n- `-db-name`: Database name (default: `DB_NAME` environment variable)\n- `-db-table`: Migration table (default: `DB_TABLE` environment variable)\n- `-path`: Migration directory (default: `MIGRATION_PATH` environment variable)\n- `-db-type`: Database type (mysql, sqlite, postgres) (default: `DB_TYPE` environment variable)\n\n### Commands\n- `-status`: Check the status of a specific migration\n- `-desc`: Create a description of an empty migration\n- `-script`: Create bash scripts for an empty migration\n- `-create`: Create files for an empty migration\n- `-history`: Display migration history\n- `-new`: Display upcoming migrations\n- `-up`: Apply new migrations\n- `-down`: Revert migrations\n- `-debug`: Debug migrations\n- `-step`: Only one-step migration\n- `-steps`: Number of steps for migration\n\n### Example Usage\n```bash\ngo run . -db-user=root -db-password=secret -db-host=localhost -db-port=3306 -db-name=migrations -up\ngo run . -create -script -desc=\"Create User table\"\ngo run . -create\ngo run . -debug -down\ngo run . -debug -down -step\ngo run . -debug -up -steps=5\ngo run . -history\n```\n\n### Example Usage inside a docker container\n```bash\ndocker exec migrate-golang sh -c \"go run . -up\"\ndocker exec migrate-golang sh -c \"go run . -down\"\n```\n\n## Testing\nTo run the tests, use the following command after build docker-compose:\n\n```bash\nmake up\nmake test\n```\n\n## License\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarol7krawczyk%2Fgolang-migrate-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarol7krawczyk%2Fgolang-migrate-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarol7krawczyk%2Fgolang-migrate-tool/lists"}