PrizmDoc® Viewer v14.0 Release - Updated
PrizmDoc Viewer / Developer Guide / 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 Viewing Packages

    NOTE: Use of a Central Database for PrizmDoc will be required in a future release in order to move towards eliminating server affinity.

    This topic covers how to set up your PAS database for use with viewing packages. 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 a manual step.

    The easiest way to create the tables 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
    
    

    NOTE: The create tables script should be run when upgrading PAS as well. This will update the database schema without modifying any data already stored in the 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