Uploaded image for project: 'AdMaxLocal'
  1. AdMaxLocal
  2. AML-2552

old data loader: blank line at the end of business_categories.csv causes duplicate key error

    Details

      Description

      Reproduce:

      cd core-content/import_scripts_cumberland/business_taxonomy
      cp /tmp/UK\ AML\ business_categories.csv business_categories.csv
      ./load_business_categories.sh <db username> <db password> <db host>

      You'll see an SQL exception in the output and this is what the loader DB table looks like:

      select * from businessCategoryLoader;

       
      | Confectionery                                | 9312 | active |        |
      | Engineering                                  | 9313 | active |        |
      |                                              | 9313 |        |        |
      +----------------------------------------------+------+--------+--------+
      

      load_business_categories.sql has a statement that looks like it will take care of this scenario, but for some reason the last BC ID got carried over to the blank line when it was inserted in to the database.

      #Remove blank line that got loaded
      delete from businessCategoryLoader where ID = '';

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              therouxj Jeff Theroux
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: