Skip to content

Commit

Permalink
use one-to-one field for grouphash
Browse files Browse the repository at this point in the history
  • Loading branch information
lobsterkatie committed Aug 15, 2024
1 parent 4ec5694 commit f853e45
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/sentry/models/grouphashmetadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
from django.utils import timezone

from sentry.backup.scopes import RelocationScope
from sentry.db.models import FlexibleForeignKey, Model, region_silo_model
from sentry.db.models import Model, region_silo_model


@region_silo_model
class GroupHashMetadata(Model):
__relocation_scope__ = RelocationScope.Excluded

# GENERAL
grouphash = FlexibleForeignKey("sentry.GroupHash", unique=True, related_name="metadata")
grouphash = models.OneToOneField(
"sentry.GroupHash", related_name="metadata", on_delete=models.CASCADE
)
date_added = models.DateTimeField(default=timezone.now)

class Meta:
Expand Down

0 comments on commit f853e45

Please sign in to comment.