From 5e9097b5e09d088a01a6a15016802a56f7882d59 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 3 Feb 2021 13:16:32 +1100 Subject: [PATCH] PSQL: Upper-case column names *must* be qualified with double-quotes Ref: https://www.xspdf.com/resolution/53039249.html --- InvenTree/company/migrations/0019_auto_20200413_0642.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/InvenTree/company/migrations/0019_auto_20200413_0642.py b/InvenTree/company/migrations/0019_auto_20200413_0642.py index a27f56ce3a..509c45aaa2 100644 --- a/InvenTree/company/migrations/0019_auto_20200413_0642.py +++ b/InvenTree/company/migrations/0019_auto_20200413_0642.py @@ -22,7 +22,7 @@ def reverse_association(apps, schema_editor): cursor = connection.cursor() - response = cursor.execute("select id, MPN from part_supplierpart;") + response = cursor.execute('select id, "MPN" from part_supplierpart;') supplier_parts = cursor.fetchall() # Exit if there are no SupplierPart objects @@ -105,7 +105,7 @@ def associate_manufacturers(apps, schema_editor): cursor = connection.cursor() - response = cursor.execute("select id, MPN from part_supplierpart;") + response = cursor.execute(f'select id, "MPN" from part_supplierpart;') supplier_parts = cursor.fetchall() # Exit if there are no SupplierPart objects @@ -317,7 +317,7 @@ def associate_manufacturers(apps, schema_editor): # Extract all SupplierPart objects from the database cursor = connection.cursor() - response = cursor.execute("select id, MPN, SKU, manufacturer_id, manufacturer_name from part_supplierpart;") + response = cursor.execute('select id, "MPN", "SKU", manufacturer_id, manufacturer_name from part_supplierpart;') results = cursor.fetchall() part_count = len(results)