cmd/initDB

Create a database (schema) & a minimal set of DB object for a UnityBase ORM Will first create a temporary config with authentication disabled and
Example
//from a command line
     >ub cmd/initDB -u admin -p admin -dba postgres -dbaPwd postgreDBAPassword

     //from a code
     var initDB = require('cmd/initDB');
     var options = {
        "host": "http://localhost:888",
        "user": "admin",
        "pwd": "admin",
        "clientIdentifier": 3,
        "dropDatabase": true,
        "createDatabase": true,
        "dba": "postgres",
        "dbaPwd": "postgreDBAPassword"
    };
    initDB(options);

(require("cmd/initDB"))(options)

If DBA already create a database for you set both dropDatabase & createDatabase to false
Arguments:
  1. options (Object)
    Properties
    1. [clientIdentifier=3] (Number)  Identifier of the client. Must be between 2 and 8999. Number 1 is for UnityBase developer, 3 for test. Numbers > 100 is for real installations
    2. [dropDatabase=false] (Boolean)  Drop a database/schema first
    3. [createDatabase=false] (Boolean)  Create a new database/schema.
    4. [dba] (String)  A DBA name. Used in case createDatabase=true
    5. [dbaPwd] (String)  A DBA password. Used in case createDatabase=true

Methods

createFakeConfig() inner

Create a fake config with authentication disabled & empty domain. Return a default database driver name

createSuperUser(conn, dbDriverName) inner

Create a Everyone & admin roles and a SuperUser named admin with password admin
Arguments:
  1. conn (UBConnection)
  2. dbDriverName (String)