diff --git a/posthog/batch_exports/models.py b/posthog/batch_exports/models.py index de8ffedcfd3a4..6305db93f290d 100644 --- a/posthog/batch_exports/models.py +++ b/posthog/batch_exports/models.py @@ -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 @@ -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.", ) diff --git a/posthog/migrations/0543_alter_batchexportdestination_config.py b/posthog/migrations/0543_alter_batchexportdestination_config.py new file mode 100644 index 0000000000000..3940fcb38ca73 --- /dev/null +++ b/posthog/migrations/0543_alter_batchexportdestination_config.py @@ -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.", + ), + ), + ] diff --git a/posthog/migrations/max_migration.txt b/posthog/migrations/max_migration.txt index 00874ed338491..df516c98e5aef 100644 --- a/posthog/migrations/max_migration.txt +++ b/posthog/migrations/max_migration.txt @@ -1 +1 @@ -0542_remove_errortrackingissueassignment_unique_on_user_and_issue_and_more +0543_alter_batchexportdestination_config