Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ [#170] add unique constraint for filter.filter_group and filter.key
Browse files Browse the repository at this point in the history
annashamray committed Jan 31, 2025
1 parent 66aea4f commit f3b6520
Showing 3 changed files with 30 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -2,6 +2,18 @@
Changes
=======

1.9.0 (WIP)
-----------

* [#170] Add uniqu constraint for ``(Filter.filter_group, Filter.key)`` fields.

.. warning::

The unique constraint is added for ``(Filter.filter_group, Filter.key)``.
If "datamodel.0017" migration is failing, remove duplicated manually from
the ``Filter`` model and try to run it again.


1.8.0 (2024-01-13)
------------------

17 changes: 17 additions & 0 deletions src/nrc/datamodel/migrations/0017_alter_filter_unique_together.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.15 on 2025-01-31 11:20

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("datamodel", "0016_alter_abonnement_callback_url"),
]

operations = [
migrations.AlterUniqueTogether(
name="filter",
unique_together={("filter_group", "key")},
),
]
1 change: 1 addition & 0 deletions src/nrc/datamodel/models.py
Original file line number Diff line number Diff line change
@@ -142,6 +142,7 @@ class Meta:
ordering = ("id",)
verbose_name = _("filter-onderdeel")
verbose_name_plural = _("filter-onderdelen")
unique_together = ["filter_group", "key"]


class Notificatie(models.Model):

0 comments on commit f3b6520

Please sign in to comment.