facilities

0 rows


Description

Physical locations at a site. For example, each seed bank and each nursery is a facility.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id int8 19 null
batch_sub_locations.facility_id batch_sub_locations_facility_id_fkeyC
batches.facility_id batches_facility_id_fkeyC
withdrawals.destination_facility_id withdrawals_destination_facility_id_fkeyN
withdrawals.facility_id withdrawals_facility_id_fkeyC
automations.facility_id automations_facility_id_fkeyC
device_managers.facility_id device_managers_facility_id_fkeyR
devices.facility_id devices_facility_id_fkeyC
accessions.facility_id accessions_facility_id_fkeyC
type_id int4 10 null
name text 2147483647 null
created_time timestamptz 35,6 null
modified_time timestamptz 35,6 null
created_by int8 19 null
modified_by int8 19 null
max_idle_minutes int4 10 30

Send an alert if this many minutes pass without new timeseries data from a facility’s device manager.

last_timeseries_time timestamptz 35,6 null

When the most recent timeseries data was received from the facility.

idle_after_time timestamptz 35,6 null

Time at which the facility will be considered idle if no timeseries data is received. Null if the timeseries has already been marked as idle or if no timeseries data has ever been received from the facility.

idle_since_time timestamptz 35,6 null

Time at which the facility became idle. Null if the facility is not currently considered idle.

description text 2147483647 null
connection_state_id int4 10 1
facility_connection_states.id facilities_connection_state_id_fkeyR
organization_id int8 19 null
organizations.id facilities_organization_id_fkeyC
time_zone text 2147483647 null
last_notification_date date 13 null

Local date on which facility-related notifications were last generated.

next_notification_time timestamptz 35,6 '1970-01-01 00:00:00+00'::timestamp with time zone

Time at which the server should next generate notifications for the facility if any are needed.

build_started_date date 13 null
build_completed_date date 13 null
operation_started_date date 13 null
capacity int4 10 null
facility_number int4 10 null

Indexes

Constraint Name Type Sort Column(s)
site_module_pkey Primary key Asc id
facilities_idle_after_time_idx Performance Asc idle_after_time
facilities_next_notification_time_idx Performance Asc next_notification_time
facilities_organization_id_idx Performance Asc organization_id
facilities_organization_id_type_id_facility_number_key Must be unique Asc/Asc/Asc organization_id + type_id + facility_number

Check Constraints

Constraint Name Constraint
facilities_description_check ((description !~ similar_to_escape(' *'::text)))

Relationships