https://github.com/borodyadka/db-migrate
Simple database (Postgres only) migration tool
https://github.com/borodyadka/db-migrate
database migration postgres
Last synced: 6 months ago
JSON representation
Simple database (Postgres only) migration tool
- Host: GitHub
- URL: https://github.com/borodyadka/db-migrate
- Owner: borodyadka
- License: mit
- Archived: true
- Created: 2021-02-24T12:46:58.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-30T15:14:20.000Z (about 5 years ago)
- Last Synced: 2024-06-20T10:14:41.061Z (about 2 years ago)
- Topics: database, migration, postgres
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DB Migrate
Supported databases:
* PostgreSQL;
## Usage
Docker:
```
docker run --rm -v/path/to/migrations:/migrations borodyadka/db-migrate up -d postgres://user:pass@host:5432/database
```
CLI:
```
migrate up -d postgres://user:pass@host:5432/database -s /path/to/migrations
```
Commands:
* `up [n]` — apply migrations, default `n` is `MaxInt32`
* `down [n]` — revert migrations, default `n` is `1`
* `create ` — create new migration
* `test` — tests connection
## Configuration
* `DATABSE_URL` or `--db-url`/`-d` in format `postgres://user:pass@host:5432/database?sslmode=disable`
* `HISTORY_TABLE` or `--history-table`/`-t`, default is `migrations_history`
* `LOG_LEVEL` or `--verbosity`/`-v` one of `debug`, `info`, `warning`, `error`
* `SOURCE_DIR` or `--source`/`-s` path to migrations dir, default is pwd
## TODO
* [ ] tests
## License
[MIT](LICENSE)