Thanks to visit codestin.com
Credit goes to github.com

Skip to content

IanDaly/Migrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple database migration tool written in Go for managing and applying database schema changes in a controlled, versioned manner. It supports running migrations forward and backward to evolve database schemas safely.

Installation

Clone the repository and build:

git clone https://github.com/iandaly/migrator.git
cd migrator
go build -o migrator

Or install directly:

go install github.com/iandaly/migrator@latest

Usage

Initialize a new project

migrator init

This creates a migrator.yaml configuration file.

Create a new migration

migrator make create_users_table

This creates a new folder in the migrations directory with up.sql and down.sql files.

Run migrations

migrator migrate

List pending migrations

migrator pending

Rollback migrations

migrator rollback

Configuration

Edit migrator.yaml:

url: postgresql://user:password@localhost:5432/database
folder: migrations
driver: postgresql

Supported Databases

  • PostgreSQL

License

MIT

About

A basic database migration tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages