Technical #database #schema #tables #postgres #drizzle #relations #data-model #lineage #herobm_core Raw .md

Database Schema Reference

Comprehensive relational database schema reference, entity definitions, table columns, data types, constraints, and entity-relationship lineage for herobm_core.

Routes: /admin/developers /admin/system-logs

Database Schema Reference

The HeroBM application core database (herobm_core) is a fully typed, relational PostgreSQL database managed via Drizzle ORM. It enforces strict referential integrity, domain state machines, event sourcing audit logs, and transactional outbox queuing.


Architectural Principles & Standards

[!NOTE] 1. UUID Primary Keys: Every operational table uses a uuid primary key with gen_random_uuid() to prevent auto-increment enumeration vulnerabilities and facilitate safe distributed ingestion.

[!IMPORTANT] 2. Enforced Foreign Keys & Referential Integrity: Inter-entity relationships strictly enforce foreign keys. Cascading deletes are restricted to dependent line items (e.g., order lines, bin contents), while master dimension records use RESTRICT rules.

[!TIP] 3. Microsoft CDM & Schema.org Conventions: Column names follow snake_case naming aligned with common enterprise standards (account_number, currency_code, state_code, created_on, modified_on).

[!WARNING] 4. Explicit State & No Magic Defaults: Entity lifecycle states are strictly governed by application state machines and check constraints. No default values are used for critical financial states.


Core Lineage & Entity Relationships

The following entity-relationship diagram illustrates the operational dependencies between CRM, Catalog, Sales, Purchasing, Warehouse, and General Ledger domains:

flowchart TD
    subgraph CRM ["CRM & Stakeholders"]
        actors["actors"]
        contacts["contacts"]
        customers["customers"]
        suppliers["suppliers"]
    end

    subgraph Catalog ["Catalog"]
        products["products"]
    end

    subgraph Sales ["Sales & Fulfilment"]
        sales_orders["sales_orders"]
        sales_order_line_items["sales_order_lines"]
        sales_order_shipments["sales_shipments"]
        sales_invoices["sales_invoices"]
    end

    subgraph Procurement ["Purchasing & Receiving"]
        purchase_orders["purchase_orders"]
        purchase_order_line_items["purchase_order_lines"]
        goods_received["goods_received"]
        purchase_invoices["purchase_invoices"]
    end

    subgraph Inventory ["Warehouse & Ledger"]
        locations["locations"]
        bins["bins"]
        inventory_entries["inventory_entries"]
        inventory_ledger["inventory_ledger"]
    end

    subgraph GL ["General Ledger"]
        gl_accounts["gl_accounts"]
        gl_journal_entries["gl_journal_entries"]
        gl_journal_lines["gl_journal_lines"]
        payment_entries["payment_entries"]
    end

    actors -->|referred_by_actor_id| actors
    contacts -->|referred_by_contact_id| actors
    actors -->|referred_by_actor_id| contacts
    contacts -->|referred_by_contact_id| contacts
    actors -->|actor_id| customers
    gl_journal_entries -->|reversed_by| gl_journal_entries
    gl_accounts -->|gl_account_id| gl_journal_lines
    gl_journal_entries -->|journal_entry_id| gl_journal_lines
    locations -->|location_id| goods_received
    suppliers -->|vendor_id| goods_received
    bins -->|bin_id| inventory_ledger
    inventory_entries -->|entry_id| inventory_ledger
    locations -->|location_id| inventory_ledger
    products -->|product_id| inventory_ledger
    gl_accounts -->|gl_account_bank| payment_entries
    purchase_orders -->|purchase_order_id| purchase_invoices
    suppliers -->|vendor_id| purchase_invoices
    locations -->|delivery_location_id| purchase_orders
    suppliers -->|vendor_id| purchase_orders
    customers -->|customer_id| sales_invoices
    sales_orders -->|sales_order_id| sales_invoices
    locations -->|fulfillment_location_id| sales_order_shipments
    sales_orders -->|sales_order_id| sales_order_shipments
    customers -->|customer_id| sales_orders
    locations -->|fulfillment_location_id| sales_orders
    actors -->|actor_id| suppliers
    locations -->|location_id| work_orders
    bins -->|output_bin_id| work_orders
    products -->|product_id| work_orders
    bins -->|wip_bin_id| work_orders

Schema Summary & Table Directory

The herobm_core schema contains 116 tables, 1228 columns, and 233 foreign key relationships across 8 business domains:

TableDomainPrimary KeyColumnsForeign KeysLive Rows
actor_actor_linksCRM & Stakeholderslink_id52
actor_contact_linksCRM & Stakeholderslink_id62
actor_notesCRM & Stakeholdersnote_id52
actorsCRM & Stakeholdersactor_id242
contactsCRM & Stakeholderscontact_id142
customer_delivery_addressesCRM & Stakeholdersid171
customer_groupsCRM & Stakeholderscustomer_group_id146
customersCRM & Stakeholderscustomer_id244
project_actorsCRM & Stakeholdersproject_actor_id52
project_contactsCRM & Stakeholdersproject_contact_id52
project_notesCRM & Stakeholdersnote_id52
projectsCRM & Stakeholdersproject_id81
trading_termsCRM & Stakeholderstrading_terms_id100
discount_matrixProducts & Catalogdiscount_matrix_id73
product_componentsProducts & Catalogcomponent_id72
product_default_binsProducts & Catalogproduct_default_bin_id93
product_groupsProducts & Catalogproduct_group_id96
product_imagesProducts & Catalogimage_id101
product_suppliersProducts & Catalogproduct_supplier_id182
product_uomsProducts & Catalogproduct_uom_id72
productsProducts & Catalogproduct_id316
uom_dictionaryProducts & Cataloguom_code30
backordersSales & Distributionbackorder_id1510
sales_credit_note_linesSales & Distributioncredit_note_line_id134
sales_credit_notesSales & Distributioncredit_note_id194
sales_eventsSales & Distributionevent_id80
sales_invoice_linesSales & Distributioninvoice_line_id62
sales_invoicesSales & Distributioninvoice_id232
sales_order_linesSales & Distributionsales_order_line_id195
sales_order_picksSales & Distributionpick_id104
sales_order_return_linesSales & Distributionreturn_line_id143
sales_order_returnsSales & Distributionreturn_id92
sales_order_shipment_linesSales & Distributionshipment_line_id42
sales_order_shipmentsSales & Distributionshipment_id112
sales_ordersSales & Distributionsales_order_id322
goods_receivedPurchasing & Procurementgoods_received_id102
goods_received_linesPurchasing & Procurementgoods_received_line_id94
procurement_eventsPurchasing & Procurementevent_id80
purchase_debit_note_linesPurchasing & Procurementdebit_note_line_id104
purchase_debit_note_shipmentsPurchasing & Procurementdebit_note_shipment_id42
purchase_debit_notesPurchasing & Procurementdebit_note_id193
purchase_invoice_linesPurchasing & Procurementinvoice_line_id104
purchase_invoice_receiptsPurchasing & Procurementinvoice_receipt_id42
purchase_invoicesPurchasing & Procurementinvoice_id232
purchase_order_linesPurchasing & Procurementpurchase_order_line_id153
purchase_order_return_linesPurchasing & Procurementreturn_line_id73
purchase_order_return_shipment_linesPurchasing & Procurementshipment_line_id42
purchase_order_return_shipmentsPurchasing & Procurementshipment_id102
purchase_order_returnsPurchasing & Procurementreturn_id81
purchase_ordersPurchasing & Procurementpurchase_order_id172
supplier_expiriesPurchasing & Procurementexpiry_id81
supplier_groupsPurchasing & Procurementsupplier_group_id176
suppliersPurchasing & Procurementvendor_id264
bin_contentsWarehouse & Inventorybin_content_id52
binsWarehouse & Inventorybin_id121
inventory_entriesWarehouse & Inventoryentry_id100
inventory_eventsWarehouse & Inventoryevent_id80
inventory_ledgerWarehouse & Inventoryledger_id75
locationsWarehouse & Inventorylocation_id140
transfer_order_linesWarehouse & Inventorytransfer_order_line_id62
transfer_order_picksWarehouse & Inventorypick_id104
transfer_order_receipt_linesWarehouse & Inventoryreceipt_line_id74
transfer_order_receiptsWarehouse & Inventoryreceipt_id71
transfer_order_shipment_linesWarehouse & Inventoryshipment_line_id64
transfer_order_shipmentsWarehouse & Inventoryshipment_id101
transfer_ordersWarehouse & Inventorytransfer_order_id102
warehouse_eventsWarehouse & Inventoryevent_id80
zonesWarehouse & Inventoryzone_id91
activitiesFinancials & General Ledgeractivity_id70
bank_statement_linesFinancials & General Ledgerline_id134
cost_centersFinancials & General Ledgercost_center_id70
csv_mapping_profilesFinancials & General Ledgerprofile_id120
exchange_ratesFinancials & General Ledgerexchange_rate_id70
financial_eventsFinancials & General Ledgerevent_id80
gl_accountsFinancials & General Ledgergl_account_id120
gl_fiscal_periodsFinancials & General Ledgerperiod_id140
gl_journal_entriesFinancials & General Ledgerjournal_entry_id101
gl_journal_linesFinancials & General Ledgerjournal_line_id176
gl_match_groupsFinancials & General Ledgermatch_group_id51
gl_reconciliationsFinancials & General Ledgerreconciliation_id81
gl_settingsFinancials & General Ledgersettings_id2820
payment_allocationsFinancials & General Ledgerallocation_id71
payment_entriesFinancials & General Ledgerpayment_id191
payment_linesFinancials & General Ledgerpayment_line_id52
reconciliation_eventsFinancials & General Ledgerevent_id80
reconciliation_rulesFinancials & General Ledgerrule_id173
tax_categoriesFinancials & General Ledgertax_category_id70
tax_position_mappingsFinancials & General Ledgermapping_id43
tax_positionsFinancials & General Ledgertax_position_id30
work_order_componentsManufacturing & Work Orderswork_order_component_id52
work_order_picksManufacturing & Work Orderspick_id93
work_ordersManufacturing & Work Orderswork_order_id164
_pipeline_jobsSystem, Security & Telemetryjob_id80
api_keysSystem, Security & Telemetryapi_key_id80
app_settingsSystem, Security & Telemetrysettings_id317
business_report_eventsSystem, Security & Telemetryevent_id80
business_reportsSystem, Security & Telemetryid80
casbin_ruleSystem, Security & Telemetryid80
email_eventsSystem, Security & Telemetryevent_id80
email_outboxSystem, Security & Telemetryid140
group_eventsSystem, Security & Telemetryevent_id80
integration_eventsSystem, Security & Telemetryevent_id80
integrationsSystem, Security & Telemetryintegration_id60
macrosSystem, Security & Telemetrymacro_id60
master_data_eventsSystem, Security & Telemetryevent_id80
organizationSystem, Security & Telemetryorganization_id190
outboxSystem, Security & Telemetryoutbox_id100
pdf_template_contextsSystem, Security & Telemetry21
pdf_template_hooksSystem, Security & Telemetryid51
pdf_templatesSystem, Security & Telemetryid90
system_eventsSystem, Security & Telemetryevent_id80
user_eventsSystem, Security & Telemetryevent_id71
user_settingsSystem, Security & Telemetryuser_id61
user_two_factorSystem, Security & Telemetryuser_id71
usersSystem, Security & Telemetryuser_id80
webhooksSystem, Security & Telemetrywebhook_id60

Foreign Key Relationships Catalog

The table below catalogs all referential constraints across the application database:

From TableColumnTo TableTarget ColumnOn Delete Action
actor_actor_linkssource_actor_idactorsactor_idRESTRICT
actor_actor_linkstarget_actor_idactorsactor_idRESTRICT
actor_contact_linksactor_idactorsactor_idRESTRICT
actor_contact_linkscontact_idcontactscontact_idRESTRICT
actor_notesactor_idactorsactor_idRESTRICT
actor_notescreated_by_idusersuser_idRESTRICT
actorsreferred_by_actor_idactorsactor_idRESTRICT
actorsreferred_by_contact_idcontactscontact_idRESTRICT
app_settingsdefault_customer_tax_position_idtax_positionstax_position_idRESTRICT
app_settingsdefault_customer_terms_idtrading_termstrading_terms_idRESTRICT
app_settingsdefault_fulfillment_location_idlocationslocation_idRESTRICT
app_settingsdefault_purchase_tax_category_idtax_categoriestax_category_idRESTRICT
app_settingsdefault_sales_tax_category_idtax_categoriestax_category_idRESTRICT
app_settingsdefault_supplier_tax_position_idtax_positionstax_position_idRESTRICT
app_settingsdefault_supplier_terms_idtrading_termstrading_terms_idRESTRICT
backordersdemand_work_order_idwork_orderswork_order_idRESTRICT
backordersproduct_idproductsproduct_idRESTRICT
backorderspurchase_order_idpurchase_orderspurchase_order_idRESTRICT
backorderspurchase_order_line_idpurchase_order_linespurchase_order_line_idRESTRICT
backorderssales_order_idsales_orderssales_order_idRESTRICT
backorderssales_order_line_idsales_order_linessales_order_line_idRESTRICT
backorderstransfer_order_idtransfer_orderstransfer_order_idRESTRICT
backorderstransfer_order_line_idtransfer_order_linestransfer_order_line_idRESTRICT
backorderswork_order_component_idwork_order_componentswork_order_component_idRESTRICT
backorderswork_order_idwork_orderswork_order_idRESTRICT
bank_statement_linesgl_account_idgl_accountsgl_account_idRESTRICT
bank_statement_linesmatch_group_idgl_match_groupsmatch_group_idRESTRICT
bank_statement_linesmatched_journal_line_idgl_journal_linesjournal_line_idRESTRICT
bank_statement_linesreconciliation_idgl_reconciliationsreconciliation_idRESTRICT
bin_contentsbin_idbinsbin_idcascade
bin_contentsproduct_idproductsproduct_idcascade
binszone_idzoneszone_idRESTRICT
contactsreferred_by_actor_idactorsactor_idRESTRICT
contactsreferred_by_contact_idcontactscontact_idRESTRICT
customer_delivery_addressescustomer_idcustomerscustomer_idRESTRICT
customer_groupsdefault_activity_idactivitiesactivity_idRESTRICT
customer_groupsdefault_ar_account_idgl_accountsgl_account_idRESTRICT
customer_groupsdefault_cost_center_idcost_centerscost_center_idRESTRICT
customer_groupsdefault_revenue_account_idgl_accountsgl_account_idRESTRICT
customer_groupstax_position_idtax_positionstax_position_idRESTRICT
customer_groupstrading_terms_idtrading_termstrading_terms_idRESTRICT
customersactor_idactorsactor_idRESTRICT
customerscustomer_group_idcustomer_groupscustomer_group_idRESTRICT
customerstax_position_idtax_positionstax_position_idRESTRICT
customerstrading_terms_idtrading_termstrading_terms_idRESTRICT
discount_matrixcustomer_group_idcustomer_groupscustomer_group_idRESTRICT
discount_matrixcustomer_idcustomerscustomer_idRESTRICT
discount_matrixproduct_group_idproduct_groupsproduct_group_idRESTRICT
gl_journal_entriesreversed_bygl_journal_entriesjournal_entry_idRESTRICT
gl_journal_linesactivity_idactivitiesactivity_idRESTRICT
gl_journal_linescost_center_idcost_centerscost_center_idRESTRICT
gl_journal_linesgl_account_idgl_accountsgl_account_idRESTRICT
gl_journal_linesjournal_entry_idgl_journal_entriesjournal_entry_idRESTRICT
gl_journal_linesmatch_group_idgl_match_groupsmatch_group_idRESTRICT
gl_journal_linesreconciliation_idgl_reconciliationsreconciliation_idRESTRICT
gl_match_groupsrule_idreconciliation_rulesrule_idRESTRICT
gl_reconciliationsgl_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_activity_idactivitiesactivity_idRESTRICT
gl_settingsdefault_ap_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_ar_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_cogs_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_cost_center_idcost_centerscost_center_idRESTRICT
gl_settingsdefault_discounts_given_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_discounts_received_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_expense_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_fee_revenue_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_grni_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_inventory_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_ppv_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_purchase_tax_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_revenue_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_sales_tax_account_idgl_accountsgl_account_idRESTRICT
gl_settingsdefault_shrinkage_account_idgl_accountsgl_account_idRESTRICT
gl_settingsrealised_fx_gain_account_idgl_accountsgl_account_idRESTRICT
gl_settingsrealised_fx_loss_account_idgl_accountsgl_account_idRESTRICT
gl_settingsunrealised_fx_gain_account_idgl_accountsgl_account_idRESTRICT
gl_settingsunrealised_fx_loss_account_idgl_accountsgl_account_idRESTRICT
goods_receivedlocation_idlocationslocation_idRESTRICT
goods_receivedvendor_idsuppliersvendor_idRESTRICT
goods_received_linesgoods_received_idgoods_receivedgoods_received_idRESTRICT
goods_received_linesproduct_idproductsproduct_idRESTRICT
goods_received_linespurchase_order_idpurchase_orderspurchase_order_idRESTRICT
goods_received_linespurchase_order_line_idpurchase_order_linespurchase_order_line_idRESTRICT
inventory_ledgerbin_idbinsbin_idRESTRICT
inventory_ledgerentry_idinventory_entriesentry_idRESTRICT
inventory_ledgerlocation_idlocationslocation_idRESTRICT
inventory_ledgerproduct_idproductsproduct_idRESTRICT
inventory_ledgerzone_idzoneszone_idRESTRICT
payment_allocationspayment_idpayment_entriespayment_idRESTRICT
payment_entriesgl_account_bankgl_accountsgl_account_idRESTRICT
payment_linesgl_account_idgl_accountsgl_account_idRESTRICT
payment_linespayment_idpayment_entriespayment_idRESTRICT
pdf_template_contextstemplate_idpdf_templatesidcascade
pdf_template_hooksreport_idpdf_templatesidcascade
product_componentschild_product_idproductsproduct_idRESTRICT
product_componentsparent_product_idproductsproduct_idRESTRICT
product_default_binsbin_idbinsbin_idRESTRICT
product_default_binslocation_idlocationslocation_idRESTRICT
product_default_binsproduct_idproductsproduct_idRESTRICT
product_groupsdefault_activity_idactivitiesactivity_idRESTRICT
product_groupsdefault_cost_center_idcost_centerscost_center_idRESTRICT
product_groupsdefault_expense_account_idgl_accountsgl_account_idRESTRICT
product_groupsdefault_revenue_account_idgl_accountsgl_account_idRESTRICT
product_groupspurchase_tax_category_idtax_categoriestax_category_idRESTRICT
product_groupssales_tax_category_idtax_categoriestax_category_idRESTRICT
product_imagesproduct_idproductsproduct_idcascade
product_suppliersproduct_idproductsproduct_idRESTRICT
product_suppliersvendor_idsuppliersvendor_idRESTRICT
product_uomsproduct_idproductsproduct_idRESTRICT
product_uomsuom_codeuom_dictionaryuom_codeRESTRICT
productsbase_uomuom_dictionaryuom_codeRESTRICT
productsdefault_purchase_uom_idproduct_uomsproduct_uom_idRESTRICT
productsdefault_sales_uom_idproduct_uomsproduct_uom_idRESTRICT
productsproduct_group_idproduct_groupsproduct_group_idRESTRICT
productspurchase_tax_category_idtax_categoriestax_category_idRESTRICT
productssales_tax_category_idtax_categoriestax_category_idRESTRICT
project_actorsactor_idactorsactor_idRESTRICT
project_actorsproject_idprojectsproject_idRESTRICT
project_contactscontact_idcontactscontact_idRESTRICT
project_contactsproject_idprojectsproject_idRESTRICT
project_notescreated_by_idusersuser_idRESTRICT
project_notesproject_idprojectsproject_idRESTRICT
projectsowner_idusersuser_idRESTRICT
purchase_debit_note_linesaccount_idgl_accountsgl_account_idRESTRICT
purchase_debit_note_linesdebit_note_idpurchase_debit_notesdebit_note_idRESTRICT
purchase_debit_note_linespurchase_order_line_idpurchase_order_linespurchase_order_line_idRESTRICT
purchase_debit_note_linestax_category_idtax_categoriestax_category_idRESTRICT
purchase_debit_note_shipmentsdebit_note_line_idpurchase_debit_note_linesdebit_note_line_idRESTRICT
purchase_debit_note_shipmentsshipment_line_idpurchase_order_return_shipment_linesshipment_line_idRESTRICT
purchase_debit_notespurchase_order_idpurchase_orderspurchase_order_idRESTRICT
purchase_debit_notesreturn_idpurchase_order_returnsreturn_idRESTRICT
purchase_debit_notesvendor_idsuppliersvendor_idRESTRICT
purchase_invoice_linesgl_account_idgl_accountsgl_account_idRESTRICT
purchase_invoice_linesinvoice_idpurchase_invoicesinvoice_idRESTRICT
purchase_invoice_linesproduct_idproductsproduct_idRESTRICT
purchase_invoice_linespurchase_order_line_idpurchase_order_linespurchase_order_line_idRESTRICT
purchase_invoice_receiptsgoods_received_line_idgoods_received_linesgoods_received_line_idRESTRICT
purchase_invoice_receiptsinvoice_line_idpurchase_invoice_linesinvoice_line_idRESTRICT
purchase_invoicespurchase_order_idpurchase_orderspurchase_order_idRESTRICT
purchase_invoicesvendor_idsuppliersvendor_idRESTRICT
purchase_order_linesproduct_idproductsproduct_idRESTRICT
purchase_order_linespurchase_order_idpurchase_orderspurchase_order_idRESTRICT
purchase_order_linestax_category_idtax_categoriestax_category_idRESTRICT
purchase_order_return_linespurchase_order_line_idpurchase_order_linespurchase_order_line_idRESTRICT
purchase_order_return_linesreturn_idpurchase_order_returnsreturn_idRESTRICT
purchase_order_return_linessource_bin_idbinsbin_idRESTRICT
purchase_order_return_shipment_linesreturn_line_idpurchase_order_return_linesreturn_line_idRESTRICT
purchase_order_return_shipment_linesshipment_idpurchase_order_return_shipmentsshipment_idRESTRICT
purchase_order_return_shipmentsfulfillment_location_idlocationslocation_idRESTRICT
purchase_order_return_shipmentsreturn_idpurchase_order_returnsreturn_idRESTRICT
purchase_order_returnspurchase_order_idpurchase_orderspurchase_order_idRESTRICT
purchase_ordersdelivery_location_idlocationslocation_idRESTRICT
purchase_ordersvendor_idsuppliersvendor_idRESTRICT
reconciliation_rulesactivity_idactivitiesactivity_idRESTRICT
reconciliation_rulescost_center_idcost_centerscost_center_idRESTRICT
reconciliation_rulestarget_gl_account_idgl_accountsgl_account_idRESTRICT
sales_credit_note_linesaccount_idgl_accountsgl_account_idRESTRICT
sales_credit_note_linescredit_note_idsales_credit_notescredit_note_idRESTRICT
sales_credit_note_linessales_order_line_idsales_order_linessales_order_line_idRESTRICT
sales_credit_note_linestax_category_idtax_categoriestax_category_idRESTRICT
sales_credit_notescustomer_idcustomerscustomer_idRESTRICT
sales_credit_notesinvoice_idsales_invoicesinvoice_idRESTRICT
sales_credit_notesreturn_idsales_order_returnsreturn_idRESTRICT
sales_credit_notessales_order_idsales_orderssales_order_idRESTRICT
sales_invoice_linesinvoice_idsales_invoicesinvoice_idRESTRICT
sales_invoice_linessales_order_line_idsales_order_linessales_order_line_idRESTRICT
sales_invoicescustomer_idcustomerscustomer_idRESTRICT
sales_invoicessales_order_idsales_orderssales_order_idRESTRICT
sales_order_linesfulfillment_location_idlocationslocation_idRESTRICT
sales_order_linesparent_line_idsales_order_linessales_order_line_idRESTRICT
sales_order_linesproduct_idproductsproduct_idRESTRICT
sales_order_linessales_order_idsales_orderssales_order_idRESTRICT
sales_order_linestax_category_idtax_categoriestax_category_idRESTRICT
sales_order_picksbin_idbinsbin_idRESTRICT
sales_order_picksproduct_idproductsproduct_idRESTRICT
sales_order_pickssales_order_idsales_orderssales_order_idRESTRICT
sales_order_pickssales_order_line_idsales_order_linessales_order_line_idRESTRICT
sales_order_return_linesreturn_idsales_order_returnsreturn_idRESTRICT
sales_order_return_linessales_order_line_idsales_order_linessales_order_line_idRESTRICT
sales_order_return_linestax_category_idtax_categoriestax_category_idRESTRICT
sales_order_returnslocation_idlocationslocation_idRESTRICT
sales_order_returnssales_order_idsales_orderssales_order_idRESTRICT
sales_order_shipment_linessales_order_line_idsales_order_linessales_order_line_idRESTRICT
sales_order_shipment_linesshipment_idsales_order_shipmentsshipment_idRESTRICT
sales_order_shipmentsfulfillment_location_idlocationslocation_idRESTRICT
sales_order_shipmentssales_order_idsales_orderssales_order_idRESTRICT
sales_orderscustomer_idcustomerscustomer_idRESTRICT
sales_ordersfulfillment_location_idlocationslocation_idRESTRICT
supplier_expiriesvendor_idsuppliersvendor_idRESTRICT
supplier_groupsdefault_activity_idactivitiesactivity_idRESTRICT
supplier_groupsdefault_ap_account_idgl_accountsgl_account_idRESTRICT
supplier_groupsdefault_cost_center_idcost_centerscost_center_idRESTRICT
supplier_groupsdefault_expense_account_idgl_accountsgl_account_idRESTRICT
supplier_groupstax_position_idtax_positionstax_position_idRESTRICT
supplier_groupstrading_terms_idtrading_termstrading_terms_idRESTRICT
suppliersactor_idactorsactor_idRESTRICT
supplierssupplier_group_idsupplier_groupssupplier_group_idRESTRICT
supplierstax_position_idtax_positionstax_position_idRESTRICT
supplierstrading_terms_idtrading_termstrading_terms_idRESTRICT
tax_position_mappingsdestination_tax_category_idtax_categoriestax_category_idcascade
tax_position_mappingssource_tax_category_idtax_categoriestax_category_idcascade
tax_position_mappingstax_position_idtax_positionstax_position_idcascade
transfer_order_linesproduct_idproductsproduct_idRESTRICT
transfer_order_linestransfer_order_idtransfer_orderstransfer_order_idRESTRICT
transfer_order_picksbin_idbinsbin_idRESTRICT
transfer_order_picksproduct_idproductsproduct_idRESTRICT
transfer_order_pickstransfer_order_idtransfer_orderstransfer_order_idRESTRICT
transfer_order_pickstransfer_order_line_idtransfer_order_linestransfer_order_line_idRESTRICT
transfer_order_receipt_linesbin_idbinsbin_idRESTRICT
transfer_order_receipt_linesproduct_idproductsproduct_idRESTRICT
transfer_order_receipt_linesreceipt_idtransfer_order_receiptsreceipt_idRESTRICT
transfer_order_receipt_linestransfer_order_line_idtransfer_order_linestransfer_order_line_idRESTRICT
transfer_order_receiptstransfer_order_idtransfer_orderstransfer_order_idRESTRICT
transfer_order_shipment_linespick_idtransfer_order_pickspick_idRESTRICT
transfer_order_shipment_linesproduct_idproductsproduct_idRESTRICT
transfer_order_shipment_linesshipment_idtransfer_order_shipmentsshipment_idRESTRICT
transfer_order_shipment_linestransfer_order_line_idtransfer_order_linestransfer_order_line_idRESTRICT
transfer_order_shipmentstransfer_order_idtransfer_orderstransfer_order_idRESTRICT
transfer_ordersdestination_location_idlocationslocation_idRESTRICT
transfer_orderssource_location_idlocationslocation_idRESTRICT
user_eventsuser_idusersuser_idcascade
user_settingsuser_idusersuser_idcascade
user_two_factoruser_idusersuser_idcascade
work_order_componentsproduct_idproductsproduct_idRESTRICT
work_order_componentswork_order_idwork_orderswork_order_idRESTRICT
work_order_picksbin_idbinsbin_idRESTRICT
work_order_pickswork_order_component_idwork_order_componentswork_order_component_idRESTRICT
work_order_pickswork_order_idwork_orderswork_order_idRESTRICT
work_orderslocation_idlocationslocation_idRESTRICT
work_ordersoutput_bin_idbinsbin_idRESTRICT
work_ordersproduct_idproductsproduct_idRESTRICT
work_orderswip_bin_idbinsbin_idRESTRICT
zoneslocation_idlocationslocation_idRESTRICT

CRM & Stakeholders

Accounts, contacts, relationship graphs, CRM projects, customer groups, and addresses.

#ColumnData TypeNullableDefaultConstraints & Relationships
1link_iduuidNOgen_random_uuid()🔑 PK
2source_actor_iduuidNO🔗 actors.actor_id
3target_actor_iduuidNO🔗 actors.actor_id
4link_typetextNO
5created_ontimestamp with time zoneYESnow()

#ColumnData TypeNullableDefaultConstraints & Relationships
1link_iduuidNOgen_random_uuid()🔑 PK
2actor_iduuidNO🔗 actors.actor_id
3contact_iduuidNO🔗 contacts.contact_id
4link_typetextNO
5primary_fortext[]YES
6created_ontimestamp with time zoneYESnow()

Table: herobm_core.actor_notes

#ColumnData TypeNullableDefaultConstraints & Relationships
1note_iduuidNOgen_random_uuid()🔑 PK
2actor_iduuidNO🔗 actors.actor_id
3contenttextNO
4created_by_iduuidYES🔗 users.user_id
5created_ontimestamp with time zoneYESnow()

Table: herobm_core.actors

#ColumnData TypeNullableDefaultConstraints & Relationships
1actor_iduuidNOgen_random_uuid()🔑 PK
2state_codetextNO
3nametextNO
4legal_statustextYES
5headquarters_address_line1textYES
6headquarters_address_line2textYES
7headquarters_citytextYES
8headquarters_state_or_provincetextYES
9headquarters_postal_codetextYES
10headquarters_countrytextYES
11websitetextYES
12industrytextYES
13telephonetextYES
14faxtextYES
15emailtextYES
16business_numbertextYES
17is_tax_registeredbooleanNO
18referral_modetextYES
19referred_by_actor_iduuidYES🔗 actors.actor_id
20referred_by_contact_iduuidYES🔗 contacts.contact_id
21referral_notetextYES
22tagstext[]YES
23created_ontimestamp with time zoneYESnow()
24modified_ontimestamp with time zoneYESnow()

Table: herobm_core.contacts

#ColumnData TypeNullableDefaultConstraints & Relationships
1contact_iduuidNOgen_random_uuid()🔑 PK
2state_codetextNO
3first_nametextYES
4last_nametextYES
5full_nametextYES
6job_titletextYES
7emailtextYES
8phonetextYES
9mobiletextYES
10linkedin_profiletextYES
11referred_by_actor_iduuidYES🔗 actors.actor_id
12referred_by_contact_iduuidYES🔗 contacts.contact_id
13created_ontimestamp with time zoneYESnow()
14modified_ontimestamp with time zoneYESnow()

Table: herobm_core.customer_delivery_addresses

#ColumnData TypeNullableDefaultConstraints & Relationships
1iduuidNOgen_random_uuid()🔑 PK
2customer_iduuidNO🔗 customers.customer_id
3address_nametextYES
4company_nametextYES
5recipient_nametextYES
6recipient_phonetextYES
7address_line1textYES
8address_line2textYES
9citytextYES
10state_or_provincetextYES
11postal_codetextYES
12countrytextYES
13is_primarybooleanNO
14source_idtextYES
15sourcetextNO
16created_ontimestamp with time zoneYESnow()
17modified_ontimestamp with time zoneYESnow()

Table: herobm_core.customer_groups

#ColumnData TypeNullableDefaultConstraints & Relationships
1customer_group_iduuidNOgen_random_uuid()🔑 PK
2group_codetextNOUNIQUE
3nametextNO
4state_codetextNO
5default_ar_account_iduuidYES🔗 gl_accounts.gl_account_id
6default_revenue_account_iduuidYES🔗 gl_accounts.gl_account_id
7trading_terms_iduuidYES🔗 trading_terms.trading_terms_id
8default_cost_center_iduuidYES🔗 cost_centers.cost_center_id
9default_activity_iduuidYES🔗 activities.activity_id
10early_payment_discountnumericYES
11early_payment_discount_daysintegerYES
12credit_limitnumericYES
13is_on_credit_holdbooleanNO
14tax_position_iduuidYES🔗 tax_positions.tax_position_id

Table: herobm_core.customers

#ColumnData TypeNullableDefaultConstraints & Relationships
1customer_iduuidNOgen_random_uuid()🔑 PK
2customer_numbertextNOUNIQUE
3customer_group_iduuidYES🔗 customer_groups.customer_group_id
4actor_iduuidYES🔗 actors.actor_id
5state_codetextNO
6tax_position_iduuidYES🔗 tax_positions.tax_position_id
7currency_codetextNO🏷️ CHECK
8trading_terms_iduuidYES🔗 trading_terms.trading_terms_id
9early_payment_discountnumericYES
10early_payment_discount_daysintegerYES
11credit_limitnumericYES
12is_on_credit_holdbooleanYES
13override_credit_hold_untiltimestamp with time zoneYES
14bank_account_nametextYES
15bank_bsbtextYES
16bank_account_numbertextYES
17external_idtextYES
18source_idtextYESUNIQUE
19sourcetextNO
20price_tiertextYES
21notestextYES
22created_bytextYES
23created_ontimestamp with time zoneYESnow()
24modified_ontimestamp with time zoneYESnow()

Table: herobm_core.project_actors

#ColumnData TypeNullableDefaultConstraints & Relationships
1project_actor_iduuidNOgen_random_uuid()🔑 PK
2project_iduuidNO🔗 projects.project_id
3actor_iduuidNO🔗 actors.actor_id
4rolestext[]YES
5created_ontimestamp with time zoneYESnow()

Table: herobm_core.project_contacts

#ColumnData TypeNullableDefaultConstraints & Relationships
1project_contact_iduuidNOgen_random_uuid()🔑 PK
2project_iduuidNO🔗 projects.project_id
3contact_iduuidNO🔗 contacts.contact_id
4rolestext[]YES
5created_ontimestamp with time zoneYESnow()

Table: herobm_core.project_notes

#ColumnData TypeNullableDefaultConstraints & Relationships
1note_iduuidNOgen_random_uuid()🔑 PK
2project_iduuidNO🔗 projects.project_id
3contenttextNO
4created_by_iduuidYES🔗 users.user_id
5created_ontimestamp with time zoneYESnow()

Table: herobm_core.projects

#ColumnData TypeNullableDefaultConstraints & Relationships
1project_iduuidNOgen_random_uuid()🔑 PK
2state_codetextNO
3nametextNO
4statustextNO
5typetextNO
6owner_iduuidYES🔗 users.user_id
7created_ontimestamp with time zoneYESnow()
8modified_ontimestamp with time zoneYESnow()

Table: herobm_core.trading_terms

#ColumnData TypeNullableDefaultConstraints & Relationships
1trading_terms_iduuidNOgen_random_uuid()🔑 PK
2source_idtextYES
3sourcetextYES
4codetextNOUNIQUE
5descriptiontextNO
6daysintegerNO
7typetextNO
8is_activebooleanNO
9created_ontimestamp with time zoneYESnow()
10modified_ontimestamp with time zoneYESnow()

Products & Catalog

Item masters, product groups, units of measure, supplier pricing matrix, and bills of materials.

Table: herobm_core.discount_matrix

#ColumnData TypeNullableDefaultConstraints & Relationships
1discount_matrix_iduuidNOgen_random_uuid()🔑 PK
2customer_group_iduuidYES🔗 customer_groups.customer_group_id, ⚡ UNIQUE, 🏷️ CHECK
3customer_iduuidYES🔗 customers.customer_id, ⚡ UNIQUE, 🏷️ CHECK
4product_group_iduuidYES🔗 product_groups.product_group_id, ⚡ UNIQUE, ⚡ UNIQUE
5discount_percentagenumericNO
6created_ontimestamp with time zoneYESnow()
7modified_ontimestamp with time zoneYESnow()

Table: herobm_core.product_components

#ColumnData TypeNullableDefaultConstraints & Relationships
1component_iduuidNOgen_random_uuid()🔑 PK
2parent_product_iduuidNO🔗 products.product_id
3child_product_iduuidNO🔗 products.product_id
4parent_quantitynumeric(14, 4)NO
5quantitynumeric(14, 4)NO
6sequence_numberintegerYES
7fractional_behaviorfractional_behaviorYES

Table: herobm_core.product_default_bins

#ColumnData TypeNullableDefaultConstraints & Relationships
1product_default_bin_iduuidNOgen_random_uuid()🔑 PK
2product_iduuidNO🔗 products.product_id, ⚡ UNIQUE
3location_iduuidNO🔗 locations.location_id, ⚡ UNIQUE
4bin_iduuidNO🔗 bins.bin_id, ⚡ UNIQUE
5is_primary_per_locbooleanNO
6min_quantitynumericYES
7max_quantitynumericYES
8created_ontimestamp with time zoneYESnow()
9modified_ontimestamp with time zoneYESnow()

Table: herobm_core.product_groups

#ColumnData TypeNullableDefaultConstraints & Relationships
1product_group_iduuidNOgen_random_uuid()🔑 PK
2group_codetextNOUNIQUE
3nametextNO
4default_revenue_account_iduuidYES🔗 gl_accounts.gl_account_id
5default_expense_account_iduuidYES🔗 gl_accounts.gl_account_id
6default_cost_center_iduuidYES🔗 cost_centers.cost_center_id
7default_activity_iduuidYES🔗 activities.activity_id
8purchase_tax_category_iduuidYES🔗 tax_categories.tax_category_id
9sales_tax_category_iduuidYES🔗 tax_categories.tax_category_id

Table: herobm_core.product_images

#ColumnData TypeNullableDefaultConstraints & Relationships
1image_iduuidNOgen_random_uuid()🔑 PK
2product_iduuidNO🔗 products.product_id (cascade)
3storage_pathtextNO
4file_nametextNO
5mime_typetextNO
6byte_sizeintegerNO
7is_primarybooleanNO
8sort_orderintegerNO
9created_bytextYES
10created_ontimestamp with time zoneYESnow()

Table: herobm_core.product_suppliers

#ColumnData TypeNullableDefaultConstraints & Relationships
1product_supplier_iduuidNOgen_random_uuid()🔑 PK
2product_iduuidNO🔗 products.product_id, ⚡ UNIQUE
3vendor_iduuidNO🔗 suppliers.vendor_id, ⚡ UNIQUE
4supplier_part_numbertextYES
5cost_pricenumericYES
6discount_percentnumericYES
7price_break_quantitynumericYES
8is_preferredbooleanNO
9min_purchase_qtynumericYES
10purchase_unittextYES
11effective_fromtimestamp with time zoneYES
12effective_totimestamp with time zoneYES
13state_codetextNO
14source_idtextYESUNIQUE
15sourcetextNO
16created_bytextYES
17created_ontimestamp with time zoneYESnow()
18modified_ontimestamp with time zoneYESnow()

Table: herobm_core.product_uoms

#ColumnData TypeNullableDefaultConstraints & Relationships
1product_uom_iduuidNOgen_random_uuid()🔑 PK
2product_iduuidNO🔗 products.product_id, ⚡ UNIQUE
3uom_codetextNO🔗 uom_dictionary.uom_code, ⚡ UNIQUE
4rationumeric(12, 4)NO
5barcodetextYES
6is_sales_defaultbooleanYES
7is_purchase_defaultbooleanYES

Table: herobm_core.products

#ColumnData TypeNullableDefaultConstraints & Relationships
1product_iduuidNOgen_random_uuid()🔑 PK
2product_numbertextNOUNIQUE
3nametextNO
4product_typeproduct_typeNO
5structure_typeproduct_structureNO
6product_group_iduuidYES🔗 product_groups.product_group_id
7barcodetextYES
8list_pricenumeric(12, 2)YES
9standard_costnumeric(12, 2)YES
10trade_pricenumeric(12, 2)YES
11price_level_3numeric(12, 2)YES
12price_level_4numeric(12, 2)YES
13weighted_average_costnumericYES
14weightnumeric(12, 4)YES
15alternate_invoice_descriptiontextYES
16box_quantitynumericYES
17base_uomtextNO🔗 uom_dictionary.uom_code
18default_sales_uom_iduuidYES🔗 product_uoms.product_uom_id
19default_purchase_uom_iduuidYES🔗 product_uoms.product_uom_id
20purchase_tax_category_iduuidYES🔗 tax_categories.tax_category_id
21sales_tax_category_iduuidYES🔗 tax_categories.tax_category_id
22external_tax_codetextYES
23alternate_product_numbertextYES
24image_pathtextYES
25state_codetextNO
26notestextYES
27source_idtextYESUNIQUE
28sourcetextNO
29created_bytextYES
30created_ontimestamp with time zoneYESnow()
31modified_ontimestamp with time zoneYESnow()

Table: herobm_core.uom_dictionary

#ColumnData TypeNullableDefaultConstraints & Relationships
1uom_codetextNO🔑 PK
2descriptiontextNO
3created_ontimestamp with time zoneYESnow()

Sales & Distribution

Sales quotations, confirmed orders, pick lists, shipments, sales invoices, and customer credit notes.

Table: herobm_core.backorders

#ColumnData TypeNullableDefaultConstraints & Relationships
1backorder_iduuidNOgen_random_uuid()🔑 PK
2sales_order_iduuidYES🔗 sales_orders.sales_order_id
3sales_order_line_iduuidYES🔗 sales_order_lines.sales_order_line_id
4demand_work_order_iduuidYES🔗 work_orders.work_order_id
5work_order_component_iduuidYES🔗 work_order_components.work_order_component_id
6product_iduuidNO🔗 products.product_id
7purchase_order_iduuidYES🔗 purchase_orders.purchase_order_id
8purchase_order_line_iduuidYES🔗 purchase_order_lines.purchase_order_line_id
9transfer_order_iduuidYES🔗 transfer_orders.transfer_order_id
10transfer_order_line_iduuidYES🔗 transfer_order_lines.transfer_order_line_id
11work_order_iduuidYES🔗 work_orders.work_order_id
12quantitynumericNO
13state_codetextNO
14created_ontimestamp with time zoneYESnow()
15modified_ontimestamp with time zoneYESnow()

Table: herobm_core.sales_credit_note_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1credit_note_line_iduuidNOgen_random_uuid()🔑 PK
2credit_note_iduuidNO🔗 sales_credit_notes.credit_note_id
3sales_order_line_iduuidYES🔗 sales_order_lines.sales_order_line_id
4descriptiontextYES
5account_iduuidYES🔗 gl_accounts.gl_account_id
6tax_category_iduuidYES🔗 tax_categories.tax_category_id
7quantity_creditednumericNO
8price_per_unitnumericNO
9discount_percentagenumericYES
10amountnumericNO
11tax_amountnumericYES
12product_numbertextYES
13product_nametextYES

Table: herobm_core.sales_credit_notes

#ColumnData TypeNullableDefaultConstraints & Relationships
1credit_note_iduuidNOgen_random_uuid()🔑 PK
2credit_note_numbertextNOUNIQUE
3customer_iduuidNO🔗 customers.customer_id
4return_iduuidYES🔗 sales_order_returns.return_id
5sales_order_iduuidYES🔗 sales_orders.sales_order_id
6invoice_iduuidYES🔗 sales_invoices.invoice_id
7total_amountnumericNO
8tax_amountnumericYES
9fee_amountnumericYES
10outstanding_amountnumericNO
11base_total_amountnumericYES
12base_outstanding_amountnumericYES
13currency_codetextNO🏷️ CHECK
14exchange_ratenumericNO
15state_codetextNO
16notestextYES
17created_bytextYES
18created_ontimestamp with time zoneYESnow()
19modified_ontimestamp with time zoneYESnow()

Table: herobm_core.sales_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO
3entity_iduuidNO
4event_typetextNO
5entity_display_nametextYES
6payloadjsonbYES
7actortextYES
8created_ontimestamp with time zoneYESnow()

Table: herobm_core.sales_invoice_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1invoice_line_iduuidNOgen_random_uuid()🔑 PK
2invoice_iduuidNO🔗 sales_invoices.invoice_id
3sales_order_line_iduuidNO🔗 sales_order_lines.sales_order_line_id
4quantity_invoicednumericNO
5price_per_unitnumericNO
6amountnumericNO

Table: herobm_core.sales_invoices

#ColumnData TypeNullableDefaultConstraints & Relationships
1invoice_iduuidNOgen_random_uuid()🔑 PK
2invoice_numbertextNOUNIQUE
3sales_order_iduuidNO🔗 sales_orders.sales_order_id
4customer_iduuidYES🔗 customers.customer_id
5customer_name_displaytextYES
6customer_order_numbertextYES
7total_amountnumericNO
8outstanding_amountnumericNO
9tax_amountnumericYES
10base_total_amountnumericYES
11base_outstanding_amountnumericYES
12currency_codetextNO🏷️ CHECK
13exchange_ratenumericNO
14state_codetextNO
15invoice_datetimestamp with time zoneYES
16due_datetimestamp with time zoneYES
17terms_descriptiontextYES
18notestextYES
19early_payment_discountnumericYES
20early_payment_discount_daysintegerYES
21created_bytextYES
22created_ontimestamp with time zoneYESnow()
23modified_ontimestamp with time zoneYESnow()

Table: herobm_core.sales_order_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1sales_order_line_iduuidNOgen_random_uuid()🔑 PK
2sales_order_iduuidNO🔗 sales_orders.sales_order_id
3line_numberintegerNO
4line_typetextYES🏷️ CHECK
5product_iduuidYES🔗 products.product_id
6product_descriptiontextYES
7quantitynumericNO
8price_per_unitnumericNO
9unit_costnumericYES
10discount_percentagenumericYES
11amountnumericYES
12tax_category_iduuidYES🔗 tax_categories.tax_category_id, 🏷️ CHECK
13taxnumericYES🏷️ CHECK
14total_amountnumericYES
15unit_of_measuretextYES
16quantity_pickednumericYES
17fulfillment_location_iduuidYES🔗 locations.location_id, 🏷️ CHECK
18is_post_confirmationbooleanYES
19parent_line_iduuidYES🔗 sales_order_lines.sales_order_line_id

Table: herobm_core.sales_order_picks

#ColumnData TypeNullableDefaultConstraints & Relationships
1pick_iduuidNOgen_random_uuid()🔑 PK
2sales_order_iduuidNO🔗 sales_orders.sales_order_id
3sales_order_line_iduuidNO🔗 sales_order_lines.sales_order_line_id
4product_iduuidNO🔗 products.product_id
5bin_iduuidYES🔗 bins.bin_id
6quantitynumericNO
7state_codetextNO🏷️ CHECK
8created_bytextYES
9created_ontimestamp with time zoneYESnow()
10modified_ontimestamp with time zoneYESnow()

Table: herobm_core.sales_order_return_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1return_line_iduuidNOgen_random_uuid()🔑 PK
2return_iduuidNO🔗 sales_order_returns.return_id
3sales_order_line_iduuidNO🔗 sales_order_lines.sales_order_line_id
4quantity_returnednumericNO
5quantity_receivednumericYES
6reasontextYES
7resolutiontextNO
8return_feenumericYES
9putaway_statustextNO
10product_numbertextYES
11product_nametextYES
12price_per_unitnumericYES
13discount_percentagenumericYES
14tax_category_iduuidYES🔗 tax_categories.tax_category_id

Table: herobm_core.sales_order_returns

#ColumnData TypeNullableDefaultConstraints & Relationships
1return_iduuidNOgen_random_uuid()🔑 PK
2return_numbertextNOUNIQUE
3sales_order_iduuidNO🔗 sales_orders.sales_order_id
4state_codetextNO🏷️ CHECK
5location_iduuidYES🔗 locations.location_id
6notestextYES
7created_bytextYES
8created_ontimestamp with time zoneYESnow()
9modified_ontimestamp with time zoneYESnow()

Table: herobm_core.sales_order_shipment_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1shipment_line_iduuidNOgen_random_uuid()🔑 PK
2shipment_iduuidNO🔗 sales_order_shipments.shipment_id
3sales_order_line_iduuidNO🔗 sales_order_lines.sales_order_line_id
4quantity_shippednumericNO

Table: herobm_core.sales_order_shipments

#ColumnData TypeNullableDefaultConstraints & Relationships
1shipment_iduuidNOgen_random_uuid()🔑 PK
2shipment_numbertextNOUNIQUE
3sales_order_iduuidNO🔗 sales_orders.sales_order_id
4state_codetextNO🏷️ CHECK
5notestextYES
6tracking_numbertextYES
7delivery_company_nametextYES
8fulfillment_location_iduuidYES🔗 locations.location_id
9created_bytextYES
10created_ontimestamp with time zoneYESnow()
11modified_ontimestamp with time zoneYESnow()

Table: herobm_core.sales_orders

#ColumnData TypeNullableDefaultConstraints & Relationships
1sales_order_iduuidNOgen_random_uuid()🔑 PK
2order_numbertextNOUNIQUE
3nametextYES
4customer_iduuidYES🔗 customers.customer_id
5customer_order_numbertextYES
6fulfillment_location_iduuidNO🔗 locations.location_id
7state_codetextNO🏷️ CHECK
8base_total_amountnumericYES
9currency_codetextNO🏷️ CHECK
10exchange_ratenumericNO
11notestextYES
12shipping_notestextYES
13delivery_company_nametextYES
14delivery_nametextYES
15delivery_phonetextYES
16delivery_address_line1textYES
17delivery_address_line2textYES
18delivery_citytextYES
19delivery_statetextYES
20delivery_postal_codetextYES
21delivery_countrytextYES
22custom_fieldsjsonbYES
23discrepancies_acknowledgedbooleanNO
24source_idtextYESUNIQUE
25sourcetextNO
26terms_descriptiontextYES
27credit_hold_override_attimestamp with time zoneYES
28credit_hold_override_bytextYES
29credit_hold_override_reasontextYES
30created_bytextYES
31created_ontimestamp with time zoneYESnow()
32modified_ontimestamp with time zoneYESnow()

Purchasing & Procurement

Purchase orders, goods receipts, purchase bills, vendor debit notes, returns, and supplier masters.

Table: herobm_core.goods_received

#ColumnData TypeNullableDefaultConstraints & Relationships
1goods_received_iduuidNOgen_random_uuid()🔑 PK
2receipt_numbertextNOUNIQUE
3vendor_iduuidNO🔗 suppliers.vendor_id
4location_iduuidNO🔗 locations.location_id
5packing_slip_numbertextYES
6notestextYES
7state_codetextNO
8created_bytextYES
9created_ontimestamp with time zoneYESnow()
10modified_ontimestamp with time zoneYESnow()

Table: herobm_core.goods_received_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1goods_received_line_iduuidNOgen_random_uuid()🔑 PK
2goods_received_iduuidNO🔗 goods_received.goods_received_id
3product_iduuidNO🔗 products.product_id
4quantity_receivednumericNO
5unit_costnumericYES
6match_statustextNO
7putaway_statustextNO
8purchase_order_line_iduuidYES🔗 purchase_order_lines.purchase_order_line_id
9purchase_order_iduuidYES🔗 purchase_orders.purchase_order_id

Table: herobm_core.procurement_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO
3entity_iduuidNO
4event_typetextNO
5entity_display_nametextYES
6payloadjsonbYES
7actortextYES
8created_ontimestamp with time zoneYESnow()

Table: herobm_core.purchase_debit_note_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1debit_note_line_iduuidNOgen_random_uuid()🔑 PK
2debit_note_iduuidNO🔗 purchase_debit_notes.debit_note_id
3purchase_order_line_iduuidYES🔗 purchase_order_lines.purchase_order_line_id
4descriptiontextYES
5account_iduuidYES🔗 gl_accounts.gl_account_id
6tax_category_iduuidYES🔗 tax_categories.tax_category_id
7quantity_invoicednumericNO
8price_per_unitnumericNO
9amountnumericNO
10tax_amountnumericYES

Table: herobm_core.purchase_debit_note_shipments

#ColumnData TypeNullableDefaultConstraints & Relationships
1debit_note_shipment_iduuidNOgen_random_uuid()🔑 PK
2debit_note_line_iduuidNO🔗 purchase_debit_note_lines.debit_note_line_id
3shipment_line_iduuidNO🔗 purchase_order_return_shipment_lines.shipment_line_id
4quantity_creditednumericNO

Table: herobm_core.purchase_debit_notes

#ColumnData TypeNullableDefaultConstraints & Relationships
1debit_note_iduuidNOgen_random_uuid()🔑 PK
2debit_note_numbertextNOUNIQUE
3supplier_reference_numbertextYES
4return_iduuidYES🔗 purchase_order_returns.return_id
5purchase_order_iduuidYES🔗 purchase_orders.purchase_order_id
6vendor_iduuidNO🔗 suppliers.vendor_id
7total_amountnumericNO
8tax_amountnumericYES
9fee_amountnumericYES
10outstanding_amountnumericNO
11base_total_amountnumericYES
12base_outstanding_amountnumericYES
13currency_codetextNO🏷️ CHECK
14exchange_ratenumericNO
15state_codetextNO🏷️ CHECK
16notestextYES
17created_bytextYES
18created_ontimestamp with time zoneYESnow()
19modified_ontimestamp with time zoneYESnow()

Table: herobm_core.purchase_invoice_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1invoice_line_iduuidNOgen_random_uuid()🔑 PK
2invoice_iduuidNO🔗 purchase_invoices.invoice_id
3purchase_order_line_iduuidYES🔗 purchase_order_lines.purchase_order_line_id
4product_iduuidYES🔗 products.product_id
5gl_account_iduuidYES🔗 gl_accounts.gl_account_id
6descriptiontextYES
7quantity_invoicednumericNO
8price_per_unitnumericNO
9amountnumericNO
10match_statustextNO

Table: herobm_core.purchase_invoice_receipts

#ColumnData TypeNullableDefaultConstraints & Relationships
1invoice_receipt_iduuidNOgen_random_uuid()🔑 PK
2invoice_line_iduuidNO🔗 purchase_invoice_lines.invoice_line_id
3goods_received_line_iduuidNO🔗 goods_received_lines.goods_received_line_id
4quantity_billednumericNO

Table: herobm_core.purchase_invoices

#ColumnData TypeNullableDefaultConstraints & Relationships
1invoice_iduuidNOgen_random_uuid()🔑 PK
2invoice_numbertextNOUNIQUE
3vendor_iduuidNO🔗 suppliers.vendor_id
4purchase_order_iduuidYES🔗 purchase_orders.purchase_order_id
5supplier_invoice_numbertextYES
6receipt_filenametextYES
7total_amountnumericNO
8outstanding_amountnumericNO
9tax_amountnumericYES
10base_total_amountnumericYES
11base_outstanding_amountnumericYES
12currency_codetextNO🏷️ CHECK
13exchange_ratenumericNO
14state_codetextNO
15invoice_datetimestamp with time zoneYES
16due_datetimestamp with time zoneYES
17terms_descriptiontextYES
18notestextYES
19early_payment_discountnumericYES
20early_payment_discount_daysintegerYES
21created_bytextYES
22created_ontimestamp with time zoneYESnow()
23modified_ontimestamp with time zoneYESnow()

Table: herobm_core.purchase_order_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1purchase_order_line_iduuidNOgen_random_uuid()🔑 PK
2purchase_order_iduuidNO🔗 purchase_orders.purchase_order_id
3line_numberintegerNO
4line_typetextYES🏷️ CHECK
5product_iduuidYES🔗 products.product_id
6product_descriptiontextYES
7quantitynumericNO
8price_per_unitnumericNO
9discount_percentagenumericYES
10amountnumericYES
11tax_category_iduuidYES🔗 tax_categories.tax_category_id, 🏷️ CHECK
12taxnumericYES🏷️ CHECK
13total_amountnumericYES
14unit_of_measuretextYES
15quantity_receivednumericYES

Table: herobm_core.purchase_order_return_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1return_line_iduuidNOgen_random_uuid()🔑 PK
2return_iduuidNO🔗 purchase_order_returns.return_id
3purchase_order_line_iduuidNO🔗 purchase_order_lines.purchase_order_line_id
4quantity_returnednumericNO
5reasontextYES
6return_feenumericYES
7source_bin_iduuidYES🔗 bins.bin_id

Table: herobm_core.purchase_order_return_shipment_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1shipment_line_iduuidNOgen_random_uuid()🔑 PK
2shipment_iduuidNO🔗 purchase_order_return_shipments.shipment_id
3return_line_iduuidNO🔗 purchase_order_return_lines.return_line_id
4quantity_shippednumericNO

Table: herobm_core.purchase_order_return_shipments

#ColumnData TypeNullableDefaultConstraints & Relationships
1shipment_iduuidNOgen_random_uuid()🔑 PK
2shipment_numbertextNOUNIQUE
3return_iduuidNO🔗 purchase_order_returns.return_id
4state_codetextNO🏷️ CHECK
5notestextYES
6tracking_numbertextYES
7fulfillment_location_iduuidYES🔗 locations.location_id
8created_bytextYES
9created_ontimestamp with time zoneYESnow()
10modified_ontimestamp with time zoneYESnow()

Table: herobm_core.purchase_order_returns

#ColumnData TypeNullableDefaultConstraints & Relationships
1return_iduuidNOgen_random_uuid()🔑 PK
2return_numbertextNOUNIQUE
3purchase_order_iduuidNO🔗 purchase_orders.purchase_order_id
4state_codetextNO🏷️ CHECK
5notestextYES
6created_bytextYES
7created_ontimestamp with time zoneYESnow()
8modified_ontimestamp with time zoneYESnow()

Table: herobm_core.purchase_orders

#ColumnData TypeNullableDefaultConstraints & Relationships
1purchase_order_iduuidNOgen_random_uuid()🔑 PK
2order_numbertextNOUNIQUE
3nametextYES
4vendor_iduuidYES🔗 suppliers.vendor_id
5delivery_location_iduuidNO🔗 locations.location_id
6reference_numbertextYES
7state_codetextNO🏷️ CHECK
8base_total_amountnumericYES
9currency_codetextNO🏷️ CHECK
10exchange_ratenumericNO
11notestextYES
12custom_fieldsjsonbYES
13expected_datetimestamp with time zoneYES
14terms_descriptiontextYES
15created_bytextYES
16created_ontimestamp with time zoneYESnow()
17modified_ontimestamp with time zoneYESnow()

Table: herobm_core.supplier_expiries

#ColumnData TypeNullableDefaultConstraints & Relationships
1expiry_iduuidNOgen_random_uuid()🔑 PK
2vendor_iduuidNO🔗 suppliers.vendor_id
3expiry_typetextNO
4expiry_datedateNO
5notestextYES
6created_bytextYES
7created_ontimestamp with time zoneYESnow()
8modified_ontimestamp with time zoneYESnow()

Table: herobm_core.supplier_groups

#ColumnData TypeNullableDefaultConstraints & Relationships
1supplier_group_iduuidNOgen_random_uuid()🔑 PK
2group_codetextNOUNIQUE
3nametextNO
4default_ap_account_iduuidYES🔗 gl_accounts.gl_account_id
5default_expense_account_iduuidYES🔗 gl_accounts.gl_account_id
6default_cost_center_iduuidYES🔗 cost_centers.cost_center_id
7default_activity_iduuidYES🔗 activities.activity_id
8trading_terms_iduuidYES🔗 trading_terms.trading_terms_id
9tax_position_iduuidYES🔗 tax_positions.tax_position_id
10early_payment_discountnumericYES
11early_payment_discount_daysintegerYES
12credit_limitnumericYES
13is_purchasing_blockedbooleanNO
14purchasing_block_reasontextYES
15is_payment_blockedbooleanNO
16payment_block_reasontextYES
17block_notestextYES

Table: herobm_core.suppliers

#ColumnData TypeNullableDefaultConstraints & Relationships
1vendor_iduuidNOgen_random_uuid()🔑 PK
2vendor_numbertextNOUNIQUE
3supplier_group_iduuidYES🔗 supplier_groups.supplier_group_id
4actor_iduuidYES🔗 actors.actor_id
5trading_terms_iduuidYES🔗 trading_terms.trading_terms_id
6early_payment_discountnumericYES
7early_payment_discount_daysintegerYES
8credit_limitnumericYES
9is_purchasing_blockedbooleanNO
10purchasing_block_reasontextYES
11is_payment_blockedbooleanYES
12payment_block_reasontextYES
13block_notestextYES
14currency_codetextNO🏷️ CHECK
15state_codetextNO
16external_idtextYES
17notestextYES
18bank_account_nametextYES
19bank_bsbtextYES
20bank_account_numbertextYES
21tax_position_iduuidYES🔗 tax_positions.tax_position_id
22source_idtextYESUNIQUE
23sourcetextNO
24created_bytextYES
25created_ontimestamp with time zoneYESnow()
26modified_ontimestamp with time zoneYESnow()

Warehouse & Inventory

Locations, warehouse zones, bin storage, stock ledger, stock balances, and internal transfer orders.

Table: herobm_core.bin_contents

#ColumnData TypeNullableDefaultConstraints & Relationships
1bin_content_iduuidNOgen_random_uuid()🔑 PK
2bin_iduuidNO🔗 bins.bin_id (cascade), ⚡ UNIQUE
3product_iduuidNO🔗 products.product_id (cascade), ⚡ UNIQUE
4actual_quantitynumericNO
5modified_ontimestamp with time zoneYESnow()

Table: herobm_core.bins

#ColumnData TypeNullableDefaultConstraints & Relationships
1bin_iduuidNOgen_random_uuid()🔑 PK
2bin_numbertextNOUNIQUE
3zone_iduuidNO🔗 zones.zone_id, ⚡ UNIQUE
4bin_typebin_type_enumNO
5is_consignmentbooleanYES
6is_bondedbooleanYES
7is_unavailablebooleanYES
8source_idtextYESUNIQUE
9sourcetextNO
10created_bytextYES
11created_ontimestamp with time zoneYESnow()
12modified_ontimestamp with time zoneYESnow()

Table: herobm_core.inventory_entries

#ColumnData TypeNullableDefaultConstraints & Relationships
1entry_iduuidNOgen_random_uuid()🔑 PK
2entry_numbertextNOUNIQUE
3entry_datetimestamp with time zoneNOnow()
4memotextYES
5source_typetextNO
6source_iduuidYES
7is_reversedbooleanNO
8reversed_byuuidYES
9created_bytextYES
10created_ontimestamp with time zoneYESnow()

Table: herobm_core.inventory_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO
3entity_iduuidNO
4event_typetextNO
5entity_display_nametextYES
6payloadjsonbYES
7actortextYES
8created_ontimestamp with time zoneYESnow()

Table: herobm_core.inventory_ledger

#ColumnData TypeNullableDefaultConstraints & Relationships
1ledger_iduuidNOgen_random_uuid()🔑 PK
2entry_iduuidNO🔗 inventory_entries.entry_id
3product_iduuidNO🔗 products.product_id
4bin_iduuidNO🔗 bins.bin_id
5location_iduuidNO🔗 locations.location_id
6zone_iduuidNO🔗 zones.zone_id
7quantitynumericNO

Table: herobm_core.locations

#ColumnData TypeNullableDefaultConstraints & Relationships
1location_iduuidNOgen_random_uuid()🔑 PK
2codetextNOUNIQUE
3nametextNO
4address_line_1textYES
5address_line_2textYES
6citytextYES
7state_or_provincetextYES
8countrytextYES
9postal_codetextYES
10source_idtextYESUNIQUE
11sourcetextNO
12created_bytextYES
13created_ontimestamp with time zoneYESnow()
14modified_ontimestamp with time zoneYESnow()

Table: herobm_core.transfer_order_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1transfer_order_line_iduuidNOgen_random_uuid()🔑 PK
2transfer_order_iduuidNO🔗 transfer_orders.transfer_order_id
3product_iduuidNO🔗 products.product_id
4quantitynumericNO
5quantity_shippednumericYES
6quantity_receivednumericYES

Table: herobm_core.transfer_order_picks

#ColumnData TypeNullableDefaultConstraints & Relationships
1pick_iduuidNOgen_random_uuid()🔑 PK
2transfer_order_iduuidNO🔗 transfer_orders.transfer_order_id
3transfer_order_line_iduuidNO🔗 transfer_order_lines.transfer_order_line_id
4product_iduuidNO🔗 products.product_id
5bin_iduuidYES🔗 bins.bin_id
6quantitynumericNO
7state_codetextNO
8created_bytextYES
9created_ontimestamp with time zoneYESnow()
10modified_ontimestamp with time zoneYESnow()

Table: herobm_core.transfer_order_receipt_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1receipt_line_iduuidNOgen_random_uuid()🔑 PK
2receipt_iduuidNO🔗 transfer_order_receipts.receipt_id
3transfer_order_line_iduuidNO🔗 transfer_order_lines.transfer_order_line_id
4product_iduuidNO🔗 products.product_id
5bin_iduuidNO🔗 bins.bin_id
6quantitynumericNO
7putaway_statustextNO

Table: herobm_core.transfer_order_receipts

#ColumnData TypeNullableDefaultConstraints & Relationships
1receipt_iduuidNOgen_random_uuid()🔑 PK
2transfer_order_iduuidNO🔗 transfer_orders.transfer_order_id
3receipt_numbertextNOUNIQUE
4state_codetextNO
5received_bytextYES
6received_ontimestamp with time zoneYESnow()
7created_ontimestamp with time zoneYESnow()

Table: herobm_core.transfer_order_shipment_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1shipment_line_iduuidNOgen_random_uuid()🔑 PK
2shipment_iduuidNO🔗 transfer_order_shipments.shipment_id
3transfer_order_line_iduuidNO🔗 transfer_order_lines.transfer_order_line_id
4pick_iduuidYES🔗 transfer_order_picks.pick_id
5product_iduuidNO🔗 products.product_id
6quantitynumericNO

Table: herobm_core.transfer_order_shipments

#ColumnData TypeNullableDefaultConstraints & Relationships
1shipment_iduuidNOgen_random_uuid()🔑 PK
2transfer_order_iduuidNO🔗 transfer_orders.transfer_order_id
3shipment_numbertextNOUNIQUE
4tracking_numbertextYES
5carrier_iduuidYES
6notestextYES
7state_codetextNO
8shipped_bytextYES
9shipped_ontimestamp with time zoneYESnow()
10created_ontimestamp with time zoneYESnow()

Table: herobm_core.transfer_orders

#ColumnData TypeNullableDefaultConstraints & Relationships
1transfer_order_iduuidNOgen_random_uuid()🔑 PK
2order_numbertextNOUNIQUE
3source_location_iduuidNO🔗 locations.location_id
4destination_location_iduuidNO🔗 locations.location_id
5state_codetextNO
6notestextYES
7shipping_notestextYES
8created_bytextYES
9created_ontimestamp with time zoneYESnow()
10modified_ontimestamp with time zoneYESnow()

Table: herobm_core.warehouse_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO
3entity_iduuidNO
4event_typetextNO
5entity_display_nametextYES
6payloadjsonbYES
7actortextYES
8created_ontimestamp with time zoneYESnow()

Table: herobm_core.zones

#ColumnData TypeNullableDefaultConstraints & Relationships
1zone_iduuidNOgen_random_uuid()🔑 PK
2location_iduuidNO🔗 locations.location_id, ⚡ UNIQUE
3codetextNOUNIQUE
4nametextNO
5source_idtextYESUNIQUE
6sourcetextNO
7created_bytextYES
8created_ontimestamp with time zoneYESnow()
9modified_ontimestamp with time zoneYESnow()

Financials & General Ledger

Chart of accounts, double-entry journals, fiscal periods, bank reconciliation, tax positions, and payments.

Table: herobm_core.activities

#ColumnData TypeNullableDefaultConstraints & Relationships
1activity_iduuidNOgen_random_uuid()🔑 PK
2codetextNOUNIQUE
3nametextNO
4is_systembooleanNO
5is_activebooleanNO
6created_ontimestamp with time zoneYESnow()
7modified_ontimestamp with time zoneYESnow()

Table: herobm_core.bank_statement_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1line_iduuidNOgen_random_uuid()🔑 PK
2gl_account_iduuidNO🔗 gl_accounts.gl_account_id
3datedateNO
4descriptiontextNO
5amountnumericNO
6referencetextYES
7typetextYES
8payeetextYES
9is_reconciledbooleanNO
10reconciliation_iduuidYES🔗 gl_reconciliations.reconciliation_id
11matched_journal_line_iduuidYES🔗 gl_journal_lines.journal_line_id
12match_group_iduuidYES🔗 gl_match_groups.match_group_id
13created_ontimestamp with time zoneYESnow()

Table: herobm_core.cost_centers

#ColumnData TypeNullableDefaultConstraints & Relationships
1cost_center_iduuidNOgen_random_uuid()🔑 PK
2codetextNOUNIQUE
3nametextNO
4is_systembooleanNO
5is_activebooleanNO
6created_ontimestamp with time zoneYESnow()
7modified_ontimestamp with time zoneYESnow()

Table: herobm_core.csv_mapping_profiles

#ColumnData TypeNullableDefaultConstraints & Relationships
1profile_iduuidNOgen_random_uuid()🔑 PK
2nametextNO
3date_columntextNO
4amount_columntextYES
5debit_columntextYES
6credit_columntextYES
7description_columntextNO
8type_columntextYES
9payee_columntextYES
10reference_columntextYES
11header_rowsintegerNO
12created_ontimestamp with time zoneYESnow()

Table: herobm_core.exchange_rates

#ColumnData TypeNullableDefaultConstraints & Relationships
1exchange_rate_iduuidNOgen_random_uuid()🔑 PK
2currency_codetextNOUNIQUE, 🏷️ CHECK
3currency_nametextNO
4buy_ratenumericNO
5sell_ratenumericNO
6effective_datetimestampYESnow()UNIQUE
7updated_ontimestampYESnow()

Table: herobm_core.financial_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO
3entity_iduuidNO
4event_typetextNO
5entity_display_nametextYES
6payloadjsonbYES
7actortextYES
8created_ontimestamp with time zoneYESnow()

Table: herobm_core.gl_accounts

#ColumnData TypeNullableDefaultConstraints & Relationships
1gl_account_iduuidNOgen_random_uuid()🔑 PK
2account_codetextNOUNIQUE
3nametextNO
4account_typetextNO
5parent_account_iduuidYES
6is_groupbooleanNO
7is_systembooleanNO
8is_bank_accountbooleanNO
9currency_codetextNO🏷️ CHECK
10metadatajsonbYES
11is_activebooleanNO
12created_ontimestamp with time zoneYESnow()

Table: herobm_core.gl_fiscal_periods

#ColumnData TypeNullableDefaultConstraints & Relationships
1period_iduuidNOgen_random_uuid()🔑 PK
2period_nametextNOUNIQUE
3fiscal_yearintegerNO
4period_numberintegerNO
5start_datedateNO
6end_datedateNO
7statustextNO
8locked_bytextYES
9locked_attimestamp with time zoneYES
10closed_bytextYES
11closed_attimestamp with time zoneYES
12notestextYES
13created_ontimestamp with time zoneYESnow()
14modified_ontimestamp with time zoneYESnow()

Table: herobm_core.gl_journal_entries

#ColumnData TypeNullableDefaultConstraints & Relationships
1journal_entry_iduuidNOgen_random_uuid()🔑 PK
2entry_numbertextNOUNIQUE
3entry_datedateNO
4memotextYES
5source_typetextNO
6source_iduuidYES
7is_reversedbooleanNO
8reversed_byuuidYES🔗 gl_journal_entries.journal_entry_id
9created_bytextYES
10created_ontimestamp with time zoneYESnow()

Table: herobm_core.gl_journal_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1journal_line_iduuidNOgen_random_uuid()🔑 PK
2journal_entry_iduuidNO🔗 gl_journal_entries.journal_entry_id
3gl_account_iduuidNO🔗 gl_accounts.gl_account_id
4party_typetextYES
5party_idtextYES
6debitnumericNO
7creditnumericNO
8foreign_debitnumericNO
9foreign_creditnumericNO
10foreign_currency_codetextYES
11exchange_ratenumericYES
12memotextYES
13is_reconciledbooleanNO
14reconciliation_iduuidYES🔗 gl_reconciliations.reconciliation_id
15cost_center_iduuidYES🔗 cost_centers.cost_center_id
16activity_iduuidYES🔗 activities.activity_id
17match_group_iduuidYES🔗 gl_match_groups.match_group_id

Table: herobm_core.gl_match_groups

#ColumnData TypeNullableDefaultConstraints & Relationships
1match_group_iduuidNOgen_random_uuid()🔑 PK
2match_typetextNO
3rule_iduuidYES🔗 reconciliation_rules.rule_id
4created_bytextNO
5created_ontimestamp with time zoneYESnow()

Table: herobm_core.gl_reconciliations

#ColumnData TypeNullableDefaultConstraints & Relationships
1reconciliation_iduuidNOgen_random_uuid()🔑 PK
2gl_account_iduuidNO🔗 gl_accounts.gl_account_id
3statement_datedateNO
4statement_balancenumericNO
5statustextNO
6created_bytextYES
7created_ontimestamp with time zoneYESnow()
8posted_ontimestamp with time zoneYES

Table: herobm_core.gl_settings

#ColumnData TypeNullableDefaultConstraints & Relationships
1settings_iduuidNOgen_random_uuid()🔑 PK
2account_metadata_schemajsonbYES
3fiscal_year_start_monthintegerNO
4bank_match_date_tolerance_daysintegerNO
5default_ar_account_iduuidYES🔗 gl_accounts.gl_account_id
6default_ap_account_iduuidYES🔗 gl_accounts.gl_account_id
7default_revenue_account_iduuidYES🔗 gl_accounts.gl_account_id
8default_cogs_account_iduuidYES🔗 gl_accounts.gl_account_id
9default_sales_tax_account_iduuidYES🔗 gl_accounts.gl_account_id
10default_purchase_tax_account_iduuidYES🔗 gl_accounts.gl_account_id
11default_expense_account_iduuidYES🔗 gl_accounts.gl_account_id
12default_inventory_account_iduuidYES🔗 gl_accounts.gl_account_id
13default_grni_account_iduuidYES🔗 gl_accounts.gl_account_id
14realised_fx_gain_account_iduuidYES🔗 gl_accounts.gl_account_id
15realised_fx_loss_account_iduuidYES🔗 gl_accounts.gl_account_id
16unrealised_fx_gain_account_iduuidYES🔗 gl_accounts.gl_account_id
17unrealised_fx_loss_account_iduuidYES🔗 gl_accounts.gl_account_id
18default_shrinkage_account_iduuidYES🔗 gl_accounts.gl_account_id
19default_ppv_account_iduuidYES🔗 gl_accounts.gl_account_id
20default_cost_center_iduuidYES🔗 cost_centers.cost_center_id
21default_activity_iduuidYES🔗 activities.activity_id
22base_currencytextNO
23supported_batch_payment_formatsjsonbYES
24revenue_routing_precedencetextNO
25expense_routing_precedencetextNO
26default_fee_revenue_account_iduuidYES🔗 gl_accounts.gl_account_id
27default_discounts_received_account_iduuidYES🔗 gl_accounts.gl_account_id
28default_discounts_given_account_iduuidYES🔗 gl_accounts.gl_account_id

Table: herobm_core.payment_allocations

#ColumnData TypeNullableDefaultConstraints & Relationships
1allocation_iduuidNOgen_random_uuid()🔑 PK
2payment_iduuidNO🔗 payment_entries.payment_id
3reference_typetextNO
4reference_iduuidNO
5allocated_amountnumericNO
6discount_amountnumericYES
7created_ontimestamp with time zoneYESnow()

Table: herobm_core.payment_entries

#ColumnData TypeNullableDefaultConstraints & Relationships
1payment_iduuidNOgen_random_uuid()🔑 PK
2payment_numbertextNOUNIQUE
3payment_typetextNO
4party_iduuidYES
5payment_datetimestamp with time zoneNO
6mode_of_paymenttextNO
7total_amountnumericNO
8unallocated_amountnumericNO
9gl_account_bankuuidNO🔗 gl_accounts.gl_account_id
10reference_numbertextYES
11state_codetextNO
12base_total_amountnumericYES
13base_unallocated_amountnumericYES
14currency_codetextNO
15exchange_ratenumericNO
16created_bytextYES
17aba_exported_attimestamp with time zoneYES
18created_ontimestamp with time zoneYESnow()
19modified_ontimestamp with time zoneYESnow()

Table: herobm_core.payment_lines

#ColumnData TypeNullableDefaultConstraints & Relationships
1payment_line_iduuidNOgen_random_uuid()🔑 PK
2payment_iduuidNO🔗 payment_entries.payment_id
3gl_account_iduuidNO🔗 gl_accounts.gl_account_id
4amountnumericNO
5memotextYES

Table: herobm_core.reconciliation_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO
3entity_iduuidNO
4event_typetextNO
5entity_display_nametextYES
6payloadjsonbYES
7actortextYES
8created_ontimestamp with time zoneYESnow()

Table: herobm_core.reconciliation_rules

#ColumnData TypeNullableDefaultConstraints & Relationships
1rule_iduuidNOgen_random_uuid()🔑 PK
2gl_account_idsjsonbYES
3condition_typetextYES
4condition_valuetextYES
5type_conditiontextYES
6payee_condition_typetextYES
7payee_condition_valuetextYES
8amount_minnumericYES
9amount_maxnumericYES
10target_gl_account_iduuidNO🔗 gl_accounts.gl_account_id
11cost_center_iduuidYES🔗 cost_centers.cost_center_id
12activity_iduuidYES🔗 activities.activity_id
13party_typetextYES
14party_idtextYES
15memotextYES
16priorityintegerNO
17created_ontimestamp with time zoneYESnow()

Table: herobm_core.tax_categories

#ColumnData TypeNullableDefaultConstraints & Relationships
1tax_category_iduuidNOgen_random_uuid()🔑 PK
2codetextNOUNIQUE
3titletextNO
4typetextNO
5ratenumericYES
6sales_gl_account_iduuidYES
7purchase_gl_account_iduuidYES

Table: herobm_core.tax_position_mappings

#ColumnData TypeNullableDefaultConstraints & Relationships
1mapping_iduuidNOgen_random_uuid()🔑 PK
2tax_position_iduuidNO🔗 tax_positions.tax_position_id (cascade)
3source_tax_category_iduuidNO🔗 tax_categories.tax_category_id (cascade)
4destination_tax_category_iduuidNO🔗 tax_categories.tax_category_id (cascade)

Table: herobm_core.tax_positions

#ColumnData TypeNullableDefaultConstraints & Relationships
1tax_position_iduuidNOgen_random_uuid()🔑 PK
2codetextNOUNIQUE
3titletextNO

Manufacturing & Work Orders

Production work orders, component allocations, and manufacturing picking tickets.

Table: herobm_core.work_order_components

#ColumnData TypeNullableDefaultConstraints & Relationships
1work_order_component_iduuidNOgen_random_uuid()🔑 PK
2work_order_iduuidNO🔗 work_orders.work_order_id
3product_iduuidNO🔗 products.product_id
4expected_quantitynumericNO
5unit_costnumericYES

Table: herobm_core.work_order_picks

#ColumnData TypeNullableDefaultConstraints & Relationships
1pick_iduuidNOgen_random_uuid()🔑 PK
2work_order_iduuidNO🔗 work_orders.work_order_id
3work_order_component_iduuidNO🔗 work_order_components.work_order_component_id
4bin_iduuidYES🔗 bins.bin_id
5quantitynumericNO
6state_codetextNO🏷️ CHECK
7created_bytextYES
8created_ontimestamp with time zoneYESnow()
9modified_ontimestamp with time zoneYESnow()

Table: herobm_core.work_orders

#ColumnData TypeNullableDefaultConstraints & Relationships
1work_order_iduuidNOgen_random_uuid()🔑 PK
2order_numbertextNOUNIQUE
3product_iduuidNO🔗 products.product_id
4target_quantitynumericNO
5completed_quantitynumericNO
6location_iduuidNO🔗 locations.location_id
7wip_bin_iduuidYES🔗 bins.bin_id
8output_bin_iduuidYES🔗 bins.bin_id
9state_codetextNO🏷️ CHECK
10putaway_statustextYES
11assembly_cost_per_unitnumericYES
12additional_costnumericYES
13total_costnumericYES
14created_bytextYES
15created_ontimestamp with time zoneYESnow()
16modified_ontimestamp with time zoneYESnow()

System, Security & Telemetry

User access control, API keys, webhook outbox, PDF reports, async ELT pipeline jobs, and system event logs.

Table: herobm_core._pipeline_jobs

#ColumnData TypeNullableDefaultConstraints & Relationships
1job_idtextNO🔑 PK
2typetextNO
3statustextNO
4config_jsonjsonbYES
5progress_jsonjsonbYES
6logs_jsonjsonbYES
7created_attimestampNOnow()
8updated_attimestampNOnow()

Table: herobm_core.api_keys

#ColumnData TypeNullableDefaultConstraints & Relationships
1api_key_iduuidNOgen_random_uuid()🔑 PK
2nametextNO
3key_hashtextNO
4prefixtextNO
5roletextNO
6is_activebooleanNO
7created_bytextNO
8created_ontimestamp with time zoneYESnow()

Table: herobm_core.app_settings

#ColumnData TypeNullableDefaultConstraints & Relationships
1settings_iduuidNOgen_random_uuid()🔑 PK
2default_fulfillment_location_iduuidYES🔗 locations.location_id
3default_customer_terms_iduuidYES🔗 trading_terms.trading_terms_id
4default_supplier_terms_iduuidYES🔗 trading_terms.trading_terms_id
5default_customer_tax_position_iduuidYES🔗 tax_positions.tax_position_id
6default_supplier_tax_position_iduuidYES🔗 tax_positions.tax_position_id
7default_purchase_tax_category_iduuidYES🔗 tax_categories.tax_category_id
8default_sales_tax_category_iduuidYES🔗 tax_categories.tax_category_id
9inventory_valuation_methodtextNO
10inventory_accounting_modetextNO
11credit_limit_behaviortextNO
12smtp_hosttextYES
13smtp_portintegerYES
14smtp_usertextYES
15smtp_pass_encryptedtextYES
16smtp_from_addresstextYES
17actor_tagsjsonbYES
18actor_contact_rolesjsonbYES
19project_contact_rolesjsonbYES
20project_actor_rolesjsonbYES
21project_statusesjsonbYES
22project_typesjsonbYES
23referral_modesjsonbYES
24sales_analysis_codesjsonbYES
25api_rate_limitnumericNO
26setup_completed_attimestamp with time zoneYES
27system_identifiertextYES
28active_license_keytextYES
29active_license_payloadjsonbYES
30tax_provider_mappingsjsonbYES
31enrichment_provider_mappingsjsonbYES

Table: herobm_core.business_report_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO
3entity_iduuidNO
4event_typetextNO
5entity_display_nametextYES
6payloadjsonbYES
7actortextYES
8created_ontimestamp with time zoneYESnow()

Table: herobm_core.business_reports

#ColumnData TypeNullableDefaultConstraints & Relationships
1iduuidNOgen_random_uuid()🔑 PK
2slugtextNOUNIQUE
3nametextNO
4descriptiontextYES
5data_source_hooktextNO
6ui_configjsonbNO
7is_systembooleanNO
8created_attimestamp with time zoneNOnow()

Table: herobm_core.casbin_rule

#ColumnData TypeNullableDefaultConstraints & Relationships
1iduuidNOgen_random_uuid()🔑 PK
2ptypetextNO
3v0textYES
4v1textYES
5v2textYES
6v3textYES
7v4textYES
8v5textYES

Table: herobm_core.email_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO
3entity_iduuidNO
4event_typetextNO
5entity_display_nametextYES
6payloadjsonbYES
7actortextYES
8created_ontimestamp with time zoneYESnow()

Table: herobm_core.email_outbox

#ColumnData TypeNullableDefaultConstraints & Relationships
1iduuidNOgen_random_uuid()🔑 PK
2entity_typetextYES
3entity_iduuidYES
4to_addresstextNO
5reply_totextYES
6subjecttextNO
7html_bodytextNO
8attachmentsjsonbYES
9statusemail_statusNO
10retriesintegerNO
11last_errortextYES
12next_retry_attimestamp with time zoneYES
13created_attimestamp with time zoneNOnow()
14processed_attimestamp with time zoneYES

Table: herobm_core.group_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO
3entity_iduuidNO
4event_typetextNO
5entity_display_nametextYES
6payloadjsonbYES
7actortextYES
8created_ontimestamp with time zoneYESnow()

Table: herobm_core.integration_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO
3entity_iduuidNO
4event_typetextNO
5entity_display_nametextYES
6payloadjsonbYES
7actortextYES
8created_ontimestamp with time zoneYESnow()

Table: herobm_core.integrations

#ColumnData TypeNullableDefaultConstraints & Relationships
1integration_iduuidNOgen_random_uuid()🔑 PK
2providertextNOUNIQUE
3configjsonbNO
4is_activebooleanNO
5created_ontimestamp with time zoneYESnow()
6modified_ontimestamp with time zoneYESnow()

Table: herobm_core.macros

#ColumnData TypeNullableDefaultConstraints & Relationships
1macro_iduuidNOgen_random_uuid()🔑 PK
2nametextNOUNIQUE
3macro_typetextNO
4contenttextNO
5created_ontimestamp with time zoneYESnow()
6modified_ontimestamp with time zoneYESnow()

Table: herobm_core.master_data_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO
3entity_iduuidNO
4event_typetextNO
5entity_display_nametextYES
6payloadjsonbYES
7actortextYES
8created_ontimestamp with time zoneYESnow()

Table: herobm_core.organization

#ColumnData TypeNullableDefaultConstraints & Relationships
1organization_iduuidNOgen_random_uuid()🔑 PK
2nametextNO
3address_line_1textYES
4address_line_2textYES
5citytextYES
6statetextYES
7countrytextYES
8post_codetextYES
9emailtextYES
10phonetextYES
11websitetextYES
12company_numbertextYES
13tax_numbertextYES
14logo_urltextYES
15bank_nametextYES
16bank_account_nametextYES
17bank_account_numbertextYES
18bank_swift_bictextYES
19bank_ibantextYES

Table: herobm_core.outbox

#ColumnData TypeNullableDefaultConstraints & Relationships
1outbox_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO
3entity_iduuidNO
4event_typetextNO
5entity_display_nametextYES
6payloadjsonbYES
7created_ontimestamp with time zoneYESnow()
8processed_attimestamp with time zoneYES
9locked_untiltimestamp with time zoneYES
10last_errortextYES

Table: herobm_core.pdf_template_contexts

#ColumnData TypeNullableDefaultConstraints & Relationships
1template_iduuidNO🔗 pdf_templates.id (cascade)
2contexttextNO

Table: herobm_core.pdf_template_hooks

#ColumnData TypeNullableDefaultConstraints & Relationships
1iduuidNOgen_random_uuid()🔑 PK
2hook_slugtextNOUNIQUE
3report_iduuidNO🔗 pdf_templates.id (cascade)
4context_slugtextNO
5updated_attimestamp with time zoneNOnow()

Table: herobm_core.pdf_templates

#ColumnData TypeNullableDefaultConstraints & Relationships
1iduuidNOgen_random_uuid()🔑 PK
2slugtextNOUNIQUE
3nametextNO
4descriptiontextYES
5templatetextNO
6mock_datajsonbYES
7context_resolvertextYES
8output_name_patterntextYES
9created_attimestamp with time zoneNOnow()

Table: herobm_core.system_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2entity_typetextNO
3entity_iduuidNO
4event_typetextNO
5entity_display_nametextYES
6payloadjsonbYES
7actortextYES
8created_ontimestamp with time zoneYESnow()

Table: herobm_core.user_events

#ColumnData TypeNullableDefaultConstraints & Relationships
1event_iduuidNOgen_random_uuid()🔑 PK
2user_iduuidNO🔗 users.user_id (cascade)
3event_typetextNO
4entity_display_nametextYES
5payloadjsonbYES
6actortextYES
7created_ontimestamp with time zoneYESnow()

Table: herobm_core.user_settings

#ColumnData TypeNullableDefaultConstraints & Relationships
1user_iduuidNO🔑 PK, 🔗 users.user_id (cascade)
2dashboard_configjsonbYES
3report_configsjsonbYES
4preferencesjsonbYES
5created_attimestamp with time zoneNOnow()
6updated_attimestamp with time zoneNOnow()

Table: herobm_core.user_two_factor

#ColumnData TypeNullableDefaultConstraints & Relationships
1user_iduuidNO🔑 PK, 🔗 users.user_id (cascade)
2secret_encryptedtextNO
3is_enabledbooleanNO
4backup_codesjsonbNO
5verified_attimestamp with time zoneYES
6created_attimestamp with time zoneNOnow()
7updated_attimestamp with time zoneNOnow()

Table: herobm_core.users

#ColumnData TypeNullableDefaultConstraints & Relationships
1user_iduuidNOgen_random_uuid()🔑 PK
2usernametextNOUNIQUE
3password_hashtextNO
4display_nametextYES
5emailtextYES
6roletextNO
7is_activebooleanNO
8created_attimestamp with time zoneNOnow()

Table: herobm_core.webhooks

#ColumnData TypeNullableDefaultConstraints & Relationships
1webhook_iduuidNOgen_random_uuid()🔑 PK
2target_urltextNO
3event_typesjsonbNO
4secret_keytextNO
5is_activebooleanNO
6created_ontimestamp with time zoneYESnow()

Field Reference & Data Dictionary

Key database fields, input parameters, and definitions associated with this workflow screen:

Field / Parameter Display Name Description & Rules
table_name Table Name Relational table identifier within herobm_core schema.
primary_key Primary Key Unique UUID identifier generated by gen_random_uuid().
foreign_key Foreign Key Referential integrity link to another domain entity.
column_type Column Type PostgreSQL data type (e.g. uuid, text, numeric, jsonb, boolean, timestamptz).