Chapter 20. Schema rating

Table of Contents

Tables in rating
badge
badge_with_orgs
popularity_parameter
record_badge_score
Functions in rating

Below are the tables, views and functions for rating

Tables in rating

badge

  • id serial PRIMARY KEY
  • name text UNIQUE #1 NOT NULL
  • description text
  • scope integer UNIQUE #1 NOT NULL REFERENCES actor.table.org-unit
  • weight integer NOT NULL DEFAULT 1
  • horizon_age interval
  • importance_age interval
  • importance_interval interval NOT NULL DEFAULT '1 day'::interval
  • importance_scale numeric
  • recalc_interval interval NOT NULL DEFAULT '1 mon'::interval
  • attr_filter text
  • src_filter integer REFERENCES config.table.bib-source
  • circ_mod_filter text REFERENCES config.table.circ-modifier
  • loc_grp_filter integer REFERENCES asset.table.copy-location-group
  • popularity_parameter integer NOT NULL REFERENCES rating.table.popularity-parameter
  • fixed_rating integer
  • percentile numeric
  • discard integer NOT NULL
  • last_calc timestamp with time zone

Constraints on badge

  • badge_fixed_rating_check CHECK
  • badge_importance_scale_check CHECK
  • badge_percentile_check CHECK

Tables referencing via foreign key constraints

  • rating.record_badge_score

badge_with_orgs

  • id integer
  • name text
  • description text
  • scope integer
  • weight integer
  • horizon_age interval
  • importance_age interval
  • importance_interval interval
  • importance_scale numeric
  • recalc_interval interval
  • attr_filter text
  • src_filter integer
  • circ_mod_filter text
  • loc_grp_filter integer
  • popularity_parameter integer
  • fixed_rating integer
  • percentile numeric
  • discard integer
  • last_calc timestamp with time zone
  • orgs integer[]

popularity_parameter

  • id integer PRIMARY KEY
  • name text UNIQUE NOT NULL
  • description text
  • func text
  • require_horizon boolean NOT NULL DEFAULT false
  • require_importance boolean NOT NULL DEFAULT false
  • require_percentile boolean NOT NULL DEFAULT false

Tables referencing via foreign key constraints

  • rating.badge

record_badge_score

  • id bigserial PRIMARY KEY
  • record bigint UNIQUE #1 NOT NULL REFERENCES biblio.table.record-entry
  • badge integer UNIQUE #1 NOT NULL REFERENCES rating.table.badge
  • score integer NOT NULL

Constraints on record_badge_score

  • record_badge_score_score_check CHECK

Indexes on record_badge_score

  • record_badge_score_badge_idx badge
  • record_badge_score_record_idx record