Uploaded image for project: 'mod-circulation-storage'
  1. mod-circulation-storage
  2. CIRCSTORE-228

Add b-tree index needed for age to lost delayed billing

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Closed (View Workflow)
    • Priority: P2
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 12.1.0
    • Labels:
      None
    • Template:
    • Sprint:
      Core: F - Sprint 95
    • Development Team:
      Core: Platform

      Description

      Needed for CIRC-851.

      Add loan b-tree indexes for:

      • agedToLostDelayedBilling.lostItemHasBeenBilled;
      • agedToLostDelayedBilling.dateLostItemShouldBeBilled.

      Workaround:
      Use a snippetPath .sql file to manually create a custom index name:

      schema.json:

       "scripts": [
          {
            "run": "after",
            "snippetPath": "index_dateLostItemShouldBeBilled.sql"
          }
      

      index_dateLostItemShouldBeBilled.sql:

        -- Create index for agedToLostDelayedBilling.dateLostItemShouldBeBilled on loan table.
          -- Needed to set a shorter custom index name, otherwise PostgreSQL may truncate it:
          -- https://issues.folio.org/browse/RMB-689
          -- This SQL must always run (no "fromModuleVersion") to signal RMB to create the index,
          -- to signal RMB to not delete the index, and the SQL must run after table creation.
          DO $do$
          BEGIN
            PERFORM rmb_internal_index(
            'loan',                    'loan_dateLostItemShouldBeBilled_idx', 'ADD',
            'CREATE INDEX IF NOT EXISTS loan_dateLostItemShouldBeBilled_idx ON ${myuniversity}_${mymodule}.loan '
            || $rmb$(lower(${myuniversity}_${mymodule}.f_unaccent(jsonb->'agedToLostDelayedBilling'->>'dateLostItemShouldBeBilled')))$rmb$);
          END $do$;
      

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                julianladisch Julian Ladisch
                Reporter:
                bohdan-suprun Bohdan Suprun
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases