Skip to content

Database Entities

DeclanBuckley edited this page Jan 25, 2021 · 3 revisions

Home / Developer / Database Tier / Entities

Data Entities.

Summary.

This page outlines the data entities employed in the PxStat database. While all database entities are scripted via datamodel.sql, stored procedures, views and user-defined datatypes each have their own definition file. If you are contributing to the project by creating or amending any of these entities, you must submit a file in the required folder for the purpose of source control.

Tables.

Tables are created via the DDL. See datamodel.sql.

Views.

Views are created via DDL but are also scripted individually and held in their own files in the \db\Views folder.

User Defined Datatypes.

These are created via DDL but are also scripted individually and held in their own files in the \db\Types folder.

Stored Procedures.

These are created via DDL but are also scripted individually and held in their own files in the \db\StoredProcedures folder.

Sql Server jobs.

In PxStat, one Sql Server job exists, i.e. DataMatrixDeleteEntities_ databaseName. Because jobs exist at a server rather than at a database level, the name will depend on the database it applies to. So, for example, if this job is to run on a database called 'pxstat', the job will be called 'DataMatrixDeleteEntities_pxstat'.

The purpose of this job is to check if any matrix has been soft deleted and, if so, hard delete any data associated with the matrix entry. This typically runs after data has been uploaded, because uploading will frequently upgrade existing datasets and make the associated data redundant.

The job is created via the \db\Jobs\DataMatrixDeleteEntities.sql script.

Clone this wiki locally