Skip to content

Commit

Permalink
Update connected graph query to use correct pkid type
Browse files Browse the repository at this point in the history
  • Loading branch information
JackAtOmenApps committed Sep 16, 2021
1 parent cfdfaf9 commit 8ef3b6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django_postgresql_dag/query_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def raw_queryset(self):

QUERY = """
WITH RECURSIVE traverse AS
(SELECT %(pk)s AS {pk_name}
(SELECT %(pk)s::{pk_type} AS {pk_name}
UNION SELECT
CASE
WHEN edge.child_id = traverse.{pk_name} THEN edge.parent_id
Expand All @@ -459,6 +459,7 @@ def raw_queryset(self):
QUERY.format(
relationship_table=self.edge_model_table,
pk_name=self.instance.get_pk_name(),
pk_type=self.starting_node.get_pk_type(),
),
self.query_parameters,
)
Expand Down

0 comments on commit 8ef3b6f

Please sign in to comment.