Skip to content

UUID Foreign Key #47

@mitchelljkotler

Description

@mitchelljkotler

I am having a similar issue to #19 - I have a foreign key which is a UUID field, pointing to a UUID field on the target table.

Traceback (most recent call last):
  File "/home/mitch/Documents/Work/Other/condenser/condenser/direct_subset.py", line 43, in <module>
    subsetter.run_middle_out()
  File "/home/mitch/Documents/Work/Other/condenser/condenser/subset.py", line 86, in run_middle_out
    self.subset_downstream(t, relationships)
  File "/home/mitch/Documents/Work/Other/condenser/condenser/subset.py", line 181, in subset_downstream
    self.__db_helper.copy_rows(self.__destination_conn, self.__destination_conn, q, temp_table)
  File "/home/mitch/Documents/Work/Other/condenser/condenser/psql_database_helper.py", line 40, in copy_rows
    cursor.execute(query)
  File "/home/mitch/Documents/Work/Other/condenser/condenser/db_connect.py", line 58, in execute
    retval = self.inner_cursor.execute(query)
psycopg2.errors.UndefinedFunction: operator does not exist: uuid = integer
LINE 1: ..."users_user" WHERE ("individual_organization_id") NOT IN (SE...
                                                             ^
HINT:  No operator matches the given name and argument types. You might need to add explicit type casts.

I can use a dependency break to fix this error, but then predictably, I get an Integrity Error:

sycopg2.errors.NotNullViolation: null value in column "individual_organization_id" of relation "users_user" violates not-null constraint
DETAIL:  Failing row contains (1861, x..., 2025-04-03 14:10:46.581615+00, f, John Doe, email@example.com, John_Doe, , f, f, t, f, muckrock, f, 2015-05-04 17:36:26.020544+00, 2022-05-01 18:36:12.076
552+00, t, null, , null).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions