1. Familiarize yourself with the Metadb documentation
    1. The Metadb documentation from Index Data is revised continuously with the latest information on using Metadb
    2. See https://metadb.dev/doc/
    3. For the conversion process, the important section of the documentation to focus on is 4.1.4 Migration from LDP
  2. Convert LDP table references to their Metadb equivalents
    1. use the Migration from LDP table conversion chart supplied in the Metadb 
    2. https://metadb.dev/doc/#_migrating_from_ldp
    3. table names in metadb are case sensitive
    4. many tables names that use singular instead of plural form now
    5. for dashboards, if table names have changed it doesn't make a difference, but field names do need to be changed back to LDP names
  3. Update Derived Table references
    1. update your derived table references from LDP's folio_reporting schema to Metadb's folio_derived schema
  4. Update JSON to JSONB
    1. for example change json_extract_path_text(pol.data, 'description') AS pol_description TO
      jsonb_extract_path_text(pol.jsonb, 'description') AS pol_description,
  5. Update Data Fields that have Changed in Metadb
    1.  See LDP to Metadb field name changes
    2. Please add notes to this page if you find additional field name changes we should know about - thanks!
  6. Test Your Query
    1. Once you appear to have a working Metadb version of your query, it is important to test it
    2. Do the LDP and Metadb versions of your query produce the same results? (assuming you have production data going to both LDP and Metadb)
    3. Ask someone else on the reporting team to test your query
  7. Document and Publish Your Query
    1. With the move to Metadb, we are taking the opportunity to make our naming conventions and query documentation better and more consistent
    2. LDP to Metadb Query Naming Convention
      1. Leave CR numbers in place, even if query is archived, to avoid confusion
      2. To revise a CR or AHR query for LDP to Metadb format, use same CR or AHR number, but precede with M to maintain a connection between the 2 queries for testing purposes. For example, CR100 becomes MCR100, AHR120 becomes MAHR120
      3. For new Metadb queries, we start in the 400 range, so MCR400 is the first metadb-only query
  8. Post the Metadb version of your LDP Query on the cul-folio-analytics GitHub repository
    1. log into GitHub and navigate to new metadb section at https://github.com/cul-it/cul-folio-analytics/tree/main/metadb
    2. make sure you know the name of this query
    3. create a new directory for the query and publish it at the same time as you create the new file in the metadb section of the repository, e.g.,
    4. click to create a new file and type in "MCR120/daily_appr_inv_control.sql" to create the directory and name the file in one step
    5. paste the text for your revised query into the new file and commit the file to publish it






  • No labels