Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| id | uuid | 2147483647 | gen_random_uuid() |
|
|
||||||
| catalog_item_id | uuid | 2147483647 | null |
|
|
||||||
| practice_location_id | text | 2147483647 | null |
|
|
||||||
| lot_number | text | 2147483647 | null |
|
|
||||||
| expiration_date | date | 13 | √ | null |
|
|
|||||
| received_quantity | int4 | 10 | null |
|
|
||||||
| remaining_quantity | int4 | 10 | null |
|
|
||||||
| received_on | date | 13 | √ | null |
|
|
|||||
| is_active | bool | 1 | true |
|
|
||||||
| legacy_item_lot_id | text | 2147483647 | √ | null |
|
|
|||||
| legacy_payload | jsonb | 2147483647 | '{}'::jsonb |
|
|
||||||
| created_at | timestamptz | 35,6 | now() |
|
|
||||||
| updated_at | timestamptz | 35,6 | now() |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| catalog_item_lots_pkey | Primary key | Asc | id |
| catalog_item_lots_item_idx | Performance | Asc | catalog_item_id |
| catalog_item_lots_item_location_lot_number_idx | Performance | Asc/Asc/Asc | catalog_item_id + practice_location_id + lot_number |
| catalog_item_lots_legacy_unique | Must be unique | Asc | legacy_item_lot_id |
| catalog_item_lots_location_active_idx | Performance | Asc/Asc/Asc | practice_location_id + is_active + remaining_quantity |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| catalog_item_lots_remaining_quantity_check | ((remaining_quantity >= 0)) |
| catalog_item_lots_check | ((remaining_quantity <= received_quantity)) |
| catalog_item_lots_received_quantity_check | ((received_quantity > 0)) |



