Uploaded image for project: 'RAML Module Builder'
  1. RAML Module Builder
  2. RMB-632

Tenant upgrade fails on foreignKey targetPath

    XMLWordPrintable

Details

    • Standard Bug Write-Up Format
    • CP: sprint 90
    • 2
    • Core: Platform

    Description

      Overview:
      Upgrading a module to RMB >= v30.0.0 fails when schema.json contains a foreignKey entry with targetPath (without fieldName).

      Error log:

      2020-06-02T16:08:06,982 INFO  [vert.x-eventloop-thread-2] LogUtil 127.0.0.1:33566 POST /_/tenant null HTTP_1_1 201 0 254 tid=new_tenant Created 
      2020-06-02T16:08:06,985 INFO  [main                     ] TenantSampleDataTest -- upgrade the tenant with sample data, so that it will be inserted now --
      2020-06-02T16:08:06,985 INFO  [main                     ] TenantSampleDataTest upgrading Module with sample
      2020-06-02T16:08:06,997 INFO  [vert.x-worker-thread-7   ] TenantReferenceAPI postTenant
      2020-06-02T16:08:06,998 INFO  [vert.x-worker-thread-7   ] TenantAPI sending... postTenant for new_tenant
      2020-06-02T16:08:07,012 ERROR [vert.x-eventloop-thread-2] TenantAPI null
      java.lang.NullPointerException: null
      	at org.folio.rest.persist.ddlgen.SchemaMaker.lambda$3(SchemaMaker.java:159) ~[domain-models-runtime-30.0.1.jar:?]
      

      This is caused by SchemaMaker.java line 159

      oldForeignKey.getFieldName().equals(newForeignKey.getFieldName())
      

      because oldForeignKey.getFieldName() is null when oldForeignKey uses targetPath.

      Task:
      Properly handle targetPath where fieldName is null.

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                julianladisch Julian Ladisch
                siarhei_hrabko Siarhei Hrabko
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases