PrizmDoc® v14.1 Release - Updated
PrizmDoc / Developer Guide / PrizmDoc Application Services (PAS) / Set up Your Database for use with PAS
In This Topic
    Set up Your Database for use with PAS
    In This Topic

    Database for PAS

    This topic covers how to set up your PAS database manually. For information on configuring PAS to communicate with your database, see the PAS Configuration topic.

    Creating the required database tables

    Some databases, like Microsoft SQL Server, require that the tables be created before PAS can use them. This is done automatically at startup, but you can also trigger it manually.

    The easiest way to create the tables manually is to run the scripts available as part of PAS:

    On Windows:

    cd C:\Prizm\pas\db
    createtables.cmd
    
    

    For Docker:

    docker run --rm -e ACCEPT_EULA=YES --volume $pwd/config:/config --volume $pwd/data:/data --volume $pwd/logs:/logs accusoft/prizmdoc-application-services init-database
    
    

    This will create the required tables in the database that is configured through the PAS configuration file. If you need to change any of the configuration temporarily when running these scripts (such as using a different user that has the required privileges to create tables), you can specify any of the database.* properties from the PAS configuration file as command line flags, as such:

    On Windows:

    createtables.cmd --user=createTablesUser --password=Pa55w0rd
    
    

    For Docker:

    docker run --rm -e ACCEPT_EULA=YES --env DATABASE_USER=createTableUser --env DATABASE_PASSWORD=Pa55w0rd --volume $pwd/config:/config --volume $pwd/data:/data --volume $pwd/logs:/logs accusoft/prizmdoc-application-services init-database
    
    

    Advanced use

    For advanced database administrators, you may want to inspect and manually run the SQL scripts to create tables. You can use this by adding the --export-scripts flag to the above commands, as shown below.

    NOTE: This is currently only supported for Windows deployments.

    createtables.cmd --export-scripts --filepath=/path/to/script.sql
    
    

    When running this command, the configured database will not be changed, and the script will be saved to the output file specified. These SQL scripts can be found:

    C:\Prizm\pas\db\mssql-scripts
    C:\Prizm\pas\db\mysql-scripts