DS-002: Data Model Design Specification¶
| Property | Value |
|---|---|
| ID | DS-002 |
| Version | 1.0 |
| Status | Draft |
| Author | |
| Approved By | |
| Date |
Purpose¶
This document describes the data model design for Essert.MF. Database schemas are documented in detail in the project's schema documentation and validated by the SchemaAnalyzerTool.
arc42 Cross-References¶
| Design Aspect | arc42 Section | Key Content |
|---|---|---|
| Deployment topology | 07 — Deployment View | Database server configuration |
| Database contexts | 05 s5.2.3 — Infrastructure | 8 DbContexts, 175 tables |
| Connection management | 08 s8.6 — Configuration | Connection strings, pooling |
| Entity configuration | 08 s8.12 — Mapping Patterns | IEntityTypeConfiguration pattern |
Database Overview¶
| Database | DbContext | Tables | Domain |
|---|---|---|---|
| db_process | ProcessDataDbContext | 1 | Manufacturing processes |
| db_statistics | StatisticsDbContext | 23 | Measurements, messages, cycle times |
| db_changelogs | ChangelogsDbContext | 70 | Historical audit trail |
| db_essert | EssertDbContext | 3 | System configuration |
| db_productparameter | ProductParameterDbContext | 63 | Products, versions, parameters |
| db_robots | RobotsDbContext | 5 | Robot master/position data |
| db_wpc | WpcDbContext | 4 | Work piece carriers |
| db_systemparameter | SystemParameterDbContext | 8 | System-level machine parameters |
Total: 175 tables across 8 databases
ALCOA+ Compliance in Data Model¶
Every table follows the common column pattern (CC-05):
`UID` bigint(20) NOT NULL AUTO_INCREMENT,
`Timestamp` datetime DEFAULT NULL,
`Creator` varchar(30) DEFAULT NULL,
`CRC` bigint(20) DEFAULT NULL,
PRIMARY KEY (`UID`)
This ensures: - Attributable: Creator field identifies who created/modified the record - Legible: Structured data in typed columns - Contemporaneous: Timestamp records when the action occurred - Original: AUTO_INCREMENT UID ensures each record is unique and original - Accurate: CRC checksum detects unauthorized modifications
Schema Validation¶
The SchemaAnalyzerTool validates EF entity configurations against actual database schemas:
This tool is used during IQ to verify schema alignment.
EF Core Configuration Pattern¶
All entities use IEntityTypeConfiguration<T>:
builder.ToTable("tbl_tablename");
builder.HasKey(e => e.Uid);
builder.Property(e => e.Uid).ValueGeneratedOnAdd();
See arc42/09 ADR-006 for the EF Core decision rationale.
Supporting Evidence¶
- Database Schema Reference — Detailed schema specification for all databases, tables, and the UID/CRC column patterns