Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wallester/migrate

Command line tool for PostgreSQL migrations
https://github.com/wallester/migrate

database databases go golang migration migrations postgres postgresql

Last synced: 4 days ago
JSON representation

Command line tool for PostgreSQL migrations

Awesome Lists containing this project

README

        

# migrate
[![Go Report Card](https://goreportcard.com/badge/github.com/wallester/migrate)](https://goreportcard.com/report/github.com/wallester/migrate)

Command line tool for PostgreSQL migrations

## Features

* Runs migrations in transactions (one transaction per one migration file).
* Stores migration version details in auto-generated table ``schema_migrations``.

## Usage

```bash
migrate -path ./db/migrations create add_field_to_table
migrate -url postgres://user@host:port/database -path ./db/migrations -timeout 10 up
migrate -url postgres://user@host:port/database -path ./db/migrations -timeout 10 up 1
migrate -url postgres://user@host:port/database -path ./db/migrations -timeout 10 down
migrate -url postgres://user@host:port/database -path ./db/migrations -timeout 10 down 1
migrate help # for more info
```

## Tools

Install golangci-lint with

go get -u github.com/golangci/golangci-lint/cmd/golangci-lint github.com/securego/gosec/cmd/gosec

## How to contribute

1. Fork the repo on Github.
2. Clone the `wallester/migrate` repo. Next steps are to be done in the `wallester/migrate repo` (not the fork).
3. Add your fork as a new remote (`git remote add myfork url-of-myfork`).
4. Create a new branch, do your work and commit the changes as usual.
5. Push your new branch to your fork (`git push myfork mybranch`).
6. Open a pull request in Github as usual.