Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 months ago
JSON representation
Command line tool for PostgreSQL migrations
- Host: GitHub
- URL: https://github.com/wallester/migrate
- Owner: wallester
- Created: 2017-05-11T13:27:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-26T12:44:30.000Z (10 months ago)
- Last Synced: 2024-09-29T11:25:35.715Z (4 months ago)
- Topics: database, databases, go, golang, migration, migrations, postgres, postgresql
- Language: Go
- Size: 2.29 MB
- Stars: 26
- Watchers: 12
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.