Skip to main content
Version: 3.0.1

Database Reference

Document Type: Reference (Tier 3) Status: Draft Last Updated: 2026-01-25


1. Purpose

This document provides a lookup reference for the PCR Analysis System database schema. It serves as authoritative documentation for:

  • Table dictionary with purpose and owner domain
  • Key columns (primary keys, foreign keys, important fields)
  • Index documentation
  • Foreign key relationships
  • Soft delete conventions

2. Database Overview

PropertyValue
Database PlatformAurora MySQL 8.0 (Serverless v2)
Primary Key StrategyOrdered UUIDs (string, 36 characters)
Timestamp PrecisionMicroseconds (datetime(6))
Decimal Precisiondecimal(32,10) for QC statistics
Soft Delete Columndeleted_at (nullable datetime)

3. Table Dictionary by Domain

3.1 Core Data Tables (RUNFILE Domain)

TablePurposeOwner DomainSoft Delete
runsRoot entity for imported thermocycler run filesRUNFILENo
wellsSample position (A1-H12) within a runRUNFILENo
observationsPer-target measurement data for each wellRUNFILENo
run_mixesMix composition per run (junction)RUNFILENo
run_targetsPer-target metrics for a runRUNFILENo

runs

ColumnTypeDescriptionFK
idUUIDPrimary key-
run_nameVARCHARImported file name-
uploaded_user_idUUIDUser who uploadedusers.id
modified_user_idUUIDUser who last modifiedusers.id
modifying_user_idUUIDUser currently modifyingusers.id
thermocycler_idUUIDInstrument usedthermocyclers.id
site_idUUIDSite ownershipsites.id
run_statusSMALLINTComputed status (1-4)-
calibration_statusSMALLINTCalibration state (0-2)-
num_label_errorsINTCount of label errors-
num_pending_resolutionsINTCount of pending resolutions-
resolution_statusVARCHARResolution workflow state-
file_hashVARCHARDeduplication hash-
runfile_created_atDATETIMEOriginal file creation-
has_calibratedBOOLEANCalibration completed-
has_exported_wellsBOOLEANAny wells exported-
bson_readings_file_pathVARCHARS3 path to readings-
custom_detailsJSONAdditional metadata-

Run Status Values:

ValueConstantMeaning
1ALL_WELLS_EXPORTEDAll wells exported
2ALL_WELLS_READY_FOR_EXPORTReady, none exported
3NO_EXPORT_ERRORS_TO_RESOLVEHas errors, no LIMS status
4SOME_WELLS_READY_FOR_EXPORT_WITH_ERRORS_TO_RESOLVEMixed state

wells

ColumnTypeDescriptionFK
idUUIDPrimary key-
run_idUUIDParent runruns.id
run_mix_idUUIDMix assignmentrun_mixes.id
mix_idUUIDDirect mix referencemixes.id
specimen_idUUIDSample type (nullable)specimens.id
extraction_instrument_idUUIDExtraction device (nullable)extraction_instruments.id
error_code_idUUIDSingle error code (nullable)error_codes.id
lims_statusVARCHARLIMS status code (string, not FK)-
resolution_codesTEXTPipe-delimited codes applied-
proposed_resolution_code_idUUIDPending resolutionresolution_codes.id
resolution_code_proposed_user_idUUIDUser who proposedusers.id
well_numberVARCHARPosition (A1-H12)-
sample_labelVARCHARSample identifier-
sample_nameVARCHARSample name-
batch_numberVARCHARBatch reference-
accessionVARCHARLab accession number-
role_idUUIDRole classificationroles.id
role_aliasVARCHARRole alias string-
control_label_idUUIDControl label mappingcontrol_labels.id
export_dateDATETIMEWhen exported (null = not exported)-
excludeBOOLEANManual exclusion flag-
is_flaggedBOOLEANFlagged for review-
is_crossoverBOOLEANCrossover sample flag-
site_idUUIDSite ownershipsites.id
extraction_dateDATETIMESample extraction date-
tissue_weightDECIMALSample weight-
quantity_multiplierDECIMALQuantification multiplier-
concentration_factorDECIMALConcentration factor-
reporting_quantityDECIMALCalculated quantity-
associate_well_ids_for_combined_outcomeJSONRelated wells for combined outcome-
archive_dependent_well_idsJSONWell IDs from other runs used during analysis (v3.0.1)-
missing_mixes_idsJSONMissing mix references-
invalid_raw_dataJSONData validation issues-
problemsJSONAnalysis problems-

Key Design Decision: Wells have a single error_code_id FK (not a junction table). One error code maximum per well.

LIMS Status Pattern: wells.lims_status stores a code string (e.g., "DETECTED", "RPT"). Lookup via lims_statuses.code, not FK constraint.

observations

ColumnTypeDescriptionFK
idUUIDPrimary key-
well_idUUIDParent wellwells.id
target_idUUIDTarget measuredtargets.id
role_idUUIDRole classificationroles.id
dye_idUUIDFluorophore useddyes.id
lot_idUUIDReagent lot (nullable)lots.id
role_to_target_mapping_idUUIDConfiguration mappingrole_to_target_mappings.id
machine_clsSMALLINTThermocycler classification (0-5)-
dxai_clsSMALLINTDXAI classification (0-5)-
final_clsSMALLINTFinal classification (0-5)-
manual_clsSMALLINTManual override classification-
proposed_clsSMALLINTProposed classification-
machine_ctDECIMALThermocycler CT value-
dxai_ctDECIMALDXAI CT value-
final_ctDECIMALFinal CT value-
manual_ctDECIMALManual override CT-
quantityDECIMALCalculated quantity-
sd_from_meanDECIMALStandard deviations from mean-
readingsJSONRaw fluorescence readings array-
problemsJSONAnalysis problems-
target_thresholdDECIMALTarget threshold used-
baseline_startINTBaseline calculation start-
baseline_endINTBaseline calculation end-
proposed_ct_providerSMALLINTProposed CT source (1=MACHINE, 2=DXAI)-
manual_ct_providerSMALLINTManual CT source-

Classification Values:

ValueConstantMeaning
0NegNegative
1PosPositive
2AmbAmbiguous
3Neg *N/ANegative, not applicable
4Pos *N/APositive, not applicable
5Amb *N/AAmbiguous, not applicable

3.2 Configuration Tables (KITCFG Domain)

TablePurposeOwner DomainSoft Delete
mixesPCR reaction mix definitionsKITCFGNo
targetsAnalyte/gene definitionsKITCFGNo
dyesFluorophore catalogKITCFGNo
rolesSample classification typesKITCFGNo
role_to_target_mappingsRole-mix-target junctionKITCFGNo
control_labelsEnhanced role mapping (v3.0.0+)KITCFGYes
specimensSample type catalogKITCFGNo
kitsKit groupingsKITCFGNo
kit_mixKit-mix junctionKITCFGNo

mixes

ColumnTypeDescriptionFK
idUUIDPrimary key-
mix_nameVARCHARDisplay name-
use_passive_dyeBOOLEANUses passive reference-
is_disabledBOOLEANSoft disable (global scope excludes)-
is_quantitativeBOOLEANQuantitative assay-
extraction_instrument_idUUIDDefault instrumentextraction_instruments.id
site_idUUIDSite ownershipsites.id

targets

ColumnTypeDescriptionFK
idUUIDPrimary key-
mix_idUUIDParent mixmixes.id
dye_idUUIDDetection dyedyes.id
target_nameVARCHARDisplay name-
export_nameVARCHARLIMS export name-
typeSMALLINT1=IC, 2=EC (nullable)-
is_passiveBOOLEANPassive reference target-
expected_thresholdDECIMALExpected threshold-
preferred_result_providerSMALLINT1=MACHINE, 2=DXAI-
should_check_cls_discrepancyBOOLEANEnable discrepancy check-
max_ct_for_cls_discrepancyDECIMALCT threshold for check-
ct_discrepancy_deltaDECIMALAllowed CT difference-
max_ct_for_ct_discrepancyDECIMALCT limit for discrepancy-
ct_inhibition_deltaDECIMALInhibition detection delta-
maximum_flDECIMALMaximum fluorescence-
minimum_fluorescenceDECIMALMinimum fluorescence-
minimum_fl_to_be_posDECIMALMinimum FL for positive-
min_dfDECIMALMinimum delta fluorescence-
max_dfDECIMALMaximum delta fluorescence-
calibration_file_pathVARCHARS3 path to calibration-
calibration_uploaded_atDATETIMECalibration upload date-
orderINTDisplay order-
site_idUUIDSite ownershipsites.id

control_labels

ColumnTypeDescriptionFK
idUUIDPrimary key-
role_idUUIDRole referenceroles.id
mix_idUUIDMix referencemixes.id
role_aliasVARCHARRole alias string-
is_strictBOOLEANStrict matching mode-
backup_mixes_idsJSONBackup mix UUIDs-
site_idUUIDSite ownershipsites.id
deleted_atDATETIMESoft delete timestamp-

3.3 Error & Resolution Tables (ERRORCODES Domain)

TablePurposeOwner DomainSoft Delete
error_codesError code definitionsERRORCODESYes
resolution_codesError-to-resolution mappingsERRORCODESNo
resolution_messagesResolution message templatesERRORCODESNo
lims_statusesLIMS status definitionsERRORCODESNo
well_resolutionsApplied resolution historyERRORCODESNo
well_lims_statusesComputed LIMS status cacheERRORCODESNo

error_codes

ColumnTypeDescriptionFK
idUUIDPrimary key-
error_codeVARCHARCode string (e.g., "CTRL_FAIL")-
error_messageVARCHARDisplay message template-
error_levelSMALLINT1=Well, 2=Mix, 3=Target-
error_typeSMALLINT0-4 (see below)-
lims_statusVARCHARAssociated LIMS status-
does_prevent_analyseBOOLEANBlocks further analysis-
is_inhibitedBOOLEANInhibition-related error-
causes_missing_mixesBOOLEANTriggers missing mix logic-
site_idUUIDSite ownershipsites.id
deleted_atDATETIMESoft delete timestamp-

Error Type Values:

ValueConstantOutcome TypeBlocks Export
0Label ErrorErrorYes
1ErrorErrorYes
2WarningWarningNo
3InformationInformationNo
4Associate Control ErrorErrorYes

Error Level Values:

ValueConstantDescription
1WellWell-level error
2MixMix-level error
3TargetTarget-level error

lims_statuses

ColumnTypeDescriptionFK
idUUIDPrimary key-
codeVARCHARStatus code (e.g., "DETECTED")-
messageVARCHARMessage template-
typeSMALLINT1=Warning, 2=Exclude, 4=Information-
resultSMALLINT1=DETECTED, 2=NOT_DETECTED (nullable)-
site_idUUIDSite ownershipsites.id

LIMS Status Type Values:

ValueConstantDescription
1WarningRe-test recommended (RPT, RXT)
2ExcludeWell excluded from export
4InformationNormal result

3.4 Quality Control Tables (QC Domain)

TablePurposeOwner DomainSoft Delete
westgard_limitsWestgard QC thresholdsQCYes
westgard_eventsWestgard violation catalogQCNo
control_range_settingsControl acceptance limitsQCNo

westgard_limits

ColumnTypeDescriptionFK
idUUIDPrimary key-
extraction_instrument_idUUIDInstrument referenceextraction_instruments.id
lot_idUUIDReagent lotlots.id
target_idUUIDTarget referencetargets.id
role_idUUIDRole referenceroles.id
sdDECIMAL(32,10)Standard deviation-
meanDECIMAL(32,10)Mean value-
historic_cvDECIMAL(32,10)Historical CV-
quant_or_ctSMALLINT1=Quant, 2=CT-
in_errorBOOLEANCurrently in error state-
is_duplicateBOOLEANDuplicate entry marker-
is_strictBOOLEANStrict matching mode-
role_aliasVARCHARRole alias for matching-
new_role_map_statusVARCHARNew role mapping status-
westgard_event_idUUIDCurrent violationwestgard_events.id
user_idUUIDLast modifierusers.id
caused_well_idUUIDWell that caused violationwells.id
site_idUUIDSite ownershipsites.id
deleted_atDATETIMESoft delete timestamp-

control_range_settings

ColumnTypeDescriptionFK
idUUIDPrimary key-
role_to_target_mapping_idUUIDConfiguration mappingrole_to_target_mappings.id
lot_idUUIDReagent lotlots.id
low_boundDECIMALLower acceptance limit-
up_boundDECIMALUpper acceptance limit-
quant_or_ctSMALLINT1=Quant, 2=CT-
site_idUUIDSite ownershipsites.id

3.5 User & Site Tables (USERMGMT/SITE Domain)

TablePurposeOwner DomainSoft Delete
usersUser accountsUSERMGMTYes
sitesPhysical lab locationsSITEYes
user_visible_sitesUser-site access junctionUSERMGMTNo

users

ColumnTypeDescriptionFK
idUUIDPrimary key-
usernameVARCHARLogin username-
emailVARCHAREmail address-
display_nameVARCHARDisplay name-
user_typeSMALLINT1-5 (see below)-
email_verifiedBOOLEANEmail verification status-
blockedBOOLEANAccount blocked-
mfa_enabledBOOLEANMFA status-
settingsJSONUser preferences-
logged_in_site_idUUIDCurrent sitesites.id
cognito_groupVARCHARCognito group membership-
deleted_atDATETIMESoft delete timestamp-

User Type Values:

ValueConstantDescription
1JUNIORJunior user
2SENIORSenior user
3CLIENT_ADMINClient administrator
4SUPER_ADMINSuper administrator
5MANAGERManager

sites

ColumnTypeDescriptionFK
idUUIDPrimary key-
nameVARCHARSite name-
codeVARCHARSite code-
custom_s3_folder_nameVARCHARCustom S3 folder-
deleted_atDATETIMESoft delete timestamp-

3.6 Instrument Tables (INSTRUMENTS Domain)

TablePurposeOwner DomainSoft Delete
thermocyclersThermocycler registryINSTRUMENTSNo
thermocycler_modelsThermocycler model catalogINSTRUMENTSNo
extraction_instrumentsExtraction device instancesINSTRUMENTSNo
extraction_modelsExtraction model catalogINSTRUMENTSNo
lotsReagent lot trackingINSTRUMENTSNo

thermocyclers

ColumnTypeDescriptionFK
idUUIDPrimary key-
thermocycler_typeVARCHARDevice type-
thermocycler_serial_numberVARCHARSerial number-
thermocycler_plate_sizeINTPlate capacity (96, 384)-
thermocycler_model_idUUIDModel referencethermocycler_models.id
site_idUUIDSite ownershipsites.id

extraction_instruments

ColumnTypeDescriptionFK
idUUIDPrimary key-
extraction_instrument_nameVARCHARDevice name-
extraction_model_idUUIDModel referenceextraction_models.id
site_idUUIDSite ownershipsites.id

3.7 Rules Engine Tables (RULES Domain)

TablePurposeOwner DomainSoft Delete
rulesRule definitionsRULESNo
rule_mappingsRule-target mappingsRULESNo

rules

ColumnTypeDescriptionFK
idUUIDPrimary key-
rule_nameVARCHARDisplay name-
programmatic_rule_nameVARCHARPHP class mapping-
precedenceINTExecution order-
is_enabledBOOLEANRule enabled-
site_idUUIDSite ownershipsites.id

Programmatic Rule Mapping: programmatic_rule_name maps to App\Analyzer\Rules\{StudlyCase}Rule.


3.8 Workflow Tables (WORKFLOW Domain)

TablePurposeOwner DomainSoft Delete
tagsRun categorization tagsWORKFLOWYes
run_tagRun-tag junctionWORKFLOWNo
commentsPolymorphic threaded commentsWORKFLOWNo
notificationsUser notificationsWORKFLOWNo

comments

ColumnTypeDescriptionFK
idUUIDPrimary key-
user_idUUIDAuthorusers.id
parent_idUUIDParent comment (nullable)comments.id
commentable_idUUIDPolymorphic target ID-
commentable_typeVARCHARPolymorphic type (Run, Well)-
textTEXTComment content-

tags

ColumnTypeDescriptionFK
idUUIDPrimary key-
nameVARCHARTag name-
archiveBOOLEANArchive tag-
site_idUUIDSite ownershipsites.id
deleted_atDATETIMESoft delete timestamp-

3.9 Audit Tables (AUDIT Domain)

TablePurposeOwner DomainSoft Delete
auditsImmutable audit trailAUDITNo

audits

ColumnTypeDescriptionFK
idUUIDPrimary key-
usernameVARCHARActor username-
areaVARCHARFunctional area-
change_typeVARCHARType of change-
actionVARCHARSpecific action-
change_locationVARCHARContext/resource-
value_beforeTEXTPrevious value-
value_afterTEXTNew value-
site_nameVARCHARSite context (nullable)-
created_atDATETIME(6)Microsecond timestamp-

Audit records are immutable. No updates or deletes permitted.


3.10 System Tables

TablePurposeOwner DomainSoft Delete
client_configurationsKey-value application settingsSETTINGSNo
global_mappingsCross-site configuration syncSETTINGSNo
featuresFeature flagsSETTINGSNo
help_itemsHelp documentationSYSTEMNo
help_videosHelp video linksSYSTEMNo
jobsLaravel queue jobsSYSTEMNo
telescope_entriesDebugging/monitoring (dev)SYSTEMNo

client_configurations

ColumnTypeDescriptionFK
idUUIDPrimary key-
nameVARCHARConfiguration key-
valueTEXTConfiguration value-
typeVARCHARValue type hint-
site_idUUIDSite ownership (nullable)sites.id

4. Foreign Key Relationships

4.1 Core Hierarchy

sites
└── runs (site_id)
└── wells (run_id)
└── observations (well_id)

4.2 Configuration Hierarchy

mixes
└── targets (mix_id)
└── observations (target_id)

roles
└── role_to_target_mappings (role_id)
└── control_labels (role_id)
└── westgard_limits (role_id)

4.3 User-Site Relationship

users ←→ user_visible_sites ←→ sites
└── logged_in_site_id → sites

4.4 Error-Resolution Relationship

error_codes
└── resolution_codes (error_code_id)
└── resolution_messages (resolution_message_id)

wells.error_code_id → error_codes.id (single FK)
wells.lims_status → lims_statuses.code (string lookup)

5. Index Documentation

5.1 Primary Indexes

All tables use UUID primary keys with clustered index.

5.2 Notable Secondary Indexes

TableIndex ColumnsPurpose
runssite_id, runfile_created_atSite-scoped listing
wellsrun_idWell lookup by run
wellssite_id, export_dateExport status queries
observationswell_idObservation lookup
auditsusername, created_atAudit trail queries
westgard_limitsextraction_instrument_id, target_id, role_id, lot_idQC lookups

6. Soft Delete Conventions

6.1 Tables Using Soft Delete

TableReason
usersAudit trail preservation
sitesHistorical reference
error_codesHistorical wells reference
control_labelsConfiguration history
westgard_limitsQC history
tagsRun categorization history

6.2 Soft Delete Behavior

  • Column: deleted_at (nullable datetime)
  • Default scope excludes soft-deleted records
  • withTrashed() scope includes soft-deleted
  • onlyTrashed() scope returns only soft-deleted
  • Soft-deleted records preserved for audit/historical joins

DocumentRelevance
SDS: Data ArchitectureEntity relationships and data flow
SDS: Configuration ReferenceConfiguration key documentation
SDD: ArchitectureOriginal schema documentation
SRS: KITCFGKit configuration requirements
SRS: ERRORCODESError code requirements