Adapt documentation for new configuration handling
This commit is contained in:
@@ -5,11 +5,32 @@
|
|||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
#### Configuration
|
#### Configuration
|
||||||
All configuration needed is done in .configuration.sh.
|
The credentials for each environment that could be updated is stored in the
|
||||||
|
`env/` directory.
|
||||||
|
|
||||||
|
***Example***
|
||||||
|
|
||||||
|
`env/default.conf` could look like this:
|
||||||
|
```
|
||||||
|
#!/bin/bash
|
||||||
|
export PSQL_OPTS="-h HOST_NAME -U USER_NAME"
|
||||||
|
export DB_NAME=DATABASE_NAME
|
||||||
|
```
|
||||||
|
|
||||||
|
Create one file for each environment you'd be able to migrate.
|
||||||
|
|
||||||
|
When `db-upgrade` is issued, it takes the first part of any name as argument and
|
||||||
|
performs the migration on selected environment.
|
||||||
|
|
||||||
|
`$ ./db-upgrade localhost` would for example find a file named `localhost.conf`
|
||||||
|
and use the credentials inside for the migration.
|
||||||
|
|
||||||
To avoid having to enter password for selected user on each run, just use a
|
To avoid having to enter password for selected user on each run, just use a
|
||||||
[.pgpass](http://www.postgresql.org/docs/9.3/static/libpq-pgpass.html) file.
|
[.pgpass](http://www.postgresql.org/docs/9.3/static/libpq-pgpass.html) file.
|
||||||
|
|
||||||
|
`db-upgrade` assumes the `default` environment should be used if it's argument
|
||||||
|
is omitted. So, start by creating an initial `default.conf` with credentials for your localhost or some non-critical environment.
|
||||||
|
|
||||||
#### Migration files
|
#### Migration files
|
||||||
The files in the /migrations directory are changes to the scheme, not the full
|
The files in the /migrations directory are changes to the scheme, not the full
|
||||||
scheme.
|
scheme.
|
||||||
@@ -50,5 +71,5 @@ CREATE TABLE database_versions (
|
|||||||
|
|
||||||
To do the actual migration, then just run:
|
To do the actual migration, then just run:
|
||||||
```
|
```
|
||||||
# ./db-upgrade
|
# ./db-upgrade [ENVIRONMENT NAME]
|
||||||
```
|
```
|
||||||
|
|||||||
Vendored
Vendored
-3
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
export PSQL_OPTS="-h localhost -U root"
|
|
||||||
export DB_NAME=photowall
|
|
||||||
Reference in New Issue
Block a user