devices
| Name | Type | Storage | Nullable | Foreign Keys | Default Value & Notes |
|---|---|---|---|---|---|
| PKID | integer | plain | Device ID | ||
| fork | integer | plain | forks.ID | Fork ID (`null` for base module) | |
| ownergroup | integer | plain | groups.ID | Owner group ID (`null`=PUBLIC) | |
| creator | integer | plain | users.ID | Creator user ID (defaults to authenticated user on creation) | |
| creationdate | bigint | plain | Default: date_part('epoch', now())Creation date and time as a Unix timestamp (defaults to current date and time on creation) | ||
| lastmodified | bigint | plain | Default: date_part('epoch', now())Last modification date and time as a Unix timestamp (auto-reset on modification) | ||
| item | integer | plain | items.ID | Item ID | |
| contract | integer | plain | contracts.ID | Contract ID | |
| visibility | smallint | plain | Default: 0Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) | ||
| serialnum | text | main | Default: ''Serial number; is required if `chargenum` is empty, otherwise must be empty | ||
| chargenum | text | main | Default: ''Charge (lot) number; is required if `serialnum` is empty, otherwise must be empty | ||
| expdate | bigint | plain | Expiry date as a Unix timestamp | ||
| description | text | extended | Default: ''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_creator | 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...