diff options
author | 2023-04-06 01:09:09 +0300 | |
---|---|---|
committer | 2023-04-06 01:09:09 +0300 | |
commit | b8ddedc31d54f46bb86a7e7d200c163ea8806ee0 (patch) | |
tree | b4a59f877895a4edcd6282917357972b2c8a3ff5 /pydis_site/apps/api/migrations | |
parent | Add maximum auto-timeout duration validation (diff) |
Make additional_settings non-null with dict default
This makes sure that the value in the DB is always a valid JSON, ensuring the unique constraint will work properly.
Diffstat (limited to 'pydis_site/apps/api/migrations')
-rw-r--r-- | pydis_site/apps/api/migrations/0088_new_filter_schema.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pydis_site/apps/api/migrations/0088_new_filter_schema.py b/pydis_site/apps/api/migrations/0088_new_filter_schema.py index 2e1d78c9..675fdcec 100644 --- a/pydis_site/apps/api/migrations/0088_new_filter_schema.py +++ b/pydis_site/apps/api/migrations/0088_new_filter_schema.py @@ -64,7 +64,7 @@ def forward(apps: Apps, schema_editor: BaseDatabaseSchemaEditor) -> None: updated_at=object_.updated_at, filter_list=list_, description=object_.comment, - additional_settings=None, + additional_settings={}, guild_pings=None, filter_dm=None, dm_pings=None, @@ -105,7 +105,7 @@ class Migration(migrations.Migration): ('updated_at', models.DateTimeField(auto_now=True)), ('content', models.CharField(help_text='The definition of this filter.', max_length=100)), ('description', models.CharField(help_text='Why this filter has been added.', max_length=200, null=True)), - ('additional_settings', models.JSONField(help_text='Additional settings which are specific to this filter.', null=True)), + ('additional_settings', models.JSONField(help_text='Additional settings which are specific to this filter.', default=dict)), ('guild_pings', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), help_text='Who to ping when this filter triggers.', size=None, null=True)), ('filter_dm', models.BooleanField(help_text='Whether DMs should be filtered.', null=True)), ('dm_pings', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), help_text='Who to ping when this filter triggers on a DM.', size=None, null=True)), |