From c4b2eaf7dba02a4a8a8edd8c2afdf173f0d1fc9c Mon Sep 17 00:00:00 2001 From: Tomos Williams Date: Thu, 4 Jan 2024 14:26:22 +0000 Subject: [PATCH] added global default id --- .gitignore | 1 + conf/settings.py | 2 + ...apping_id_alter_licencedata_id_and_more.py | 37 ------------------- ...0022_alter_licencedata_licence_payloads.py | 22 +++++++++++ mail/models.py | 3 -- 5 files changed, 25 insertions(+), 40 deletions(-) delete mode 100644 mail/migrations/0022_alter_goodidmapping_id_alter_licencedata_id_and_more.py create mode 100644 mail/migrations/0022_alter_licencedata_licence_payloads.py diff --git a/.gitignore b/.gitignore index 28bc9ef6..cfadcddd 100644 --- a/.gitignore +++ b/.gitignore @@ -78,3 +78,4 @@ mailserver/* # pii file .pii-secret-hook +.background-tasks-is-ready \ No newline at end of file diff --git a/conf/settings.py b/conf/settings.py index 1723fd15..c4d00e7f 100644 --- a/conf/settings.py +++ b/conf/settings.py @@ -255,3 +255,5 @@ AZURE_AUTH_TENANT_ID = env.str("AZURE_AUTH_TENANT_ID") SEND_REJECTED_EMAIL = env.bool("SEND_REJECTED_EMAIL", default=True) + +DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' diff --git a/mail/migrations/0022_alter_goodidmapping_id_alter_licencedata_id_and_more.py b/mail/migrations/0022_alter_goodidmapping_id_alter_licencedata_id_and_more.py deleted file mode 100644 index fa639a65..00000000 --- a/mail/migrations/0022_alter_goodidmapping_id_alter_licencedata_id_and_more.py +++ /dev/null @@ -1,37 +0,0 @@ -# Generated by Django 4.2.9 on 2024-01-04 10:55 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("mail", "0021_licencepayload_skip_process"), - ] - - operations = [ - migrations.AlterField( - model_name="goodidmapping", - name="id", - field=models.AutoField(primary_key=True, serialize=False), - ), - migrations.AlterField( - model_name="licencedata", - name="id", - field=models.AutoField(primary_key=True, serialize=False), - ), - migrations.AlterField( - model_name="licencedata", - name="licence_payloads", - field=models.ManyToManyField( - help_text="LicencePayload records linked to this LicenceData instance", - related_name="+", - to="mail.licencepayload", - ), - ), - migrations.AlterField( - model_name="transactionmapping", - name="id", - field=models.AutoField(primary_key=True, serialize=False), - ), - ] diff --git a/mail/migrations/0022_alter_licencedata_licence_payloads.py b/mail/migrations/0022_alter_licencedata_licence_payloads.py new file mode 100644 index 00000000..7ce206bd --- /dev/null +++ b/mail/migrations/0022_alter_licencedata_licence_payloads.py @@ -0,0 +1,22 @@ +# Generated by Django 4.2.9 on 2024-01-04 14:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("mail", "0021_licencepayload_skip_process"), + ] + + operations = [ + migrations.AlterField( + model_name="licencedata", + name="licence_payloads", + field=models.ManyToManyField( + help_text="LicencePayload records linked to this LicenceData instance", + related_name="+", + to="mail.licencepayload", + ), + ), + ] diff --git a/mail/models.py b/mail/models.py index 6bd2b56a..c2de8a7c 100644 --- a/mail/models.py +++ b/mail/models.py @@ -100,7 +100,6 @@ def notify_users(id, response_date): class LicenceData(models.Model): - id = models.AutoField(primary_key=True) licence_ids = models.TextField() hmrc_run_number = models.IntegerField() source_run_number = models.IntegerField(null=True) @@ -193,14 +192,12 @@ class OrganisationIdMapping(models.Model): class GoodIdMapping(models.Model): - id = models.AutoField(primary_key=True) lite_id = models.UUIDField(primary_key=False, null=False, blank=False, unique=False) licence_reference = models.CharField(null=False, blank=False, max_length=35, unique=False) line_number = models.PositiveIntegerField() class TransactionMapping(models.Model): - id = models.AutoField(primary_key=True) licence_reference = models.CharField(null=False, blank=False, max_length=35, unique=False) line_number = models.PositiveIntegerField(null=True, blank=True) usage_transaction = models.CharField(null=False, blank=False, max_length=35)