From cc4c10100044303d179030a32e44431a15a426fa Mon Sep 17 00:00:00 2001 From: Daniel Mursa Date: Mon, 18 Nov 2024 15:47:30 +0100 Subject: [PATCH] [#233] Migrations --- ...tijidentificatorcodeobjecttype_and_more.py | 154 ++++++++++++++++++ .../klantinteracties/models/partijen.py | 6 - 2 files changed, 154 insertions(+), 6 deletions(-) create mode 100644 src/openklant/components/klantinteracties/migrations/0022_partijidentificatorcodeobjecttype_and_more.py diff --git a/src/openklant/components/klantinteracties/migrations/0022_partijidentificatorcodeobjecttype_and_more.py b/src/openklant/components/klantinteracties/migrations/0022_partijidentificatorcodeobjecttype_and_more.py new file mode 100644 index 00000000..9570642b --- /dev/null +++ b/src/openklant/components/klantinteracties/migrations/0022_partijidentificatorcodeobjecttype_and_more.py @@ -0,0 +1,154 @@ +# Generated by Django 4.2.15 on 2024-11-18 14:46 + +from django.db import migrations, models +import django.db.models.deletion +import uuid + + +class Migration(migrations.Migration): + + dependencies = [ + ("klantinteracties", "0021_alter_digitaaladres_betrokkene"), + ] + + operations = [ + migrations.CreateModel( + name="PartijIdentificatorCodeObjectType", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("uuid", models.UUIDField(default=uuid.uuid4, unique=True)), + ( + "object_type", + models.CharField( + blank=True, + help_text="Object type", + max_length=255, + verbose_name="Object type", + ), + ), + ], + ), + migrations.CreateModel( + name="PartijIdentificatorCodeRegister", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("uuid", models.UUIDField(default=uuid.uuid4, unique=True)), + ( + "register", + models.CharField( + blank=True, max_length=50, verbose_name="register" + ), + ), + ( + "naam", + models.CharField( + blank=True, + help_text="Naam register", + max_length=80, + verbose_name="naam", + ), + ), + ], + ), + migrations.AlterField( + model_name="partijidentificator", + name="partij_identificator_object_id", + field=models.CharField( + help_text="Waarde van de eigenschap die het object identificeert, bijvoorbeeld: '123456788'.", + null=True, + verbose_name="object ID", + ), + ), + migrations.CreateModel( + name="PartijIdentificatorCodeSoortObjectId", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("uuid", models.UUIDField(default=uuid.uuid4, unique=True)), + ( + "soort_object_id", + models.CharField( + blank=True, + help_text="Soort object id", + max_length=255, + verbose_name="Soort object id", + ), + ), + ( + "object_type", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + to="klantinteracties.partijidentificatorcodeobjecttype", + ), + ), + ], + ), + migrations.AddField( + model_name="partijidentificatorcodeobjecttype", + name="register", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + to="klantinteracties.partijidentificatorcoderegister", + ), + ), + migrations.AlterField( + model_name="partijidentificator", + name="partij_identificator_code_objecttype", + field=models.ForeignKey( + help_text="Type van het object, bijvoorbeeld: 'INGESCHREVEN NATUURLIJK PERSOON'.", + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to="klantinteracties.partijidentificatorcodeobjecttype", + verbose_name="objecttype", + ), + ), + migrations.AlterField( + model_name="partijidentificator", + name="partij_identificator_code_register", + field=models.ForeignKey( + help_text="Binnen het landschap van registers unieke omschrijving van het register waarin het object is geregistreerd, bijvoorbeeld: 'BRP'.", + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to="klantinteracties.partijidentificatorcoderegister", + verbose_name="code register", + ), + ), + migrations.AlterField( + model_name="partijidentificator", + name="partij_identificator_code_soort_object_id", + field=models.ForeignKey( + help_text="Naam van de eigenschap die het object identificeert, bijvoorbeeld: 'Burgerservicenummer'.", + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to="klantinteracties.partijidentificatorcodesoortobjectid", + verbose_name="soort object id", + ), + ), + ] diff --git a/src/openklant/components/klantinteracties/models/partijen.py b/src/openklant/components/klantinteracties/models/partijen.py index 942c6756..788939ae 100644 --- a/src/openklant/components/klantinteracties/models/partijen.py +++ b/src/openklant/components/klantinteracties/models/partijen.py @@ -325,11 +325,9 @@ class PartijIdentificatorCodeRegister(models.Model): uuid = models.UUIDField( unique=True, default=uuid.uuid4, - help_text=_(""), ) register = models.CharField( _("register"), - help_text=_(""), max_length=50, blank=True, ) @@ -348,12 +346,10 @@ class PartijIdentificatorCodeObjectType(models.Model): uuid = models.UUIDField( unique=True, default=uuid.uuid4, - help_text=_(""), ) register = models.ForeignKey( PartijIdentificatorCodeRegister, on_delete=models.CASCADE, - help_text=_(""), null=True, blank=True, ) @@ -372,12 +368,10 @@ class PartijIdentificatorCodeSoortObjectId(models.Model): uuid = models.UUIDField( unique=True, default=uuid.uuid4, - help_text=_(""), ) object_type = models.ForeignKey( PartijIdentificatorCodeObjectType, on_delete=models.CASCADE, - help_text=_(""), null=True, blank=True, )