<?xml version="1.0" encoding="UTF-8"?><database name="egdb3_14_1" schema="extend_reporter" type="PostgreSQL - 15.10 (Ubuntu 15.10-1.pgdg24.04+1)">
   <tables>
      <table name="copy_count_per_org" numRows="0" remarks="" schema="extend_reporter" type="VIEW" viewSql=" SELECT acn.record AS bibid,&#10;    ac.circ_lib,&#10;    acn.owning_lib,&#10;    max(ac.edit_date) AS last_edit_time,&#10;    min((ac.deleted)::integer) AS has_only_deleted_copies,&#10;    count(&#10;        CASE&#10;            WHEN ac.deleted THEN ac.id&#10;            ELSE NULL::bigint&#10;        END) AS deleted_count,&#10;    count(&#10;        CASE&#10;            WHEN (NOT ac.deleted) THEN ac.id&#10;            ELSE NULL::bigint&#10;        END) AS visible_count,&#10;    count(*) AS total_count&#10;   FROM asset.call_number acn,&#10;    asset.copy ac&#10;  WHERE (ac.call_number = acn.id)&#10;  GROUP BY acn.record, acn.owning_lib, ac.circ_lib;">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="bibid" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="circ_lib" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="owning_lib" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="3" name="last_edit_time" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="has_only_deleted_copies" nullable="true" remarks="" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="deleted_count" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="visible_count" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="total_count" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
      </table>
      <table name="full_circ_count" numRows="0" remarks="" schema="extend_reporter" type="VIEW" viewSql=" SELECT cp.id,&#10;    ((COALESCE(( SELECT legacy_circ_count.circ_count&#10;           FROM extend_reporter.legacy_circ_count&#10;          WHERE (legacy_circ_count.id = cp.id)), 0) + ( SELECT count(*) AS count&#10;           FROM action.circulation&#10;          WHERE (circulation.target_copy = cp.id))) + ( SELECT count(*) AS count&#10;           FROM action.aged_circulation&#10;          WHERE (aged_circulation.target_copy = cp.id))) AS circ_count&#10;   FROM asset.copy cp;">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="true" remarks="" size="19" type="int8" typeCode="-5">
            <parent column="id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="extend_reporter" table="legacy_circ_count"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="circ_count" nullable="true" remarks="" size="19" type="int8" typeCode="-5"/>
      </table>
      <table name="global_bibs_by_holding_update" numRows="0" remarks="" schema="extend_reporter" type="VIEW" viewSql=" SELECT DISTINCT ON (x.id) x.id,&#10;    x.holding_update,&#10;    x.update_type&#10;   FROM ( SELECT b.id,&#10;            last(cp.create_date) AS holding_update,&#10;            'add'::text AS update_type&#10;           FROM ((biblio.record_entry b&#10;             JOIN asset.call_number cn ON ((cn.record = b.id)))&#10;             JOIN asset.copy cp ON ((cp.call_number = cn.id)))&#10;          WHERE ((NOT cp.deleted) AND (b.id &gt; 0))&#10;          GROUP BY b.id&#10;        UNION&#10;         SELECT b.id,&#10;            last(cp.edit_date) AS holding_update,&#10;            'delete'::text AS update_type&#10;           FROM ((biblio.record_entry b&#10;             JOIN asset.call_number cn ON ((cn.record = b.id)))&#10;             JOIN asset.copy cp ON ((cp.call_number = cn.id)))&#10;          WHERE (cp.deleted AND (b.id &gt; 0))&#10;          GROUP BY b.id) x&#10;  ORDER BY x.id, x.holding_update;">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="true" remarks="" size="19" type="int8" typeCode="-5">
            <parent column="id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="extend_reporter" table="legacy_circ_count"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="holding_update" nullable="true" remarks="" size="35" type="timestamptz" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="update_type" nullable="true" remarks="" size="2147483647" type="text" typeCode="12"/>
      </table>
      <table name="legacy_circ_count" remarks="" schema="extend_reporter" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="" size="19" type="int8" typeCode="-5">
            <child column="id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="extend_reporter" table="full_circ_count"/>
            <child column="id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="extend_reporter" table="global_bibs_by_holding_update"/>
         </column>
         <column autoUpdated="false" defaultValue="0" digits="0" id="1" name="circ_count" nullable="false" remarks="" size="10" type="int4" typeCode="4"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="legacy_circ_count_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
      </table>
   </tables>
</database>
