Skip to content

Commit

Permalink
Split up non-deferred from deferred overrides, remove another comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkaemming committed Dec 15, 2023
1 parent abe8f8a commit 61fb17e
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions posthog/models/person/person.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,24 +134,6 @@ class Meta:
uuid = models.UUIDField()


class PendingPersonOverride(models.Model):
id = models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")
team_id = models.BigIntegerField()
old_person_id = models.UUIDField()
override_person_id = models.UUIDField()
oldest_event = models.DateTimeField()


class FlatPersonOverride(models.Model):
# TODO: What additional constraints here make sense (and are practical to implement?)
id = models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")
team_id = models.BigIntegerField()
old_person_id = models.UUIDField()
override_person_id = models.UUIDField()
oldest_event = models.DateTimeField()
version = models.BigIntegerField(null=True, blank=True)


class PersonOverride(models.Model):
"""A model of persons to be overriden in merge or merge-like events.
Expand Down Expand Up @@ -197,6 +179,23 @@ class Meta:
version: models.BigIntegerField = models.BigIntegerField(null=True, blank=True)


class PendingPersonOverride(models.Model):
id = models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")
team_id = models.BigIntegerField()
old_person_id = models.UUIDField()
override_person_id = models.UUIDField()
oldest_event = models.DateTimeField()


class FlatPersonOverride(models.Model):
id = models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")
team_id = models.BigIntegerField()
old_person_id = models.UUIDField()
override_person_id = models.UUIDField()
oldest_event = models.DateTimeField()
version = models.BigIntegerField(null=True, blank=True)


def get_distinct_ids_for_subquery(person: Person | None, team: Team) -> List[str]:
"""_summary_
Fetching distinct_ids for a person from CH is slow, so we
Expand Down

0 comments on commit 61fb17e

Please sign in to comment.