Skip to content

πŸˆβ€β¬› Migo is a lightweight, fast, and easy-to-use migration tool designed to make your database schema changes a breeze.

License

Notifications You must be signed in to change notification settings

wesley-archives/migo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸˆβ€β¬› Migo: Your Friendly Migration Tool πŸŽ‰

Migo is a lightweight, fast, and easy-to-use migration tool designed to make your database schema changes a breeze. Think of Migo as your trusty cat companionβ€”always quick, efficient, and here to help you focus on the important stuff: your code. 🎁

Table of Contents

About Migo 🐾

Migo was created to make database migrations simple and efficient. Whether you're adding new tables or making schema adjustments, Migo helps you manage changes with ease, so you don’t get bogged down with complicated tools.

Why Migo?

  • Lightweight and fastβ€”no unnecessary bloat!
  • Easy to useβ€”no steep learning curve!
  • Create migration files with timestamped names.
  • Automatically apply pending migrations.
  • Rollback the most recent migration in a flash!

Features ✨

  • Initialize Project
  • Create Migration
  • Apply Migrations
  • Rollback Last Migration
  • List Migrations
  • Prebuilt Binary for Easy Installation
  • Build from Source
  • Makefile for Common Tasks
  • Add CI/CD integration for automated builds and releases
  • Create easy installer for multiple platforms (Windows, Linux, macOS)
  • Add support for multiple databases (PostgreSQL, MySQL, SQLite, etc.)
  • Add support for custom migration templates

Getting Started πŸš€

It’s quick and easy to get started with Migoβ€”just follow the steps below to install and set up your project!

Clone the Repository

Start by cloning the repo and navigating into the project directory:

git clone https://github.com/wesleybertipaglia/migo.git
cd migo

Choose Your Installation Method

Migo offers two installation options:

Option 1: Install Prebuilt Binary (The Easiest!)

No need to worry about Go or complex setupsβ€”just install the prebuilt binary and get to work!

Prerequisites:

  • No Go required! Migo’s binary works out of the box.
  • make should be available on your system (it’s preinstalled on most UNIX-like systems).

To install the prebuilt binary, run:

make install

This installs Migo for your systemβ€”no fuss, no compilation! πŸ₯³

Option 2: Build from Source (For the Code Lovers)

Want to compile Migo yourself? Follow these steps:

Prerequisites:

  • Go 1.23 or higher installed.
  • make available.

To build and install Migo from source:

make build
make install

This will build Migo locally and install it to /usr/local/bin or any directory in your PATH. βš™οΈ

Usage ⚑

Initialize a Migration Project πŸŽ‰

Creating your migration project is super easy. Just run:

migo init

This creates a neat folder structure for your migrations:

migo/
  β”œβ”€β”€ migrations/
  β”œβ”€β”€ logs/
  β”œβ”€β”€ state/
      └── migo.db

You can even specify a custom project directory:

migo init --project ./backend

Create a New Migration 🎁

Adding a new migration? Migo makes it a snap:

migo add --name create_users_table

This will create a migration file like:

migo/migrations/20250507123456_create_users_table.sql

With placeholders for your SQL:

-- Migration: create_users_table
-- Created at: 2025-05-07T12:34:56

-- UP

-- DOWN

Apply Pending Migrations πŸš€

Got some pending migrations? Apply them in one swift move:

migo update

Roll Back the Last Migration πŸ˜…

Made a mistake? No worries, just roll back the last migration:

migo rollback

Commands ⚑

Here are the available commands in Migo:

  • migo init: Initializes the migration project with the necessary folder structure.
  • migo add --name <migration_name>: Creates a new migration file with the specified name. The name is appended to the timestamp to ensure a unique file.
  • migo update: Applies all pending migrations to the database.
  • migo rollback: Rolls back the last applied migration.
  • migo list: Lists all migrations along with their status (either "Applied" or "Pending").

Makefile Commands πŸ› οΈ

Handy makefile commands are included for building, installing, cleaning, and more:

make build      # Build the binary
make install    # Install the binary globally
make clean      # Clean up (goodbye, binary!)
make dev        # Run the project with `go run main.go`
make fmt        # Format the code
make lint       # Lint the code

Contributing 🀝

Migo is open-source and we’d love to have your help! If you’ve got ideas, suggestions, or want to fix a bug, feel free to open an issue or submit a pull request. Together, we can make Migo even better! πŸ’‘

License πŸ“œ

This project is licensed under the MIT License. See the LICENSE file for more details. πŸ“‘

About

πŸˆβ€β¬› Migo is a lightweight, fast, and easy-to-use migration tool designed to make your database schema changes a breeze.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published