Sign inSign up

widmogrod/migrate

By widmogrod

•Updated almost 11 years ago

Database migration via Golang github.com/mattes/migrate

Image
0

7.5K

widmogrod/migrate repository overview

⁠migrate
⁠Introduction

Run database migrations fast and easy.

Given project is based on github.com/mattes/migrate⁠.

⁠How to use it
⁠Migration directory

Assuming that you have directory ./migrations with migration files like:

001_initial_plan_to_do_sth.up.sql     # up migration instructions
001_initial_plan_to_do_sth.down.sql   # down migration instructions
002_xxx.up.sql
002_xxx.down.sql
...

You are ready to use this docker image.

⁠Run migrations
$DB_DSN="postgres://postgres:postgres@postgres:5432/srv?sslmode=disable"
docker run -v ./migrations:/migrations \
    widmogrod/migrate -url $DB_DSN up

NOTE: More documented options you can find here: https://github.com/mattes/migrate#usage-from-terminal⁠

⁠Available drives
  • PostgreSQL
  • Cassandra
  • SQLite
  • MySQL (experimental)

Tag summary

Content type

Image

Digest

Size

252.4 MB

Last updated

almost 11 years ago

docker pull widmogrod/migrate