FABSYS_DB-INIT(1)

NAME
fabsys_db-init - Initialize the SQL database for FABS

SYNOPSIS
fabsys db-init [--force] [--db-version version]
    (--sql | --exec)

DESCRIPTION
The fabsys db-init command helps initialize the backend SQL database that is used by FABS. fabsys db-init can either execute the relevant SQL itself, or print out the SQL for an administrator to execute later.

Note that you should configure your database access string (see fabsys_config(1)) before running this command. The SQL generated by this command is tailored to specific database engines, and so may not work if the configured db URL does not match the actual database you are trying to use. For example, if the configured database in fabsys_config(1) is a SQLite database, and you try to run the SQL generated by fabsys db-init in an Oracle database, it may not work. To get SQL appropriate for an Oracle database, you must configure an Oracle URL in fabsys_config(1) before running fabsys db-init.

OPTIONS

--sql
    With this option, fabsys db-init will print out the SQL to run to initialize the database. This can be useful if FABS does not normally have access to create tables in the configured SQL database.

--exec
    With this option, fabsys db-init will run the relevant SQL itself to initialize the database. To do this, FABS must have enough rights in the database to be able to issue statements such as CREATE TABLE. The db connection information is specified in the db/url configuration directive, described in fabsys_config(1).

--force
    By default, initializing the FABS database will encounter errors if it looks like the database was already initialized. By giving the --force option, fabsys db-init will attempt to overwrite the database, by clearing out any existing information that it finds before initializing the database.

    If the --sql option is given, this means we generate DROP TABLE statements before our CREATE TABLE statements.

--db-version version
    Specify the version of the database to initialize. This should never be specified under normal operation, since FABS will refuse to use a database that is not for the most recent version.

    This option is only useful for testing purposes; for example, to test db upgrades.

PRIVILEGED REQUIRED
The issuer of this command must be able to read the FABS configuration (specifically, the database access information), typically in /etc/fabs/fabs.yaml.d/.

COPYRIGHT
Copyright (c) 2015, Sine Nomine Associates.

See the provided LICENSE file for licensing terms.