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.
Clone the repository and build:
git clone https://github.com/iandaly/migrator.git
cd migrator
go build -o migratorOr install directly:
go install github.com/iandaly/migrator@latestmigrator initThis creates a migrator.yaml configuration file.
migrator make create_users_tableThis creates a new folder in the migrations directory with up.sql and down.sql files.
migrator migratemigrator pendingmigrator rollbackEdit migrator.yaml:
url: postgresql://user:password@localhost:5432/database
folder: migrations
driver: postgresql- PostgreSQL
MIT