Skip to content

Commit

Permalink
Add column dependencies for agreements_package_content_item, loans_re…
Browse files Browse the repository at this point in the history
…newal_count, users_groups
  • Loading branch information
nassibnassar committed Feb 8, 2023
1 parent 3cfe373 commit 27a4531
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--metadb:table agreements_package_content_item
--metadb:require folio_agreements.identifier_occurrence.io_ti_fk uuid
--metadb:require folio_agreements.package_content_item.id uuid
--metadb:require folio_agreements.package_content_item.pci_access_end date
--metadb:require folio_agreements.package_content_item.pci_access_start date
Expand Down
5 changes: 3 additions & 2 deletions sql_metadb/derived_tables/loans_renewal_count.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--metadb:table loans_renewal_count
--metadb:require folio_circulation.loan__t.renewal_count numeric

DROP TABLE IF EXISTS loans_renewal_count;

Expand All @@ -20,8 +21,8 @@ WITH loan_count AS (
SELECT
CURRENT_DATE AS current_as_of_date,
it.id::uuid AS item_id,
COALESCE(lc.num_loans, 0) AS num_loans,
COALESCE(lc.num_renewals, 0) AS num_renewals
coalesce(lc.num_loans, 0) AS num_loans,
coalesce(lc.num_renewals, 0) AS num_renewals
FROM
folio_inventory.item AS it
LEFT JOIN loan_count AS lc ON it.id::uuid = lc.item_id;
Expand Down
1 change: 1 addition & 0 deletions sql_metadb/derived_tables/users_groups.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--metadb:table users_groups
--metadb:require folio_users.users__t.enrollment_date timestamptz

-- Create a derived table that takes the users table and joins in the
-- group information. Does not include addresses - see additional
Expand Down

0 comments on commit 27a4531

Please sign in to comment.