Skip to content

Commit

Permalink
Add unique constraint on organisation.data_pass_id
Browse files Browse the repository at this point in the history
  • Loading branch information
tut-tuuut committed Mar 21, 2022
1 parent 2737ba6 commit ecc9b62
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.12 on 2022-03-21 10:02

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('aidants_connect_web', '0082_alter_habilitationrequest_options'),
]

operations = [
migrations.AlterField(
model_name='organisation',
name='data_pass_id',
field=models.PositiveIntegerField(null=True, unique=True, verbose_name='Datapass ID'),
),
]
2 changes: 1 addition & 1 deletion aidants_connect_web/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def not_yet_accredited(self):


class Organisation(models.Model):
data_pass_id = models.PositiveIntegerField("Datapass ID", null=True)
data_pass_id = models.PositiveIntegerField("Datapass ID", null=True, unique=True)
name = models.TextField("Nom", default="No name provided")
type = models.ForeignKey(
OrganisationType, null=True, blank=True, on_delete=SET_NULL
Expand Down

0 comments on commit ecc9b62

Please sign in to comment.