mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2026-02-02 17:35:08 +01:00
Add --url flag (#150)
This commit is contained in:
parent
d1b3334ff7
commit
a9aaaad1fb
3 changed files with 41 additions and 19 deletions
|
|
@ -312,6 +312,7 @@ Please note that the `wait` command does not verify whether your specified datab
|
|||
|
||||
The following command line options are available with all commands. You must use command line arguments in the order `dbmate [global options] command [command options]`.
|
||||
|
||||
* `--url, -u "protocol://host:port/dbname"` - specify the database url directly.
|
||||
* `--env, -e "DATABASE_URL"` - specify an environment variable to read the database connection URL from.
|
||||
* `--migrations-dir, -d "./db/migrations"` - where to keep the migration files.
|
||||
* `--schema-file, -s "./db/schema.sql"` - a path to keep the schema.sql file.
|
||||
|
|
@ -335,6 +336,14 @@ Creating: myapp_test
|
|||
Applying: 20151127184807_create_users_table.sql
|
||||
```
|
||||
|
||||
Alternatively, you can specify the url directly on the command line:
|
||||
|
||||
```sh
|
||||
$ dbmate -u "postgres://postgres@127.0.0.1:5432/myapp_test?sslmode=disable" up
|
||||
```
|
||||
|
||||
The only advantage of using `dbmate -e TEST_DATABASE_URL` over `dbmate -u $TEST_DATABASE_URL` is that the former takes advantage of dbmate's automatic `.env` file loading.
|
||||
|
||||
## FAQ
|
||||
|
||||
**How do I use dbmate under Alpine linux?**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue