<?xml version="1.0" encoding="UTF-8"?><database name="egdb3_11_7" schema="serial" type="PostgreSQL - 15.10 (Ubuntu 15.10-1.pgdg24.04+1)">
   <sequences>
      <sequence increment="1" name="basic_summary_id_seq" startValue="1"/>
      <sequence increment="1" name="caption_and_pattern_id_seq" startValue="1"/>
      <sequence increment="1" name="distribution_id_seq" startValue="1"/>
      <sequence increment="1" name="distribution_note_id_seq" startValue="1"/>
      <sequence increment="1" name="index_summary_id_seq" startValue="1"/>
      <sequence increment="1" name="issuance_id_seq" startValue="1"/>
      <sequence increment="1" name="item_id_seq" startValue="1"/>
      <sequence increment="1" name="item_note_id_seq" startValue="1"/>
      <sequence increment="1" name="materialized_holding_code_id_seq" startValue="1"/>
      <sequence increment="1" name="pattern_template_id_seq" startValue="1"/>
      <sequence increment="1" name="record_entry_id_seq" startValue="1"/>
      <sequence increment="1" name="routing_list_user_id_seq" startValue="1"/>
      <sequence increment="1" name="stream_id_seq" startValue="1"/>
      <sequence increment="1" name="subscription_id_seq" startValue="1"/>
      <sequence increment="1" name="subscription_note_id_seq" startValue="1"/>
      <sequence increment="1" name="supplement_summary_id_seq" startValue="1"/>
   </sequences>
   <tables>
      <table name="any_summary" numRows="0" remarks="" schema="serial" type="VIEW" viewSql=" SELECT 'basic'::text AS summary_type,&#10;    basic_summary.id,&#10;    basic_summary.distribution,&#10;    basic_summary.generated_coverage,&#10;    basic_summary.textual_holdings,&#10;    basic_summary.show_generated&#10;   FROM serial.basic_summary&#10;UNION&#10; SELECT 'index'::text AS summary_type,&#10;    index_summary.id,&#10;    index_summary.distribution,&#10;    index_summary.generated_coverage,&#10;    index_summary.textual_holdings,&#10;    index_summary.show_generated&#10;   FROM serial.index_summary&#10;UNION&#10; SELECT 'supplement'::text AS summary_type,&#10;    supplement_summary.id,&#10;    supplement_summary.distribution,&#10;    supplement_summary.generated_coverage,&#10;    supplement_summary.textual_holdings,&#10;    supplement_summary.show_generated&#10;   FROM serial.supplement_summary;">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="summary_type" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="id" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="distribution" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="generated_coverage" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="textual_holdings" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="show_generated" nullable="true" remarks="" size="1" type="bool" typeCode="-7"/>
      </table>
      <table name="basic_summary" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.basic_summary_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="distribution" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="basic_summary_distribution_fkey" implied="false" onDeleteCascade="true" schema="serial" table="distribution"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="generated_coverage" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="textual_holdings" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="true" digits="0" id="4" name="show_generated" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="basic_summary_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="serial_basic_summary_dist_idx" unique="false">
            <column ascending="true" name="distribution"/>
         </index>
      </table>
      <table name="caption_and_pattern" numRows="28" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.caption_and_pattern_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4">
            <child column="caption_and_pattern" foreignKey="issuance_caption_and_pattern_fkey" implied="false" onDeleteCascade="true" schema="serial" table="issuance"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="subscription" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="caption_and_pattern_subscription_fkey" implied="false" onDeleteCascade="true" schema="serial" table="subscription"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="type" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="3" name="create_date" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="4" name="start_date" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="5" name="end_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="6" name="active" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="pattern_code" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="enum_1" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="enum_2" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="enum_3" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="enum_4" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="enum_5" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="enum_6" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="chron_1" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="chron_2" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="chron_3" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="chron_4" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="chron_5" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="caption_and_pattern_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="serial_caption_and_pattern_sub_idx" unique="false">
            <column ascending="true" name="subscription"/>
         </index>
         <checkConstraint constraint="((type = ANY (ARRAY['basic'::text, 'supplement'::text, 'index'::text])))" name="cap_type"/>
      </table>
      <table name="distribution" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.distribution_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4">
            <child column="distribution" foreignKey="basic_summary_distribution_fkey" implied="false" onDeleteCascade="true" schema="serial" table="basic_summary"/>
            <child column="distribution" foreignKey="distribution_note_distribution_fkey" implied="false" onDeleteCascade="true" schema="serial" table="distribution_note"/>
            <child column="distribution" foreignKey="index_summary_distribution_fkey" implied="false" onDeleteCascade="true" schema="serial" table="index_summary"/>
            <child column="distribution" foreignKey="stream_distribution_fkey" implied="false" onDeleteCascade="true" schema="serial" table="stream"/>
            <child column="distribution" foreignKey="supplement_summary_distribution_fkey" implied="false" onDeleteCascade="true" schema="serial" table="supplement_summary"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="record_entry" nullable="true" remarks="" size="19" type="int8" typeCode="-5">
            <parent column="id" foreignKey="distribution_record_entry_fkey" implied="false" onDeleteCascade="false" schema="serial" table="record_entry"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="summary_method" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="subscription" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="distribution_subscription_fkey" implied="false" onDeleteCascade="true" schema="serial" table="subscription"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="holding_lib" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="distribution_holding_lib_fkey" implied="false" onDeleteCascade="false" schema="actor" table="org_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="label" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="'chron'::text" digits="0" id="6" name="display_grouping" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="receive_call_number" nullable="true" remarks="" size="19" type="int8" typeCode="-5">
            <parent column="id" foreignKey="distribution_receive_call_number_fkey" implied="false" onDeleteCascade="false" schema="asset" table="call_number"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="receive_unit_template" nullable="true" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="distribution_receive_unit_template_fkey" implied="false" onDeleteCascade="false" schema="asset" table="copy_template"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="bind_call_number" nullable="true" remarks="" size="19" type="int8" typeCode="-5">
            <parent column="id" foreignKey="distribution_bind_call_number_fkey" implied="false" onDeleteCascade="false" schema="asset" table="call_number"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="bind_unit_template" nullable="true" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="distribution_bind_unit_template_fkey" implied="false" onDeleteCascade="false" schema="asset" table="copy_template"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="unit_label_prefix" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="unit_label_suffix" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="distribution_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="one_dist_per_sre_idx" unique="true">
            <column ascending="true" name="record_entry"/>
         </index>
         <index name="serial_distribution_holding_lib_idx" unique="false">
            <column ascending="true" name="holding_lib"/>
         </index>
         <index name="serial_distribution_sub_idx" unique="false">
            <column ascending="true" name="subscription"/>
         </index>
         <checkConstraint constraint="((display_grouping = ANY (ARRAY['enum'::text, 'chron'::text])))" name="distribution_display_grouping_check"/>
         <checkConstraint constraint="(((summary_method IS NULL) OR (summary_method = ANY (ARRAY['add_to_sre'::text, 'merge_with_sre'::text, 'use_sre_only'::text, 'use_sdist_only'::text]))))" name="sdist_summary_method_check"/>
      </table>
      <table name="distribution_note" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.distribution_note_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="distribution" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="distribution_note_distribution_fkey" implied="false" onDeleteCascade="true" schema="serial" table="distribution"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="creator" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="distribution_note_creator_fkey" implied="false" onDeleteCascade="false" schema="actor" table="usr"/>
         </column>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="3" name="create_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="4" name="pub" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="5" name="alert" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="title" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="value" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="distribution_note_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="serial_distribution_note_dist_idx" unique="false">
            <column ascending="true" name="distribution"/>
         </index>
      </table>
      <table name="index_summary" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.index_summary_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="distribution" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="index_summary_distribution_fkey" implied="false" onDeleteCascade="true" schema="serial" table="distribution"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="generated_coverage" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="textual_holdings" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="true" digits="0" id="4" name="show_generated" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="index_summary_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="serial_index_summary_dist_idx" unique="false">
            <column ascending="true" name="distribution"/>
         </index>
      </table>
      <table name="issuance" numRows="743" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.issuance_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4">
            <child column="issuance" foreignKey="item_issuance_fkey" implied="false" onDeleteCascade="true" schema="serial" table="item"/>
            <child column="issuance" foreignKey="materialized_holding_code_issuance_fkey" implied="false" onDeleteCascade="true" schema="serial" table="materialized_holding_code"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="creator" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="issuance_creator_fkey" implied="false" onDeleteCascade="false" schema="actor" table="usr"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="editor" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="issuance_editor_fkey" implied="false" onDeleteCascade="false" schema="actor" table="usr"/>
         </column>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="3" name="create_date" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="4" name="edit_date" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="subscription" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="issuance_subscription_fkey" implied="false" onDeleteCascade="true" schema="serial" table="subscription"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="label" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="7" name="date_published" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="caption_and_pattern" nullable="true" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="issuance_caption_and_pattern_fkey" implied="false" onDeleteCascade="true" schema="serial" table="caption_and_pattern"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="holding_code" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="holding_type" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="holding_link_id" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="issuance_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="serial_issuance_caption_and_pattern_idx" unique="false">
            <column ascending="true" name="caption_and_pattern"/>
         </index>
         <index name="serial_issuance_date_published_idx" unique="false">
            <column ascending="true" name="date_published"/>
         </index>
         <index name="serial_issuance_sub_idx" unique="false">
            <column ascending="true" name="subscription"/>
         </index>
         <checkConstraint constraint="(((holding_code IS NULL) OR could_be_serial_holding_code(holding_code)))" name="issuance_holding_code_check"/>
         <checkConstraint constraint="(((holding_code IS NULL) OR is_json(holding_code)))" name="issuance_holding_code_check1"/>
         <checkConstraint constraint="(((holding_type IS NULL) OR (holding_type = ANY (ARRAY['basic'::text, 'supplement'::text, 'index'::text]))))" name="valid_holding_type"/>
      </table>
      <table name="item" numRows="750" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.item_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4">
            <child column="item" foreignKey="serial_claim_item_fkey" implied="false" onDeleteCascade="false" schema="acq" table="serial_claim"/>
            <child column="item" foreignKey="item_note_item_fkey" implied="false" onDeleteCascade="true" schema="serial" table="item_note"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="creator" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="item_creator_fkey" implied="false" onDeleteCascade="false" schema="actor" table="usr"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="editor" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="item_editor_fkey" implied="false" onDeleteCascade="false" schema="actor" table="usr"/>
         </column>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="3" name="create_date" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="4" name="edit_date" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="issuance" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="item_issuance_fkey" implied="false" onDeleteCascade="true" schema="serial" table="issuance"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="stream" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="item_stream_fkey" implied="false" onDeleteCascade="true" schema="serial" table="stream"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="unit" nullable="true" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="item_unit_fkey" implied="false" onDeleteCascade="false" schema="serial" table="unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="uri" nullable="true" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="item_uri_fkey" implied="false" onDeleteCascade="false" schema="asset" table="uri"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="6" id="9" name="date_expected" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="10" name="date_received" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="'Expected'::text" digits="0" id="11" name="status" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="12" name="shadowed" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="item_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="serial_item_date_received_idx" unique="false">
            <column ascending="true" name="date_received"/>
         </index>
         <index name="serial_item_issuance_idx" unique="false">
            <column ascending="true" name="issuance"/>
         </index>
         <index name="serial_item_status_idx" unique="false">
            <column ascending="true" name="status"/>
         </index>
         <index name="serial_item_stream_idx" unique="false">
            <column ascending="true" name="stream"/>
         </index>
         <index name="serial_item_unit_idx" unique="false">
            <column ascending="true" name="unit"/>
         </index>
         <index name="serial_item_uri_idx" unique="false">
            <column ascending="true" name="uri"/>
         </index>
         <checkConstraint constraint="((status = ANY (ARRAY['Bindery'::text, 'Bound'::text, 'Claimed'::text, 'Discarded'::text, 'Expected'::text, 'Not Held'::text, 'Not Published'::text, 'Received'::text])))" name="valid_status"/>
      </table>
      <table name="item_note" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.item_note_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="item" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="item_note_item_fkey" implied="false" onDeleteCascade="true" schema="serial" table="item"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="creator" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="item_note_creator_fkey" implied="false" onDeleteCascade="false" schema="actor" table="usr"/>
         </column>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="3" name="create_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="4" name="pub" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="5" name="alert" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="title" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="value" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="item_note_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="serial_item_note_item_idx" unique="false">
            <column ascending="true" name="item"/>
         </index>
      </table>
      <table name="materialized_holding_code" numRows="4756" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.materialized_holding_code_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="19" type="bigserial" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="issuance" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="materialized_holding_code_issuance_fkey" implied="false" onDeleteCascade="true" schema="serial" table="issuance"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="subfield" nullable="true" remarks="" size="1" type="bpchar" typeCode="1"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="value" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="materialized_holding_code_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="assist_holdings_display" unique="false">
            <column ascending="true" name="issuance"/>
            <column ascending="true" name="subfield"/>
         </index>
      </table>
      <table name="pattern_template" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.pattern_template_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="pattern_code" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="owning_lib" nullable="true" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="pattern_template_owning_lib_fkey" implied="false" onDeleteCascade="false" schema="actor" table="org_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="0" digits="0" id="4" name="share_depth" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="pattern_template_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="serial_pattern_template_name_idx" unique="false"/>
      </table>
      <table name="record_entry" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.record_entry_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="19" type="bigserial" typeCode="-5">
            <child column="record_entry" foreignKey="distribution_record_entry_fkey" implied="false" onDeleteCascade="false" schema="serial" table="distribution"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="record" nullable="true" remarks="" size="19" type="int8" typeCode="-5">
            <parent column="id" foreignKey="record_entry_record_fkey" implied="false" onDeleteCascade="false" schema="biblio" table="record_entry"/>
         </column>
         <column autoUpdated="false" defaultValue="1" digits="0" id="2" name="owning_lib" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="record_entry_owning_lib_fkey" implied="false" onDeleteCascade="false" schema="actor" table="org_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="1" digits="0" id="3" name="creator" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="4" name="editor" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="source" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="6" name="create_date" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="7" name="edit_date" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="true" digits="0" id="8" name="active" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="9" name="deleted" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="marc" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="last_xact_id" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="record_entry_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="serial_record_entry_creator_idx" unique="false">
            <column ascending="true" name="creator"/>
         </index>
         <index name="serial_record_entry_editor_idx" unique="false">
            <column ascending="true" name="editor"/>
         </index>
         <index name="serial_record_entry_owning_lib_idx" unique="false">
            <column ascending="true" name="owning_lib"/>
            <column ascending="true" name="deleted"/>
         </index>
         <index name="serial_record_entry_record_idx" unique="false">
            <column ascending="true" name="record"/>
         </index>
      </table>
      <table name="routing_list_user" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.routing_list_user_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="stream" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="routing_list_user_stream_fkey" implied="false" onDeleteCascade="true" schema="serial" table="stream"/>
         </column>
         <column autoUpdated="false" defaultValue="1" digits="0" id="2" name="pos" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="reader" nullable="true" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="routing_list_user_reader_fkey" implied="false" onDeleteCascade="true" schema="actor" table="usr"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="department" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="note" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="routing_list_user_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="one_pos_per_routing_list" unique="true">
            <column ascending="true" name="stream"/>
            <column ascending="true" name="pos"/>
         </index>
         <index name="serial_routing_list_user_reader_idx" unique="false">
            <column ascending="true" name="reader"/>
         </index>
         <index name="serial_routing_list_user_stream_idx" unique="false">
            <column ascending="true" name="stream"/>
         </index>
         <checkConstraint constraint="((((reader IS NOT NULL) AND (department IS NULL)) OR ((reader IS NULL) AND (department IS NOT NULL))))" name="reader_or_dept"/>
      </table>
      <table name="stream" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.stream_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4">
            <child column="stream" foreignKey="item_stream_fkey" implied="false" onDeleteCascade="true" schema="serial" table="item"/>
            <child column="stream" foreignKey="routing_list_user_stream_fkey" implied="false" onDeleteCascade="true" schema="serial" table="routing_list_user"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="distribution" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="stream_distribution_fkey" implied="false" onDeleteCascade="true" schema="serial" table="distribution"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="routing_label" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="stream_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="label_once_per_dist" unique="true">
            <column ascending="true" name="distribution"/>
            <column ascending="true" name="routing_label"/>
         </index>
         <index name="serial_stream_dist_idx" unique="false">
            <column ascending="true" name="distribution"/>
         </index>
      </table>
      <table name="subscription" numRows="27" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.subscription_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4">
            <child column="subscription" foreignKey="caption_and_pattern_subscription_fkey" implied="false" onDeleteCascade="true" schema="serial" table="caption_and_pattern"/>
            <child column="subscription" foreignKey="distribution_subscription_fkey" implied="false" onDeleteCascade="true" schema="serial" table="distribution"/>
            <child column="subscription" foreignKey="issuance_subscription_fkey" implied="false" onDeleteCascade="true" schema="serial" table="issuance"/>
            <child column="subscription" foreignKey="subscription_note_subscription_fkey" implied="false" onDeleteCascade="true" schema="serial" table="subscription_note"/>
         </column>
         <column autoUpdated="false" defaultValue="1" digits="0" id="1" name="owning_lib" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="subscription_owning_lib_fkey" implied="false" onDeleteCascade="false" schema="actor" table="org_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="6" id="2" name="start_date" nullable="false" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="3" name="end_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="record_entry" nullable="true" remarks="" size="19" type="int8" typeCode="-5">
            <parent column="id" foreignKey="subscription_record_entry_fkey" implied="false" onDeleteCascade="false" schema="biblio" table="record_entry"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="6" id="5" name="expected_date_offset" nullable="true" remarks="" size="49" type="interval" typeCode="1111"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="subscription_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="serial_subscription_owner_idx" unique="false">
            <column ascending="true" name="owning_lib"/>
         </index>
         <index name="serial_subscription_record_idx" unique="false">
            <column ascending="true" name="record_entry"/>
         </index>
      </table>
      <table name="subscription_note" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.subscription_note_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="subscription" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="subscription_note_subscription_fkey" implied="false" onDeleteCascade="true" schema="serial" table="subscription"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="creator" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="subscription_note_creator_fkey" implied="false" onDeleteCascade="false" schema="actor" table="usr"/>
         </column>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="3" name="create_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="4" name="pub" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="5" name="alert" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="title" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="value" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="subscription_note_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="serial_subscription_note_sub_idx" unique="false">
            <column ascending="true" name="subscription"/>
         </index>
      </table>
      <table name="supplement_summary" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('serial.supplement_summary_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="10" type="serial" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="distribution" nullable="false" remarks="" size="10" type="int4" typeCode="4">
            <parent column="id" foreignKey="supplement_summary_distribution_fkey" implied="false" onDeleteCascade="true" schema="serial" table="distribution"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="generated_coverage" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="textual_holdings" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="true" digits="0" id="4" name="show_generated" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="supplement_summary_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="serial_supplement_summary_dist_idx" unique="false">
            <column ascending="true" name="distribution"/>
         </index>
      </table>
      <table name="unit" remarks="" schema="serial" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('asset.copy_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="" size="19" type="bigserial" typeCode="-5">
            <child column="unit" foreignKey="item_unit_fkey" implied="false" onDeleteCascade="false" schema="serial" table="item"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="circ_lib" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="creator" nullable="false" remarks="" size="19" type="int8" typeCode="-5">
            <parent column="id" foreignKey="serial_unit_creator_fkey" implied="false" onDeleteCascade="false" schema="actor" table="usr"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="call_number" nullable="false" remarks="" size="19" type="int8" typeCode="-5">
            <parent column="id" foreignKey="serial_unit_call_number_fkey" implied="false" onDeleteCascade="false" schema="asset" table="call_number"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="editor" nullable="false" remarks="" size="19" type="int8" typeCode="-5">
            <parent column="id" foreignKey="serial_unit_editor_fkey" implied="false" onDeleteCascade="false" schema="actor" table="usr"/>
         </column>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="5" name="create_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="now()" digits="6" id="6" name="edit_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="copy_number" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="8" name="status" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="1" digits="0" id="9" name="location" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="loan_duration" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="fine_level" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="age_protect" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="true" digits="0" id="13" name="circulate" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="14" name="deposit" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="15" name="ref" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="true" digits="0" id="16" name="holdable" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="0.00" digits="2" id="17" name="deposit_amount" nullable="false" remarks="" size="6" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="18" name="price" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="barcode" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="circ_modifier" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="circ_as_type" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="22" name="dummy_title" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="23" name="dummy_author" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="24" name="alert_message" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="true" digits="0" id="25" name="opac_visible" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="false" digits="0" id="26" name="deleted" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="27" name="floating" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="28" name="dummy_isbn" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="29" name="status_changed_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="30" name="active_date" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="true" digits="0" id="31" name="mint_condition" nullable="false" remarks="" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="32" name="cost" nullable="true" remarks="" size="8" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="33" name="sort_key" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="34" name="detailed_contents" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="35" name="summary_contents" nullable="false" remarks="" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="unit_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="unit_avail_cn_idx" unique="false">
            <column ascending="true" name="call_number"/>
         </index>
         <index name="unit_barcode_key" unique="true">
            <column ascending="true" name="barcode"/>
         </index>
         <index name="unit_cn_idx" unique="false">
            <column ascending="true" name="call_number"/>
         </index>
         <index name="unit_creator_idx" unique="false">
            <column ascending="true" name="creator"/>
         </index>
         <index name="unit_editor_idx" unique="false">
            <column ascending="true" name="editor"/>
         </index>
         <checkConstraint constraint="((fine_level = ANY (ARRAY[1, 2, 3])))" name="copy_fine_level_check"/>
         <checkConstraint constraint="((loan_duration = ANY (ARRAY[1, 2, 3])))" name="copy_loan_duration_check"/>
      </table>
   </tables>
   <routines>
      <routine dataAccess="MODIFIES" deterministic="false" name="materialize_holding_code()" returnType="trigger" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plperlu"><![CDATA[use strict;

use MARC::Field;
use JSON::XS;

if (not defined $_TD->{new}{holding_code}) {
    elog(WARNING, 'NULL in "holding_code" column of serial.issuance allowed for now, but may not be useful');
    return;
}

# Do nothing if holding_code has not changed...

if ($_TD->{new}{holding_code} eq $_TD->{old}{holding_code}) {
    # ... unless the following internal flag is set.

    my $flag_rv = spi_exec_query(q{
        SELECT * FROM config.internal_flag
        WHERE name = 'serial.rematerialize_on_same_holding_code' AND enabled
    }, 1);
    return unless $flag_rv->{processed};
}


my $holding_code = (new JSON::XS)->decode($_TD->{new}{holding_code});

my $field = new MARC::Field('999', @$holding_code); # tag doesnt matter

my $dstmt = spi_prepare(
    'DELETE FROM serial.materialized_holding_code WHERE issuance = $1',
    'INT'
);
spi_exec_prepared($dstmt, $_TD->{new}{id});

my $istmt = spi_prepare(
    q{
        INSERT INTO serial.materialized_holding_code (
            issuance, subfield, value
        ) VALUES ($1, $2, $3)
    }, qw{INT CHAR TEXT}
);

foreach ($field->subfields) {
    spi_exec_prepared(
        $istmt,
        $_TD->{new}{id},
        $_->[0],
        $_->[1]
    );
}

return;]]></definition>
         <parameters>
            <parameter mode="IN"/>
         </parameters>
      </routine>
      <routine dataAccess="MODIFIES" deterministic="false" name="pattern_templates_visible_to(org_unit integer)" returnType="SETOF serial.pattern_template" securityType="INVOKER" type="FUNCTION">
         <comment/>
         <definition language="plpgsql"><![CDATA[BEGIN
    RETURN QUERY SELECT *
           FROM serial.pattern_template spt
           WHERE (
             SELECT ARRAY_AGG(id)
             FROM actor.org_unit_descendants(spt.owning_lib, spt.share_depth)
           ) @@ org_unit::TEXT::QUERY_INT;
END;]]></definition>
         <parameters>
            <parameter mode="IN" name="org_unit" type="integer"/>
         </parameters>
      </routine>
   </routines>
</database>
