Schema Reference
products
The product catalog. One row per SKU.
| Column | Type | Description |
|---|---|---|
id | bigint PK | Auto-increment |
name | text | Product name (e.g. "Jack Daniel's Tennessee Whiskey") |
sku | text | SKU / barcode |
category | text | Category (e.g. "Spirits") |
size_ml | numeric | Bottle/keg volume in mL |
location_id | bigint FK | Owning location |
created_at | timestamptz |
products_tag
Links an RFID tag (EPC) to a product.
| Column | Type | Description |
|---|---|---|
id | bigint PK | |
product_id | bigint FK | References products.id |
tag_epc | text | EPC identifier (uppercase hex, no spaces) |
tag_id | text | TID bank value (populated after first TID read) |
tag_status | text | "Active", "Offline", "Removed" |
location_id | bigint FK | |
created_at | timestamptz |
rfid_events
Every tag scan and movement event. The source of truth for where a tag was last seen.
See RFID Events for full documentation.
device_config
Stores arbitrary configuration blobs for devices. Used by Parlevel for per-location RFID settings.
| Column | Type | Description |
|---|---|---|
id | uuid PK | |
config | jsonb | Config payload. For RFID: { configType: "rfid_settings", u300: {...}, ... } |
created_at | timestamptz | |
updated_at | timestamptz |
location_device_config
Join table linking device configs to locations.
| Column | Type | Description |
|---|---|---|
id | bigint PK | |
location_id | bigint FK | References locations.id |
config_id | uuid FK | References device_config.id |
updated_at | timestamptz |
A location can have multiple config rows (one per device type). Parlevel identifies the RFID config by config.configType === "rfid_settings".
When a config row is shared between multiple locations (e.g. a template was duplicated), saving an update for one location forks it into a new row rather than modifying the shared one.
rfid_tag_families
Calibration and classification parameters for sensor tag families.
| Column | Type | Description |
|---|---|---|
id | uuid PK | |
name | text UNIQUE | Family identifier, e.g. "AZN3120-AFR" |
tid_prefix | text | First 3 bytes of TID bank (hex), e.g. "E28240" |
description | text | Human-readable description |
calibration | jsonb | Array of { sc, volumeMl } calibration points |
level_bands | jsonb | Array of { label, minSc, maxSc } level bands |
min_reads | integer | Minimum stable readings before emitting a level |
ambiguous_zones | jsonb | Array of { centerSc, halfWidthSc } hysteresis zones |
created_at | timestamptz | |
updated_at | timestamptz |
storerooms
Back-of-house storage areas.
| Column | Type | Description |
|---|---|---|
id | bigint PK | |
name | text | Area name |
location_id | bigint FK | Owning location |
reader_id | text | RFID reader ID assigned to this area |
status | integer | 1 = active |
zones
Service areas / outlets (bar stations, etc.).
| Column | Type | Description |
|---|---|---|
id | bigint PK | |
name | text | Zone name |
location_id | bigint FK | Owning location |
zone_type | text | "outlet", "bar", etc. |
status | integer | 1 = active |