As the title says, I don’t have any unique field but the event_name field is treated as primary/unique internally in the DB apparently.
I get this stacktrace if I try to import such entries:
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 325, in db_insert
), list(d.values()))
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 156, in sql
self._cursor.execute(query, values)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py", line 170, in execute
result = self._query(query)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py", line 328, in _query
conn.query(q)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 732, in _read_query_result
result.read()
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 1075, in read
first_packet = self.connection._read_packet()
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 684, in _read_packet
packet.check_error()
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/protocol.py", line 220, in check_error
err.raise_mysql_exception(self._data)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1062, "Duplicate entry 'Interne Schulung' for key 'PRIMARY'")
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/importer.py", line 126, in import_data
doc = self.process_doc(doc)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/importer.py", line 194, in process_doc
return self.insert_record(doc)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/importer.py", line 213, in insert_record
new_doc.insert()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 248, in insert
raise e
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 245, in insert
self.db_insert()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 335, in db_insert
raise frappe.DuplicateEntryError(self.doctype, self.name, e)
frappe.exceptions.DuplicateEntryError: ('Training Event', 'Interne Schulung', IntegrityError(1062, "Duplicate entry 'Interne Schulung' for key 'PRIMARY'"))