devices
Serialized inventory devices with charge and expiration tracking.
| Name | Type | Nullable | Default Value | Notes |
|---|---|---|---|---|
PKID | integer | Device ID | ||
fork forks.ID | integer | Fork ID (`null` for base module) | ||
ownergroup groups.ID | integer | Owner group ID (`null`=PUBLIC) | ||
creator | integer | Creator user ID (defaults to authenticated user on creation) | ||
creationdate | bigint | date_part('epoch', now()) | Creation date and time as a Unix timestamp (defaults to current date and time on creation) | |
lastmodified | bigint | date_part('epoch', now()) | Last modification date and time as a Unix timestamp (auto-reset on modification) | |
item items.ID | integer | Item ID | ||
contract contracts.ID | integer | Contract ID | ||
visibility | smallint | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) | |
serialnum | text | '' | Serial number; is required if `chargenum` is empty, otherwise must be empty | |
chargenum | text | '' | Charge (lot) number; is required if `serialnum` is empty, otherwise must be empty | |
expdate | bigint | Expiry date as a Unix timestamp | ||
description | text | '' | Detailed general description |
| Name | Unique | Nulls Distinct | Primary | Partial | Method | Keys |
|---|---|---|---|---|---|---|
| fk_devices_contract | btree | contract | ||||
| fk_devices_fork | gin | fork | ||||
| fk_devices_ownergroup | gin | ownergroup | ||||
| i_devices_nofork | gin | fork | ||||
| i_devices_noowner | gin | ownergroup | ||||
| pk_devices | btree | ID | ||||
| s_devices_chargenum | gin | chargenum | ||||
| s_devices_serialnum | gin | serialnum | ||||
| u_devices_item_serialnum_chargenum | btree | item, serialnum, chargenum |
| Name | Type |
|---|---|
| c_devices_devicenum | check |
| dc_devices_chargenum | check |
| dc_devices_description | check |
| dc_devices_serialnum | check |
| dc_devices_visibility | check |
| fk_devices_contract | foreign_key |
| fk_devices_fork | foreign_key |
| fk_devices_item | foreign_key |
| fk_devices_ownergroup | foreign_key |
| pk_devices | primary_key |
| u_devices_item_serialnum_chargenum | unique |
| Name | Type | Events | Function | Definition |
|---|---|---|---|---|
| ti_devices_item | before | insert | ftiu_devices_item | |
| tu_devices_item | before | update | ftiu_devices_item |
Loading...