Skip to content

Commit

Permalink
fix: Migrate BatchExportDestination config to EncryptedJsonField (#27407
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tomasfarias authored Jan 15, 2025
1 parent 7a44792 commit 18fc4ef
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
4 changes: 3 additions & 1 deletion posthog/batch_exports/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from django.db import models

from posthog.client import sync_execute
from posthog.helpers.encrypted_fields import EncryptedJSONField
from posthog.models.utils import UUIDModel


Expand Down Expand Up @@ -44,8 +45,9 @@ class Destination(models.TextChoices):
max_length=64,
help_text="A choice of supported BatchExportDestination types.",
)
config = models.JSONField(
config = EncryptedJSONField(
default=dict,
ignore_decrypt_errors=True,
blank=True,
help_text="A JSON field to store all configuration parameters required to access a BatchExportDestination.",
)
Expand Down
23 changes: 23 additions & 0 deletions posthog/migrations/0543_alter_batchexportdestination_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.15 on 2025-01-09 16:25

from django.db import migrations

import posthog.helpers.encrypted_fields


class Migration(migrations.Migration):
dependencies = [
("posthog", "0542_remove_errortrackingissueassignment_unique_on_user_and_issue_and_more"),
]

operations = [
migrations.AlterField(
model_name="batchexportdestination",
name="config",
field=posthog.helpers.encrypted_fields.EncryptedJSONField(
blank=True,
default=dict,
help_text="A JSON field to store all configuration parameters required to access a BatchExportDestination.",
),
),
]
2 changes: 1 addition & 1 deletion posthog/migrations/max_migration.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0542_remove_errortrackingissueassignment_unique_on_user_and_issue_and_more
0543_alter_batchexportdestination_config

0 comments on commit 18fc4ef

Please sign in to comment.