diff --git a/tm_admin/tmdb.py b/tm_admin/tmdb.py index 6a891fd3..d344c707 100755 --- a/tm_admin/tmdb.py +++ b/tm_admin/tmdb.py @@ -162,7 +162,7 @@ def writeAllData(self, # bar.next() for key, val in record.items(): columns.append(key) - print(f"FIXME: {key} = {self.config[key]}") + # print(f"FIXME: {key} = {self.config[key]}") # Booleans need to set 't' or 'f' for postgres. if self.config[key]['datatype'] == 'bool': if val: @@ -207,9 +207,8 @@ def writeAllData(self, values += f"}}'::{self.config[key]['datatype'].lower()}[], " continue else: - # The TM database has a bug, a 0 usually means tthere is no value, + # The TM database has a bug, a 0 usually means there is no value, # so we bump it up to pick the first entry in the enum. - print(key, val) if val is None: values += f"'{{}}', " continue @@ -223,6 +222,9 @@ def writeAllData(self, else: if self.config[key]['array']: if val is not None: + if len(val) == 0: + values += "NULL, " + continue values += "ARRAY[" for item in val: esc = item.replace("'", "")