erDiagram
mart_ordering {
INT order_history_item_id PK
VARCHAR organisation PK
}
ordering {
INT order_history_item_id PK
VARCHAR organisation PK
}
stg_order_history_item {
INT order_history_item_id PK
VARCHAR organisation PK
}
stg_order_history {
INT order_history_id PK
VARCHAR organisation PK
}
stg_wholesaler {
INT wholesaler_id PK
}
stg_order_history_status {
INT order_history_status_id PK
}
stg_order_history_item_status {
INT order_history_item_status_id PK
}
dim_product_pack {
INT pack_code_id PK
}
active_pharmacy {
INT pharmacy_id PK
VARCHAR organisation PK
}
stg_order_history_item ||--o{ ordering : source
stg_order_history ||--o{ ordering : source
stg_wholesaler ||--o{ ordering : wholesaler_context
stg_order_history_status ||--o{ ordering : status_context
stg_order_history_item_status ||--o{ ordering : item_status_context
dim_product_pack ||--o{ ordering : product_context
active_pharmacy ||--o{ ordering : pharmacy_context
ordering ||--|| mart_ordering : builds