NAME

brep-migrate – create/drop/migrate brep databases

SYNOPSIS

brep-migrate --help
brep-migrate --version
brep-migrate [options] schema

DESCRIPTION

In its default mode brep-migrate creates the database schema if it doesn't already exist. Otherwise, it migrates the existing schema and data to the current version, if needed. The valid schema names are package and build.

If the --recreate option is specified, then brep-migrate instead recreates the database schema. That is, it drops all the existing tables (and their data) and then creates them from scratch.

If the --drop option is specified, then brep-migrate drops all the existing tables (and their data).

The --recreate and --drop options are mutually exclusive. When specified, they will cause brep-migrate to fail if the database schema requires migration. In this case you can either migrate the database first or drop the entire database using, for example, psql(1).

OPTIONS

--recreate
Recreate the database schema (all the existing data will be lost).
--drop
Drop the database schema (all the existing data will be lost).
--db-user|-u user
Database user name. If not specified, then operating system (login) name is used.
--db-password pass
Database password. If not specified, then login without password is expected to work.
--db-name|-n name
Database name. If not specified, then it is implicitly derived by prefixing the schema name with brep_.
--db-host|-h host
Database host name, address, or socket. If not specified, then connect to localhost using the operating system-default mechanism (Unix-domain socket, etc).
--db-port|-p port
Database port number. If not specified, the default port is used.
--pager path
The pager program to be used to show long text. Commonly used pager programs are less and more. You can also specify additional options that should be passed to the pager program with --pager-option. If an empty string is specified as the pager program, then no pager will be used. If the pager program is not explicitly specified, then brep-migrate will try to use less. If it is not available, then no pager will be used.
--pager-option opt
Additional option to be passed to the pager program. See --pager for more information on the pager program. Repeat this option to specify multiple pager options.
--help
Print usage information and exit.
--version
Print version and exit.

EXIT STATUS

0
Success.
1
Fatal error.
2
An instance of brep-migrate or some other brep utility is already running. Try again.
3
Recoverable database error. Try again.

BUGS

Send bug reports to the users@build2.org mailing list.