Chapter 9. Schema booking

Table of Contents

Tables in booking
reservation
reservation_attr_value_map
resource
resource_attr
resource_attr_map
resource_attr_value
resource_type

Below are the tables, views and functions for booking

Tables in booking

reservation

  • id bigint PRIMARY KEY DEFAULT nextval('money.billable_xact_id_seq'::regclass)
  • usr integer NOT NULL REFERENCES actor.table.usr
  • xact_start timestamp with time zone NOT NULL DEFAULT now()
  • xact_finish timestamp with time zone
  • unrecovered boolean
  • request_time timestamp with time zone NOT NULL DEFAULT now()
  • start_time timestamp with time zone
  • end_time timestamp with time zone
  • capture_time timestamp with time zone
  • cancel_time timestamp with time zone
  • pickup_time timestamp with time zone
  • return_time timestamp with time zone
  • booking_interval interval
  • fine_interval interval
  • fine_amount numeric(8,2)
  • max_fine numeric(8,2)
  • target_resource_type integer NOT NULL REFERENCES booking.table.resource-type
  • target_resource integer REFERENCES booking.table.resource
  • current_resource integer REFERENCES booking.table.resource
  • request_lib integer NOT NULL REFERENCES actor.table.org-unit
  • pickup_lib integer REFERENCES actor.table.org-unit
  • capture_staff integer REFERENCES actor.table.usr
  • email_notify boolean NOT NULL DEFAULT false

Tables referencing via foreign key constraints

  • action.emergency_closing_reservation
  • action.reservation_transit_copy
  • booking.reservation_attr_value_map

reservation_attr_value_map

  • id serial PRIMARY KEY
  • reservation integer UNIQUE #1 NOT NULL REFERENCES booking.table.reservation
  • attr_value integer UNIQUE #1 NOT NULL REFERENCES booking.table.resource-attr-value

resource

  • id serial PRIMARY KEY
  • owner integer UNIQUE #1 NOT NULL REFERENCES actor.table.org-unit
  • type integer NOT NULL REFERENCES booking.table.resource-type
  • overbook boolean NOT NULL DEFAULT false
  • barcode text UNIQUE #1 NOT NULL
  • deposit boolean NOT NULL DEFAULT false
  • deposit_amount numeric(8,2) NOT NULL DEFAULT 0.00
  • user_fee numeric(8,2) NOT NULL DEFAULT 0.00

Tables referencing via foreign key constraints

  • action.reservation_transit_copy
  • booking.reservation
  • booking.resource_attr_map

resource_attr

  • id serial PRIMARY KEY
  • owner integer NOT NULL REFERENCES actor.table.org-unit
  • name text UNIQUE #1 NOT NULL
  • resource_type integer UNIQUE #1 NOT NULL REFERENCES booking.table.resource-type
  • required boolean NOT NULL DEFAULT false

Tables referencing via foreign key constraints

  • booking.resource_attr_map
  • booking.resource_attr_value

resource_attr_map

  • id serial PRIMARY KEY
  • resource integer UNIQUE #1 NOT NULL REFERENCES booking.table.resource
  • resource_attr integer UNIQUE #1 NOT NULL REFERENCES booking.table.resource-attr
  • value integer NOT NULL REFERENCES booking.table.resource-attr-value

resource_attr_value

  • id serial PRIMARY KEY
  • owner integer UNIQUE #1 NOT NULL REFERENCES actor.table.org-unit
  • attr integer UNIQUE #1 NOT NULL REFERENCES booking.table.resource-attr
  • valid_value text UNIQUE #1 NOT NULL

Tables referencing via foreign key constraints

  • booking.reservation_attr_value_map
  • booking.resource_attr_map

resource_type

  • id serial PRIMARY KEY
  • name text UNIQUE #1 NOT NULL
  • elbow_room interval
  • fine_interval interval
  • fine_amount numeric(8,2) NOT NULL
  • max_fine numeric(8,2)
  • owner integer UNIQUE #1 NOT NULL REFERENCES actor.table.org-unit
  • catalog_item boolean NOT NULL DEFAULT false
  • transferable boolean NOT NULL DEFAULT false
  • record bigint UNIQUE #1 REFERENCES biblio.table.record-entry

Tables referencing via foreign key constraints

  • booking.reservation
  • booking.resource
  • booking.resource_attr