dingo docs Help

dingo

dingo is a framework-agnostic lightweight cross-platform database migration tool that will keep your database schema in sync across multiple developers and deployment environments.

It's a command line tool that can be used on any project regardless of the programming language used to create it, be it Python, Go, C#, Java, Ruby, PHP or something else. This tool fits especially well with microservice architecture and services written in different languages, allowing you to have consistent and unified database migration process.

Key Features

  • Supports Postgres and SQL Server

  • Migrations are timestamp-versioned

  • Migrations are written using plain .sql

  • Project configs can be stored as .yml, .json or environment variables

  • Use different configuration profiles for different environments

  • Provides tools for rapid database development

  • Apply and revert database migrations

Installation

Currently, dingo can only be installed as a binary using default package management tools on Linux and macOS. If you'd like to make dingo a part of homebrew, apt or any other index, feel free to contribute, any help would be highly appreciated.

Install

First, download and install the binary:

curl -s https://api.github.com/repos/ujinjinjin/dingo/releases/latest \ | grep "browser_download_url.*x64.deb" \ | cut -d '"' -f 4 \ | wget -O dingo.deb -qi - sudo dpkg --install dingo.deb

Download and install the binary:

curl -s https://api.github.com/repos/ujinjinjin/dingo/releases/latest \ | grep "browser_download_url.*x64.pkg" \ | cut -d '"' -f 4 \ | xargs -I packageUrl curl packageUrl -L -s -o dingo.pkg installer -pkg dingo.pkg -target CurrentUserHomeDirectory

Run the following command to validate successful installation:

dingo --version

Uninstall

To uninstall dingo use:

sudo dpkg --remove dingo

To uninstall dingo use:

rm -rfd ~/.dingo /usr/local/bin/dingo

Basic usage

Create migration

dingo new -n create_table -p ./migrations/schemas

The command above will create 20231105214436_create_table.sql at .../migrations/schemas.

Apply

dingo up -p ./migrations -c prod

The command above will apply migrations located at .../migrations using prod configuration profile.

For more detailed info on usage refer to wiki section or run:

dingo -h

Contribute

Any contributions are welcome

Last modified: 22 October 2024