Entity Map

Authoritative registry of every database table in Kartorium. Tables are grouped by prefix: core (no prefix), asset_, oee_, ops_, and jobs.

Table Registry

Core Tables

TablePurposeParent FKStatus
s3_object_referencesS3 file/folder references with bucket and keyCANONICAL
usersAuth0 user accounts with org membershipCANONICAL
organization_settingsPer-org UI visibility and default home pageSUPPORT
organization_feature_flagsPer-org feature toggles (stations, jobs, analytics, etc.)SUPPORT
organization_prefixesPer-org auto-numbering prefixes for batches and jobsSUPPORT
projects3D viewer projects containing scenesCANONICAL
permissionsUser-to-project permission grantsusers, projectsJUNCTION
scenesOrdered scenes within a project (linked list)projectsCANONICAL
models3D model metadata (mesh, point-cloud, splat)CANONICAL
model_filesLinks models to S3 object referencesmodels, s3_object_referencesJUNCTION
file_referencesLegacy file metadata with hash deduplicationmodelsCANONICAL
file_embeddingsVector embeddings (pgvector) for semantic searchfile_references, s3_object_referencesSUPPORT
scene_propertiesKey-value properties attached to scenesscenesSUPPORT
model_permissionsUser-to-model permission grantsusers, modelsJUNCTION
featuresInteractive objects placed in scenes (markers, shapes, models)scenes, modelsCANONICAL
feature_filesLinks features to S3 object referencesfeatures, s3_object_referencesJUNCTION
feature_propertiesKey-value properties attached to featuresfeaturesSUPPORT
feature_custom_fieldsSimple key-value custom fields on featuresfeaturesSUPPORT
interactionsInteraction definitions on features (click, hover)featuresCANONICAL
actionsOrdered action sequences triggered by interactions (linked list)interactionsCANONICAL
connectionsExternal data connections bound to a scenescenesCANONICAL
connection_propertiesKey-value properties on connectionsconnectionsSUPPORT
tokensShort-lived share tokens for public accessusersSUPPORT

Asset Manager Tables (asset_)

TablePurposeParent FKStatus
asset_typesOrganization-scoped asset type definitionsCANONICAL
assetsIndividual asset instances of an asset typeasset_typesCANONICAL
asset_field_pagesGrouping pages for asset type fieldsasset_typesSUPPORT
asset_permissionsUser-to-asset-type permission grantsasset_types, usersJUNCTION
asset_fieldsField definitions per asset type (ordered linked list)asset_types, asset_field_pagesCANONICAL
asset_field_valuesField values per asset instanceassets, asset_fieldsCANONICAL
asset_field_values_filesLinks asset field values to legacy file referencesasset_field_values, file_referencesJUNCTION
asset_field_value_s3_filesLinks asset field values to S3 object referencesasset_field_values, s3_object_referencesJUNCTION
asset_historiesAudit log entries per assetassetsSUPPORT

OEE Tables (oee_)

TablePurposeParent FKStatus
oee_sitesManufacturing sites with OEE targets and availability modeCANONICAL
oee_downtime_groupsDowntime Reason category groups (unplanned/planned/idle)oee_sitesCANONICAL
oee_downtime_reasonsIndividual downtime reason codes within a groupoee_downtime_groupsCANONICAL
oee_incident_groupsIncident Reason category groups at site leveloee_sitesCANONICAL
oee_incident_reasonsIndividual incident reason codes within a groupoee_incident_groupsCANONICAL
oee_abort_groupsScrap Reason abort category groupsoee_sitesCANONICAL
oee_abort_reasonsIndividual abort reason codes within a groupoee_abort_groupsCANONICAL
oee_systemsProduction lines within a siteoee_sitesCANONICAL
oee_equipmentequipment with rate config and OEE targetsoee_sitesCANONICAL
oee_equipment_connectionsDirected edges between equipment for process flow diagramsoee_sites, oee_equipmentSUPPORT
oee_compatible_equipmentDeclares which equipment can substitute for each other on batchesoee_equipmentJUNCTION
oee_equipment_positionsGrid coordinates for equipment process flow layoutoee_sites, oee_equipmentSUPPORT
oee_stationsStations within a site and systemoee_sites, oee_systemsLEGACY1
oee_station_equipmentJunction: equipment allowed at a stationoee_stations, oee_equipmentLEGACY1
oee_machine_eventsUnified event log: batches, downtimes, and incidents on equipmentoee_sites, oee_equipment, ops_stationsCANONICAL
oee_product_familiesProduct family groupings (org-scoped)LEGACY2
oee_productsProduct definitions (site-scoped) with production parametersoee_sites, oee_product_familiesLEGACY2
oee_product_equipment_configPer-product-per-equipment standard hours overrideops_products, oee_equipmentCANONICAL
oee_batch_detailsExtended batch fields (product, quantities, status) on a machine eventoee_machine_events, ops_products, ops_stationsCANONICAL
oee_notes_detailsExtended note/shift-log content on a machine eventoee_machine_eventsCANONICAL
oee_machine_event_equipmentJunction: links one event to multiple equipmentoee_machine_events, oee_equipmentJUNCTION
oee_event_batch_linksJunction: links downtime/incident events to affected batch eventsoee_machine_eventsJUNCTION
oee_batch_queueOrdered queue of upcoming batches per equipmentoee_sites, oee_equipment, oee_machine_eventsCANONICAL
oee_batch_operatorsJunction: operator (user) assignments per batchoee_batch_detailsJUNCTION
oee_batch_equipmentJunction: additional equipment assignments per batchoee_batch_details, oee_equipmentJUNCTION
oee_batch_time_entriesLabor and machine time tracking entries per batchoee_batch_details, oee_equipmentCANONICAL
oee_analytics_chartsSaved analytics chart configurations per siteoee_sitesSUPPORT
oee_equipment_custom_fieldsCustom field definitions shown in batch start/complete modals per equipmentoee_equipmentCANONICAL
oee_station_custom_fieldsCustom field definitions shown in batch start/complete modals per stationops_stationsCANONICAL
oee_batch_custom_field_valuesDenormalized custom field values captured per batch eventoee_machine_events, oee_equipment, ops_stations, oee_station_custom_fieldsCANONICAL

Operations Tables (ops_)

TablePurposeParent FKStatus
ops_stationsStations — the canonical station entity with production configoee_sites, oee_systemsCANONICAL
ops_station_equipmentJunction: equipment assigned to a stationops_stations, oee_equipmentJUNCTION
ops_station_connectionsDirected edges between stations for process flow diagramsoee_sites, ops_stationsSUPPORT
ops_product_familiesProduct families (site-scoped, with standard hours)oee_sitesCANONICAL
ops_productsProducts within a family (with quantities and scrap targets)ops_product_familiesCANONICAL
ops_station_product_standardsPer-product-per-station standard hours overrideops_products, ops_stationsSUPPORT
ops_station_batch_queueOrdered queue of upcoming batches per station (with routing info)oee_sites, ops_stations, oee_machine_eventsCANONICAL
ops_station_incident_groupsIncident category groups scoped to stationsoee_sitesCANONICAL
ops_station_incident_reasonsIndividual incident reason codes for station incidentsops_station_incident_groupsCANONICAL
ops_station_eventsStation-level event log (currently incidents only)oee_sites, ops_stations, ops_station_incident_reasonsCANONICAL
ops_jobsJobs — work orders tracked through stationsoee_sites, ops_stations, ops_product_familiesCANONICAL
ops_job_station_historyAudit trail of a job’s movement between stationsops_jobs, ops_stationsSUPPORT
job_outlier_flagsStatistical outlier flags on jobs for reviewops_jobsSUPPORT
ops_labor_entriesClock-in/clock-out labor time entries per user, job, or batchoee_sites, users, ops_jobs, oee_machine_eventsCANONICAL
ops_station_positionsGrid coordinates for station process flow layoutoee_sites, ops_stationsSUPPORT

Background Job Tables

TablePurposeParent FKStatus
jobsBackground processing job queue (file conversions, etc.)CANONICAL
job_historyCompleted background job audit logSUPPORT

Entity Hierarchy

flowchart TD
    ORG["Organization (Auth0 org_id)"]

    ORG --> SITE["oee_sites"]
    ORG --> PROJ["projects"]
    ORG --> ATYP["asset_types"]
    ORG --> ORGS["organization_settings\norganization_feature_flags\norganization_prefixes"]

     Asset Manager branch
    ATYP --> ASSET["assets"]
    ATYP --> AFIELD["asset_fields"]
    ASSET --> AFV["asset_field_values"]

    %% OEE / Manufacturing branch
    SITE --> SYS["oee_systems (production lines)"]
    SITE --> EQUIP["oee_equipment (machines)"]
    SITE --> OPFAM["ops_product_families"]
    SITE --> DTG["oee_downtime_groups → reasons"]
    SITE --> ING["oee_incident_groups → reasons"]
    SITE --> ABG["oee_abort_groups → reasons"]
    SITE --> CHART["oee_analytics_charts"]

    SYS --> STAT["ops_stations"]
    STAT --> SE["ops_station_equipment → oee_equipment"]
    STAT --> SC["ops_station_connections"]
    STAT --> SBQ["ops_station_batch_queue"]
    STAT --> SEVT["ops_station_events"]
    STAT --> SCF["oee_station_custom_fields"]

    OPFAM --> PROD["ops_products"]

    EQUIP --> EC["oee_equipment_connections"]
    EQUIP --> ECF["oee_equipment_custom_fields"]

    SITE --> ME["oee_machine_events"]
    ME -->|"event_type = batch"| BD["oee_batch_details → ops_products"]
    ME -->|"event_type = downtime"| DTREF["→ oee_downtime_reasons"]
    ME -->|"event_type = incident"| INREF["→ oee_incident_reasons"]

    BD --> BO["oee_batch_operators"]
    BD --> BE["oee_batch_equipment"]
    BD --> BTE["oee_batch_time_entries"]
    BD --> BCV["oee_batch_custom_field_values"]

    ME --> EBL["oee_event_batch_links"]
    ME --> MEE["oee_machine_event_equipment"]

    SITE --> JOB["ops_jobs"]
    JOB --> JSH["ops_job_station_history"]
    JOB --> JOF["job_outlier_flags"]

    SITE --> LAB["ops_labor_entries"]

Deprecation Map

Legacy TableUse InsteadNotes
oee_stationsops_stationsops_stations is the canonical station entity. oee_stations was the original prototype; new code references ops_stations exclusively.
oee_station_equipmentops_station_equipmentFollows the station migration — use ops_station_equipment for station-equipment assignments.
oee_product_familiesops_product_familiesops_product_families is site-scoped with family_code; oee_product_families is org-scoped without a code. New product work uses the ops_ tables.
oee_productsops_productsops_products references ops_product_families and uses product_code/product_name naming. oee_batch_details.product_id already points to ops_products.

Footnotes

  1. oee_stations and oee_station_equipment are the original station tables. All new code uses ops_stations and ops_station_equipment. The legacy tables remain in the schema but are not referenced by current application code. 2

  2. oee_product_families and oee_products are the original product tables. All new code uses ops_product_families and ops_products. oee_batch_details.product_id already references ops_products. 2