From 3d3050713b4a4f13a49c1b2e1e2c5c55efbd9401 Mon Sep 17 00:00:00 2001 From: Peter Thomassen Date: Tue, 10 Sep 2024 00:04:19 +0200 Subject: [PATCH] chore(api): complete migration squashing Ref: 0d1bd55808ffb58af644fa897f8c92ce356b896e --- .../migrations/0001_initial_squashed_again.py | 491 ------------------ .../0001_squashed_0031_alter_user_email.py | 60 --- .../migrations/0002_unmanaged_donations.py | 19 - api/desecapi/migrations/0003_rr_content.py | 17 - .../migrations/0004_immortal_domains.py | 20 - .../migrations/0005_subname_validation.py | 30 -- .../migrations/0006_cname_exclusivity.py | 30 -- api/desecapi/migrations/0007_email_citext.py | 22 - .../0008_token_perm_manage_tokens.py | 22 - .../migrations/0009_token_allowed_subnets.py | 24 - .../migrations/0010_token_expiration.py | 36 -- api/desecapi/migrations/0011_captcha_kind.py | 26 - .../migrations/0012_rrset_label_length.py | 30 -- .../migrations/0013_user_needs_captcha.py | 22 - api/desecapi/migrations/0014_replication.py | 22 - .../migrations/0015_rrset_touched_index.py | 17 - .../migrations/0016_default_auto_field.py | 26 - .../0017_alter_user_limit_domains.py | 22 - .../migrations/0018_tokendomainpolicy.py | 105 ---- .../migrations/0019_alter_user_is_active.py | 32 -- .../migrations/0020_user_email_verified.py | 30 -- .../0021_authenticatednoopuseraction.py | 33 -- .../0022_user_outreach_preference.py | 17 - .../0023_authenticatedemailuseraction.py | 33 -- ...catedchangeoutreachpreferenceuseraction.py | 34 -- ...n_max_age_alter_token_max_unused_period.py | 55 -- .../0026_remove_domain_replicated_and_more.py | 20 - .../0027_user_credentials_changed.py | 30 -- ...otpfactoruseraction_basefactor_and_more.py | 92 ---- api/desecapi/migrations/0029_token_mfa.py | 20 - ..._blockedsubnet_blockedsubnet_subnet_idx.py | 51 -- .../migrations/0031_alter_user_email.py | 34 -- ...2_tokendomainpolicy_token_user_and_more.py | 2 +- 33 files changed, 1 insertion(+), 1523 deletions(-) delete mode 100644 api/desecapi/migrations/0001_initial_squashed_again.py delete mode 100644 api/desecapi/migrations/0002_unmanaged_donations.py delete mode 100644 api/desecapi/migrations/0003_rr_content.py delete mode 100644 api/desecapi/migrations/0004_immortal_domains.py delete mode 100644 api/desecapi/migrations/0005_subname_validation.py delete mode 100644 api/desecapi/migrations/0006_cname_exclusivity.py delete mode 100644 api/desecapi/migrations/0007_email_citext.py delete mode 100644 api/desecapi/migrations/0008_token_perm_manage_tokens.py delete mode 100644 api/desecapi/migrations/0009_token_allowed_subnets.py delete mode 100644 api/desecapi/migrations/0010_token_expiration.py delete mode 100644 api/desecapi/migrations/0011_captcha_kind.py delete mode 100644 api/desecapi/migrations/0012_rrset_label_length.py delete mode 100644 api/desecapi/migrations/0013_user_needs_captcha.py delete mode 100644 api/desecapi/migrations/0014_replication.py delete mode 100644 api/desecapi/migrations/0015_rrset_touched_index.py delete mode 100644 api/desecapi/migrations/0016_default_auto_field.py delete mode 100644 api/desecapi/migrations/0017_alter_user_limit_domains.py delete mode 100644 api/desecapi/migrations/0018_tokendomainpolicy.py delete mode 100644 api/desecapi/migrations/0019_alter_user_is_active.py delete mode 100644 api/desecapi/migrations/0020_user_email_verified.py delete mode 100644 api/desecapi/migrations/0021_authenticatednoopuseraction.py delete mode 100644 api/desecapi/migrations/0022_user_outreach_preference.py delete mode 100644 api/desecapi/migrations/0023_authenticatedemailuseraction.py delete mode 100644 api/desecapi/migrations/0024_authenticatedchangeoutreachpreferenceuseraction.py delete mode 100644 api/desecapi/migrations/0025_alter_token_max_age_alter_token_max_unused_period.py delete mode 100644 api/desecapi/migrations/0026_remove_domain_replicated_and_more.py delete mode 100644 api/desecapi/migrations/0027_user_credentials_changed.py delete mode 100644 api/desecapi/migrations/0028_authenticatedcreatetotpfactoruseraction_basefactor_and_more.py delete mode 100644 api/desecapi/migrations/0029_token_mfa.py delete mode 100644 api/desecapi/migrations/0030_blockedsubnet_blockedsubnet_subnet_idx.py delete mode 100644 api/desecapi/migrations/0031_alter_user_email.py diff --git a/api/desecapi/migrations/0001_initial_squashed_again.py b/api/desecapi/migrations/0001_initial_squashed_again.py deleted file mode 100644 index 4038d2d05..000000000 --- a/api/desecapi/migrations/0001_initial_squashed_again.py +++ /dev/null @@ -1,491 +0,0 @@ -# Generated by Django 3.1 on 2020-08-25 14:54 - -import desecapi.models -from django.conf import settings -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion -import re -import uuid -from django.contrib.postgres.operations import CreateCollation - - -class Migration(migrations.Migration): - initial = True - - dependencies = [] - - operations = [ - # Explanation: https://adamj.eu/tech/2023/02/23/migrate-django-postgresql-ci-fields-case-insensitive-collation/ - CreateCollation( - "case_insensitive", - provider="icu", - locale="und-u-ks-level2", - deterministic=False, - ), - migrations.CreateModel( - name="User", - fields=[ - ( - "id", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("password", models.CharField(max_length=128, verbose_name="password")), - ( - "last_login", - models.DateTimeField( - blank=True, null=True, verbose_name="last login" - ), - ), - ( - "email", - models.EmailField( - db_collation="case_insensitive", - max_length=254, - unique=True, - verbose_name="email address", - ), - ), - ("is_active", models.BooleanField(default=True)), - ("is_admin", models.BooleanField(default=False)), - ("created", models.DateTimeField(auto_now_add=True)), - ( - "limit_domains", - models.IntegerField( - blank=True, - default=desecapi.models.User._limit_domains_default, - null=True, - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.CreateModel( - name="Domain", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("created", models.DateTimeField(auto_now_add=True)), - ( - "name", - models.CharField( - max_length=191, - unique=True, - validators=[ - desecapi.models.validate_lower, - django.core.validators.RegexValidator( - code="invalid_domain_name", - flags=re.RegexFlag["IGNORECASE"], - message="Domain names must be labels separated by dots. Labels may consist of up to 63 letters, digits, hyphens, and underscores. The last label may not contain an underscore.", - regex="^(([a-z0-9_-]{1,63})\\.)*[a-z0-9-]{1,63}$", - ), - ], - ), - ), - ( - "owner", - models.ForeignKey( - on_delete=django.db.models.deletion.PROTECT, - related_name="domains", - to=settings.AUTH_USER_MODEL, - ), - ), - ("published", models.DateTimeField(blank=True, null=True)), - ( - "minimum_ttl", - models.PositiveIntegerField( - default=desecapi.models.Domain._minimum_ttl_default - ), - ), - ("renewal_changed", models.DateTimeField(auto_now_add=True)), - ( - "renewal_state", - models.IntegerField( - choices=[(1, "Fresh"), (2, "Notified"), (3, "Warned")], - default=1, - ), - ), - ], - options={ - "ordering": ("created",), - }, - ), - migrations.CreateModel( - name="RRset", - fields=[ - ( - "id", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created", models.DateTimeField(auto_now_add=True)), - ("touched", models.DateTimeField(auto_now=True)), - ( - "subname", - models.CharField( - blank=True, - max_length=178, - validators=[ - desecapi.models.validate_lower, - django.core.validators.RegexValidator( - code="invalid_subname", - message="Subname can only use (lowercase) a-z, 0-9, ., -, and _, may start with a '*.', or just be '*'.", - regex="^([*]|(([*][.])?[a-z0-9_.-]*))$", - ), - ], - ), - ), - ( - "type", - models.CharField( - max_length=10, - validators=[ - desecapi.models.validate_upper, - django.core.validators.RegexValidator( - code="invalid_type", - message="Type must be uppercase alphanumeric and start with a letter.", - regex="^[A-Z][A-Z0-9]*$", - ), - ], - ), - ), - ("ttl", models.PositiveIntegerField()), - ( - "domain", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to="desecapi.domain", - ), - ), - ], - options={ - "unique_together": {("domain", "subname", "type")}, - }, - ), - migrations.CreateModel( - name="AuthenticatedAction", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ], - options={ - "managed": False, - }, - ), - migrations.CreateModel( - name="AuthenticatedUserAction", - fields=[ - ( - "authenticatedaction_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="desecapi.authenticatedaction", - ), - ), - ], - options={ - "managed": False, - }, - bases=("desecapi.authenticatedaction",), - ), - migrations.CreateModel( - name="AuthenticatedDeleteUserAction", - fields=[ - ( - "authenticateduseraction_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="desecapi.authenticateduseraction", - ), - ), - ], - options={ - "managed": False, - }, - bases=("desecapi.authenticateduseraction",), - ), - migrations.CreateModel( - name="AuthenticatedResetPasswordUserAction", - fields=[ - ( - "authenticateduseraction_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="desecapi.authenticateduseraction", - ), - ), - ("new_password", models.CharField(max_length=128)), - ], - options={ - "managed": False, - }, - bases=("desecapi.authenticateduseraction",), - ), - migrations.CreateModel( - name="Captcha", - fields=[ - ( - "id", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created", models.DateTimeField(auto_now_add=True)), - ( - "content", - models.CharField( - default=desecapi.models.captcha.captcha_default_content, - max_length=24, - ), - ), - ], - ), - migrations.CreateModel( - name="Token", - fields=[ - ( - "id", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ( - "created", - models.DateTimeField(auto_now_add=True, verbose_name="Created"), - ), - ( - "key", - models.CharField( - db_index=True, max_length=128, unique=True, verbose_name="Key" - ), - ), - ( - "name", - models.CharField(blank=True, max_length=64, verbose_name="Name"), - ), - ( - "user", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="auth_tokens", - to=settings.AUTH_USER_MODEL, - verbose_name="User", - ), - ), - ("last_used", models.DateTimeField(blank=True, null=True)), - ], - options={ - "verbose_name": "Token", - "verbose_name_plural": "Tokens", - }, - ), - migrations.CreateModel( - name="RR", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("created", models.DateTimeField(auto_now_add=True)), - ("content", models.CharField(max_length=500)), - ( - "rrset", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="records", - to="desecapi.rrset", - ), - ), - ], - ), - migrations.CreateModel( - name="AuthenticatedActivateUserAction", - fields=[ - ( - "authenticateduseraction_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="desecapi.authenticateduseraction", - ), - ), - ("domain", models.CharField(max_length=191)), - ], - options={ - "managed": False, - }, - bases=("desecapi.authenticateduseraction",), - ), - migrations.CreateModel( - name="AuthenticatedChangeEmailUserAction", - fields=[ - ( - "authenticateduseraction_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="desecapi.authenticateduseraction", - ), - ), - ("new_email", models.EmailField(max_length=254)), - ], - options={ - "managed": False, - }, - bases=("desecapi.authenticateduseraction",), - ), - migrations.CreateModel( - name="AuthenticatedBasicUserAction", - fields=[ - ( - "authenticatedaction_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="desecapi.authenticatedaction", - ), - ), - ], - options={ - "managed": False, - }, - bases=("desecapi.authenticatedaction",), - ), - migrations.CreateModel( - name="AuthenticatedDomainBasicUserAction", - fields=[ - ( - "authenticatedbasicuseraction_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="desecapi.authenticatedbasicuseraction", - ), - ), - ], - options={ - "managed": False, - }, - bases=("desecapi.authenticatedbasicuseraction",), - ), - migrations.CreateModel( - name="AuthenticatedRenewDomainBasicUserAction", - fields=[ - ( - "authenticateddomainbasicuseraction_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="desecapi.authenticateddomainbasicuseraction", - ), - ), - ], - options={ - "managed": False, - }, - bases=("desecapi.authenticateddomainbasicuseraction",), - ), - migrations.CreateModel( - name="Donation", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "created", - models.DateTimeField( - default=desecapi.models.Donation._created_default - ), - ), - ("name", models.CharField(max_length=255)), - ("iban", models.CharField(max_length=34)), - ("bic", models.CharField(max_length=11)), - ("amount", models.DecimalField(decimal_places=2, max_digits=8)), - ("message", models.CharField(blank=True, max_length=255)), - ( - "due", - models.DateTimeField(default=desecapi.models.Donation._due_default), - ), - ( - "mref", - models.CharField( - default=desecapi.models.Donation._mref_default, max_length=32 - ), - ), - ("email", models.EmailField(blank=True, max_length=255)), - ], - options={ - "ordering": ("created",), - "managed": False, - }, - ), - ] diff --git a/api/desecapi/migrations/0001_squashed_0031_alter_user_email.py b/api/desecapi/migrations/0001_squashed_0031_alter_user_email.py index a8de890c3..13530035f 100644 --- a/api/desecapi/migrations/0001_squashed_0031_alter_user_email.py +++ b/api/desecapi/migrations/0001_squashed_0031_alter_user_email.py @@ -2,19 +2,7 @@ import datetime import desecapi.models.base -import desecapi.models.captcha -import desecapi.models.domains -import desecapi.models.donation -import desecapi.models.mfa -import desecapi.models.tokens import desecapi.models.users -import django.contrib.postgres.constraints -import django.contrib.postgres.fields -import django.contrib.postgres.indexes -import django.contrib.postgres.operations -import django.core.validators -import django.db.migrations.operations.special -import django.db.models.deletion import django.db.models.expressions import netfields.fields import re @@ -24,17 +12,6 @@ from django.db.models import F, Q -# Functions from the following migrations need manual copying. -# Move them and any dependencies into this file, then update the -# RunPython operations to refer to the local versions: -# desecapi.migrations.0007_email_citext -# desecapi.migrations.0019_alter_user_is_active -# desecapi.migrations.0020_user_email_verified -# desecapi.migrations.0025_alter_token_max_age_alter_token_max_unused_period -# desecapi.migrations.0027_user_credentials_changed -# desecapi.migrations.0031_alter_user_email - - def alter_user_is_active_forward(apps, schema_editor): User = apps.get_model("desecapi", "User") db_alias = schema_editor.connection.alias @@ -78,43 +55,6 @@ def user_credentials_changed_forward(apps, schema_editor): class Migration(migrations.Migration): - replaces = [ - ("desecapi", "0001_initial_squashed_again"), - ("desecapi", "0002_unmanaged_donations"), - ("desecapi", "0003_rr_content"), - ("desecapi", "0004_immortal_domains"), - ("desecapi", "0005_subname_validation"), - ("desecapi", "0006_cname_exclusivity"), - ("desecapi", "0007_email_citext"), - ("desecapi", "0008_token_perm_manage_tokens"), - ("desecapi", "0009_token_allowed_subnets"), - ("desecapi", "0010_token_expiration"), - ("desecapi", "0011_captcha_kind"), - ("desecapi", "0012_rrset_label_length"), - ("desecapi", "0013_user_needs_captcha"), - ("desecapi", "0014_replication"), - ("desecapi", "0015_rrset_touched_index"), - ("desecapi", "0016_default_auto_field"), - ("desecapi", "0017_alter_user_limit_domains"), - ("desecapi", "0018_tokendomainpolicy"), - ("desecapi", "0019_alter_user_is_active"), - ("desecapi", "0020_user_email_verified"), - ("desecapi", "0021_authenticatednoopuseraction"), - ("desecapi", "0022_user_outreach_preference"), - ("desecapi", "0023_authenticatedemailuseraction"), - ("desecapi", "0024_authenticatedchangeoutreachpreferenceuseraction"), - ("desecapi", "0025_alter_token_max_age_alter_token_max_unused_period"), - ("desecapi", "0026_remove_domain_replicated_and_more"), - ("desecapi", "0027_user_credentials_changed"), - ( - "desecapi", - "0028_authenticatedcreatetotpfactoruseraction_basefactor_and_more", - ), - ("desecapi", "0029_token_mfa"), - ("desecapi", "0030_blockedsubnet_blockedsubnet_subnet_idx"), - ("desecapi", "0031_alter_user_email"), - ] - initial = True dependencies = [] diff --git a/api/desecapi/migrations/0002_unmanaged_donations.py b/api/desecapi/migrations/0002_unmanaged_donations.py deleted file mode 100644 index 5685f5ca7..000000000 --- a/api/desecapi/migrations/0002_unmanaged_donations.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.1 on 2020-08-26 07:42 - -# It appears that this migration is "unsquashable". If you squash it in 0001, Django will think it's missing and -# generate it next time again. - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0001_initial_squashed_again"), - ] - - operations = [ - migrations.AlterModelOptions( - name="donation", - options={"managed": False}, - ), - ] diff --git a/api/desecapi/migrations/0003_rr_content.py b/api/desecapi/migrations/0003_rr_content.py deleted file mode 100644 index 27599b395..000000000 --- a/api/desecapi/migrations/0003_rr_content.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.1 on 2020-08-26 07:46 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0002_unmanaged_donations"), - ] - - operations = [ - migrations.AlterField( - model_name="rr", - name="content", - field=models.TextField(), - ), - ] diff --git a/api/desecapi/migrations/0004_immortal_domains.py b/api/desecapi/migrations/0004_immortal_domains.py deleted file mode 100644 index 393a74a3d..000000000 --- a/api/desecapi/migrations/0004_immortal_domains.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.1 on 2020-08-27 09:01 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0003_rr_content"), - ] - - operations = [ - migrations.AlterField( - model_name="domain", - name="renewal_state", - field=models.IntegerField( - choices=[(0, "Immortal"), (1, "Fresh"), (2, "Notified"), (3, "Warned")], - default=0, - ), - ), - ] diff --git a/api/desecapi/migrations/0005_subname_validation.py b/api/desecapi/migrations/0005_subname_validation.py deleted file mode 100644 index c6c4baab7..000000000 --- a/api/desecapi/migrations/0005_subname_validation.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 3.1 on 2020-09-08 14:01 - -import desecapi.models -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0004_immortal_domains"), - ] - - operations = [ - migrations.AlterField( - model_name="rrset", - name="subname", - field=models.CharField( - blank=True, - max_length=178, - validators=[ - desecapi.models.validate_lower, - django.core.validators.RegexValidator( - code="invalid_subname", - message="Subname can only use (lowercase) a-z, 0-9, ., -, and _, may start with a '*.', or just be '*'.", - regex="^([*]|(([*][.])?([a-z0-9_-]+[.])*[a-z0-9_-]+))$", - ), - ], - ), - ), - ] diff --git a/api/desecapi/migrations/0006_cname_exclusivity.py b/api/desecapi/migrations/0006_cname_exclusivity.py deleted file mode 100644 index 6752bf637..000000000 --- a/api/desecapi/migrations/0006_cname_exclusivity.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 3.1 on 2020-09-18 16:09 - -import django.contrib.postgres.constraints -from django.contrib.postgres.operations import BtreeGistExtension -from django.db import migrations, models -import django.db.models.expressions - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0005_subname_validation"), - ] - - operations = [ - BtreeGistExtension(), - migrations.AddConstraint( - model_name="rrset", - constraint=django.contrib.postgres.constraints.ExclusionConstraint( - expressions=[ - ("domain", "="), - ("subname", "="), - ( - django.db.models.expressions.RawSQL("int4(type = 'CNAME')", ()), - "<>", - ), - ], - name="cname_exclusivity", - ), - ), - ] diff --git a/api/desecapi/migrations/0007_email_citext.py b/api/desecapi/migrations/0007_email_citext.py deleted file mode 100644 index dc4c26ba1..000000000 --- a/api/desecapi/migrations/0007_email_citext.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.1 on 2020-09-29 14:28 - -# import django.contrib.postgres.fields.citext -# from django.contrib.postgres.operations import CITextExtension -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0006_cname_exclusivity"), - ] - - operations = [ - # CITextExtension(), - # migrations.AlterField( - # model_name="user", - # name="email", - # field=django.contrib.postgres.fields.citext.CIEmailField( - # max_length=254, unique=True, verbose_name="email address" - # ), - # ), - ] diff --git a/api/desecapi/migrations/0008_token_perm_manage_tokens.py b/api/desecapi/migrations/0008_token_perm_manage_tokens.py deleted file mode 100644 index 7eb42acd9..000000000 --- a/api/desecapi/migrations/0008_token_perm_manage_tokens.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.1.2 on 2020-11-06 23:02 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0007_email_citext"), - ] - - operations = [ - migrations.AddField( - model_name="token", - name="perm_manage_tokens", - field=models.BooleanField(default=True), - ), - migrations.AlterField( - model_name="token", - name="perm_manage_tokens", - field=models.BooleanField(default=False), - ), - ] diff --git a/api/desecapi/migrations/0009_token_allowed_subnets.py b/api/desecapi/migrations/0009_token_allowed_subnets.py deleted file mode 100644 index c1963c628..000000000 --- a/api/desecapi/migrations/0009_token_allowed_subnets.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.1.3 on 2020-11-05 19:19 - -import desecapi.models -import django.contrib.postgres.fields -from django.db import migrations -import netfields.fields - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0008_token_perm_manage_tokens"), - ] - - operations = [ - migrations.AddField( - model_name="token", - name="allowed_subnets", - field=django.contrib.postgres.fields.ArrayField( - base_field=netfields.fields.CidrAddressField(max_length=43), - default=desecapi.models.Token._allowed_subnets_default, - size=None, - ), - ), - ] diff --git a/api/desecapi/migrations/0010_token_expiration.py b/api/desecapi/migrations/0010_token_expiration.py deleted file mode 100644 index 04e8a6ba8..000000000 --- a/api/desecapi/migrations/0010_token_expiration.py +++ /dev/null @@ -1,36 +0,0 @@ -# Generated by Django 3.1.3 on 2020-11-19 09:55 - -import datetime -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0009_token_allowed_subnets"), - ] - - operations = [ - migrations.AddField( - model_name="token", - name="max_age", - field=models.DurationField( - default=None, - null=True, - validators=[ - django.core.validators.MinValueValidator(datetime.timedelta(0)) - ], - ), - ), - migrations.AddField( - model_name="token", - name="max_unused_period", - field=models.DurationField( - default=None, - null=True, - validators=[ - django.core.validators.MinValueValidator(datetime.timedelta(0)) - ], - ), - ), - ] diff --git a/api/desecapi/migrations/0011_captcha_kind.py b/api/desecapi/migrations/0011_captcha_kind.py deleted file mode 100644 index 3bf51dab6..000000000 --- a/api/desecapi/migrations/0011_captcha_kind.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.1.4 on 2020-12-29 14:08 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0010_token_expiration"), - ] - - operations = [ - migrations.AddField( - model_name="captcha", - name="kind", - field=models.CharField( - choices=[("image", "Image"), ("audio", "Audio")], - default="image", - max_length=24, - ), - ), - migrations.AlterField( - model_name="captcha", - name="content", - field=models.CharField(default="", max_length=24), - ), - ] diff --git a/api/desecapi/migrations/0012_rrset_label_length.py b/api/desecapi/migrations/0012_rrset_label_length.py deleted file mode 100644 index cc3f84482..000000000 --- a/api/desecapi/migrations/0012_rrset_label_length.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 3.1.5 on 2021-01-14 12:51 - -import desecapi.models -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0011_captcha_kind"), - ] - - operations = [ - migrations.AlterField( - model_name="rrset", - name="subname", - field=models.CharField( - blank=True, - max_length=178, - validators=[ - desecapi.models.validate_lower, - django.core.validators.RegexValidator( - code="invalid_subname", - message="Subname can only use (lowercase) a-z, 0-9, ., -, and _, may start with a '*.', or just be '*'. Components may not exceed 63 characters.", - regex="^([*]|(([*][.])?([a-z0-9_-]{1,63}[.])*[a-z0-9_-]{1,63}))$", - ), - ], - ), - ), - ] diff --git a/api/desecapi/migrations/0013_user_needs_captcha.py b/api/desecapi/migrations/0013_user_needs_captcha.py deleted file mode 100644 index f73598fd2..000000000 --- a/api/desecapi/migrations/0013_user_needs_captcha.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.1.5 on 2021-01-19 15:43 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0012_rrset_label_length"), - ] - - operations = [ - migrations.AddField( - model_name="user", - name="needs_captcha", - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name="user", - name="needs_captcha", - field=models.BooleanField(default=True), - ), - ] diff --git a/api/desecapi/migrations/0014_replication.py b/api/desecapi/migrations/0014_replication.py deleted file mode 100644 index 4b6b7df4b..000000000 --- a/api/desecapi/migrations/0014_replication.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.1.5 on 2021-01-21 19:29 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0013_user_needs_captcha"), - ] - - operations = [ - migrations.AddField( - model_name="domain", - name="replicated", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name="domain", - name="replication_duration", - field=models.DurationField(blank=True, null=True), - ), - ] diff --git a/api/desecapi/migrations/0015_rrset_touched_index.py b/api/desecapi/migrations/0015_rrset_touched_index.py deleted file mode 100644 index 52d5c2f1f..000000000 --- a/api/desecapi/migrations/0015_rrset_touched_index.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.1.6 on 2021-02-14 18:04 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0014_replication"), - ] - - operations = [ - migrations.AlterField( - model_name="rrset", - name="touched", - field=models.DateTimeField(auto_now=True, db_index=True), - ), - ] diff --git a/api/desecapi/migrations/0016_default_auto_field.py b/api/desecapi/migrations/0016_default_auto_field.py deleted file mode 100644 index ca0a0bf89..000000000 --- a/api/desecapi/migrations/0016_default_auto_field.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.3 on 2021-05-18 15:22 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0015_rrset_touched_index"), - ] - - operations = [ - migrations.AlterField( - model_name="domain", - name="id", - field=models.BigAutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID" - ), - ), - migrations.AlterField( - model_name="rr", - name="id", - field=models.BigAutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID" - ), - ), - ] diff --git a/api/desecapi/migrations/0017_alter_user_limit_domains.py b/api/desecapi/migrations/0017_alter_user_limit_domains.py deleted file mode 100644 index 74590aab0..000000000 --- a/api/desecapi/migrations/0017_alter_user_limit_domains.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.2.3 on 2021-06-29 13:29 - -import desecapi.models -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0016_default_auto_field"), - ] - - operations = [ - migrations.AlterField( - model_name="user", - name="limit_domains", - field=models.PositiveIntegerField( - blank=True, - default=desecapi.models.User._limit_domains_default, - null=True, - ), - ), - ] diff --git a/api/desecapi/migrations/0018_tokendomainpolicy.py b/api/desecapi/migrations/0018_tokendomainpolicy.py deleted file mode 100644 index 30ec042de..000000000 --- a/api/desecapi/migrations/0018_tokendomainpolicy.py +++ /dev/null @@ -1,105 +0,0 @@ -# Generated by Django 3.2.10 on 2021-12-17 22:56 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import django.db.models.expressions - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0017_alter_user_limit_domains"), - ] - - operations = [ - migrations.AlterField( - model_name="token", - name="user", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL - ), - ), - migrations.CreateModel( - name="TokenDomainPolicy", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("perm_dyndns", models.BooleanField(default=False)), - ("perm_rrsets", models.BooleanField(default=False)), - ( - "domain", - models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.CASCADE, - to="desecapi.domain", - ), - ), - ( - "token", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to="desecapi.token" - ), - ), - ( - "token_user", - models.ForeignKey( - db_constraint=False, - on_delete=django.db.models.deletion.CASCADE, - related_name="+", - to=settings.AUTH_USER_MODEL, - ), - ), - ], - ), - migrations.AddField( - model_name="token", - name="domain_policies", - field=models.ManyToManyField( - through="desecapi.TokenDomainPolicy", to="desecapi.Domain" - ), - ), - migrations.AddConstraint( - model_name="tokendomainpolicy", - constraint=models.UniqueConstraint( - fields=("token", "domain"), name="unique_entry" - ), - ), - migrations.AddConstraint( - model_name="tokendomainpolicy", - constraint=models.UniqueConstraint( - condition=models.Q(("domain__isnull", True)), - fields=("token",), - name="unique_entry_null_domain", - ), - ), - # The remaining operations ensure that domain.owner and token.user can't be inconsistent - migrations.AlterModelOptions( - name="token", - options={}, - ), - migrations.AddConstraint( - model_name="token", - constraint=models.UniqueConstraint( - fields=("id", "user"), name="unique_id_user" - ), - ), - migrations.AddConstraint( - model_name="domain", - constraint=models.UniqueConstraint( - fields=("id", "owner"), name="unique_id_owner" - ), - ), - migrations.RunSQL( - "ALTER TABLE desecapi_tokendomainpolicy" - " ADD FOREIGN KEY ( domain_id, token_user_id ) REFERENCES desecapi_domain ( id, owner_id )," - " ADD FOREIGN KEY ( token_id, token_user_id ) REFERENCES desecapi_token ( id, user_id );", - migrations.RunSQL.noop, - ), - ] diff --git a/api/desecapi/migrations/0019_alter_user_is_active.py b/api/desecapi/migrations/0019_alter_user_is_active.py deleted file mode 100644 index d6e2760be..000000000 --- a/api/desecapi/migrations/0019_alter_user_is_active.py +++ /dev/null @@ -1,32 +0,0 @@ -# Generated by Django 4.0.1 on 2022-01-17 12:20 - -from django.db import migrations, models - - -def forwards_func(apps, schema_editor): - User = apps.get_model("desecapi", "User") - db_alias = schema_editor.connection.alias - User.objects.using(db_alias).filter( - is_active=False, last_login__isnull=True - ).update(is_active=None) - - -def reverse_func(apps, schema_editor): - User = apps.get_model("desecapi", "User") - db_alias = schema_editor.connection.alias - User.objects.using(db_alias).filter(is_active__isnull=True).update(is_active=False) - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0018_tokendomainpolicy"), - ] - - operations = [ - migrations.AlterField( - model_name="user", - name="is_active", - field=models.BooleanField(default=True, null=True), - ), - migrations.RunPython(forwards_func, reverse_func), - ] diff --git a/api/desecapi/migrations/0020_user_email_verified.py b/api/desecapi/migrations/0020_user_email_verified.py deleted file mode 100644 index acb0e0828..000000000 --- a/api/desecapi/migrations/0020_user_email_verified.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 4.0.1 on 2022-01-14 13:39 - -import datetime - -from django.db import migrations, models -from django.db.models import F, Q - - -def forwards_func(apps, schema_editor): - User = apps.get_model("desecapi", "User") - db_alias = schema_editor.connection.alias - User.objects.using(db_alias).filter( - Q(is_active=True) | Q(last_login__isnull=False), - created__date__gte=datetime.date(2019, 11, 1), - ).update(email_verified=F("created")) - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0019_alter_user_is_active"), - ] - - operations = [ - migrations.AddField( - model_name="user", - name="email_verified", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.RunPython(forwards_func, migrations.RunPython.noop), - ] diff --git a/api/desecapi/migrations/0021_authenticatednoopuseraction.py b/api/desecapi/migrations/0021_authenticatednoopuseraction.py deleted file mode 100644 index 45e7e178d..000000000 --- a/api/desecapi/migrations/0021_authenticatednoopuseraction.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 4.0.1 on 2022-01-19 14:41 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0020_user_email_verified"), - ] - - operations = [ - migrations.CreateModel( - name="AuthenticatedNoopUserAction", - fields=[ - ( - "authenticateduseraction_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="desecapi.authenticateduseraction", - ), - ), - ], - options={ - "managed": False, - }, - bases=("desecapi.authenticateduseraction",), - ), - ] diff --git a/api/desecapi/migrations/0022_user_outreach_preference.py b/api/desecapi/migrations/0022_user_outreach_preference.py deleted file mode 100644 index 4f13432cb..000000000 --- a/api/desecapi/migrations/0022_user_outreach_preference.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 4.0.1 on 2022-01-11 19:28 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0021_authenticatednoopuseraction"), - ] - - operations = [ - migrations.AddField( - model_name="user", - name="outreach_preference", - field=models.BooleanField(default=True), - ), - ] diff --git a/api/desecapi/migrations/0023_authenticatedemailuseraction.py b/api/desecapi/migrations/0023_authenticatedemailuseraction.py deleted file mode 100644 index 937eb6e36..000000000 --- a/api/desecapi/migrations/0023_authenticatedemailuseraction.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 4.0.1 on 2022-01-19 16:00 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0022_user_outreach_preference"), - ] - - operations = [ - migrations.CreateModel( - name="AuthenticatedEmailUserAction", - fields=[ - ( - "authenticatedbasicuseraction_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="desecapi.authenticatedbasicuseraction", - ), - ), - ], - options={ - "managed": False, - }, - bases=("desecapi.authenticatedbasicuseraction",), - ), - ] diff --git a/api/desecapi/migrations/0024_authenticatedchangeoutreachpreferenceuseraction.py b/api/desecapi/migrations/0024_authenticatedchangeoutreachpreferenceuseraction.py deleted file mode 100644 index aac034fae..000000000 --- a/api/desecapi/migrations/0024_authenticatedchangeoutreachpreferenceuseraction.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 4.0.1 on 2022-01-20 11:21 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0023_authenticatedemailuseraction"), - ] - - operations = [ - migrations.CreateModel( - name="AuthenticatedChangeOutreachPreferenceUserAction", - fields=[ - ( - "authenticatedemailuseraction_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="desecapi.authenticatedemailuseraction", - ), - ), - ("outreach_preference", models.BooleanField()), - ], - options={ - "managed": False, - }, - bases=("desecapi.authenticatedemailuseraction",), - ), - ] diff --git a/api/desecapi/migrations/0025_alter_token_max_age_alter_token_max_unused_period.py b/api/desecapi/migrations/0025_alter_token_max_age_alter_token_max_unused_period.py deleted file mode 100644 index 77b24ca5f..000000000 --- a/api/desecapi/migrations/0025_alter_token_max_age_alter_token_max_unused_period.py +++ /dev/null @@ -1,55 +0,0 @@ -# Generated by Django 4.0.6 on 2022-08-11 16:37 - -import datetime -import django.core.validators -from django.db import migrations, models - - -def forwards_func(apps, schema_editor): - max_interval = datetime.timedelta(days=365000) - Token = apps.get_model("desecapi", "Token") - db_alias = schema_editor.connection.alias - Token.objects.using(db_alias).filter(max_age__gt=max_interval).update( - max_age=max_interval - ) - Token.objects.using(db_alias).filter(max_unused_period__gt=max_interval).update( - max_unused_period=max_interval - ) - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0024_authenticatedchangeoutreachpreferenceuseraction"), - ] - - operations = [ - migrations.AlterField( - model_name="token", - name="max_age", - field=models.DurationField( - default=None, - null=True, - validators=[ - django.core.validators.MinValueValidator(datetime.timedelta(0)), - django.core.validators.MaxValueValidator( - datetime.timedelta(days=365000) - ), - ], - ), - ), - migrations.AlterField( - model_name="token", - name="max_unused_period", - field=models.DurationField( - default=None, - null=True, - validators=[ - django.core.validators.MinValueValidator(datetime.timedelta(0)), - django.core.validators.MaxValueValidator( - datetime.timedelta(days=365000) - ), - ], - ), - ), - migrations.RunPython(forwards_func, migrations.RunPython.noop), - ] diff --git a/api/desecapi/migrations/0026_remove_domain_replicated_and_more.py b/api/desecapi/migrations/0026_remove_domain_replicated_and_more.py deleted file mode 100644 index 744febd5d..000000000 --- a/api/desecapi/migrations/0026_remove_domain_replicated_and_more.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 4.1 on 2022-08-11 20:28 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0025_alter_token_max_age_alter_token_max_unused_period"), - ] - - operations = [ - migrations.RemoveField( - model_name="domain", - name="replicated", - ), - migrations.RemoveField( - model_name="domain", - name="replication_duration", - ), - ] diff --git a/api/desecapi/migrations/0027_user_credentials_changed.py b/api/desecapi/migrations/0027_user_credentials_changed.py deleted file mode 100644 index c81a84175..000000000 --- a/api/desecapi/migrations/0027_user_credentials_changed.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 4.1 on 2022-08-22 02:13 - -from django.db import migrations, models -from django.db.models import F - - -def forwards_func(apps, schema_editor): - User = apps.get_model("desecapi", "User") - db_alias = schema_editor.connection.alias - User.objects.using(db_alias).update(credentials_changed=F("created")) - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0026_remove_domain_replicated_and_more"), - ] - - operations = [ - migrations.AddField( - model_name="user", - name="credentials_changed", - field=models.DateTimeField(auto_now_add=True, null=True), - ), - migrations.RunPython(forwards_func, migrations.RunPython.noop), - migrations.AlterField( - model_name="user", - name="credentials_changed", - field=models.DateTimeField(auto_now_add=True), - ), - ] diff --git a/api/desecapi/migrations/0028_authenticatedcreatetotpfactoruseraction_basefactor_and_more.py b/api/desecapi/migrations/0028_authenticatedcreatetotpfactoruseraction_basefactor_and_more.py deleted file mode 100644 index 848e77846..000000000 --- a/api/desecapi/migrations/0028_authenticatedcreatetotpfactoruseraction_basefactor_and_more.py +++ /dev/null @@ -1,92 +0,0 @@ -# Generated by Django 4.1 on 2022-08-23 22:23 - -import desecapi.models.mfa -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import uuid - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0027_user_credentials_changed"), - ] - - operations = [ - migrations.CreateModel( - name="AuthenticatedCreateTOTPFactorUserAction", - fields=[ - ( - "authenticateduseraction_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="desecapi.authenticateduseraction", - ), - ), - ("name", models.CharField(blank=True, max_length=64)), - ], - options={ - "managed": False, - }, - bases=("desecapi.authenticateduseraction",), - ), - migrations.CreateModel( - name="BaseFactor", - fields=[ - ( - "id", - models.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created", models.DateTimeField(auto_now_add=True)), - ("last_used", models.DateTimeField(blank=True, null=True)), - ("name", models.CharField(blank=True, default="", max_length=64)), - ( - "user", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to=settings.AUTH_USER_MODEL, - ), - ), - ], - ), - migrations.CreateModel( - name="TOTPFactor", - fields=[ - ( - "basefactor_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="desecapi.basefactor", - ), - ), - ( - "secret", - models.BinaryField( - default=desecapi.models.mfa.TOTPFactor._secret_default, - max_length=32, - ), - ), - ("last_verified_timestep", models.PositiveIntegerField(default=0)), - ], - bases=("desecapi.basefactor",), - ), - migrations.AddConstraint( - model_name="basefactor", - constraint=models.UniqueConstraint( - fields=("user", "name"), name="unique_user_name" - ), - ), - ] diff --git a/api/desecapi/migrations/0029_token_mfa.py b/api/desecapi/migrations/0029_token_mfa.py deleted file mode 100644 index 7a371b365..000000000 --- a/api/desecapi/migrations/0029_token_mfa.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 4.1 on 2022-08-25 03:00 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ( - "desecapi", - "0028_authenticatedcreatetotpfactoruseraction_basefactor_and_more", - ), - ] - - operations = [ - migrations.AddField( - model_name="token", - name="mfa", - field=models.BooleanField(default=None, null=True), - ), - ] diff --git a/api/desecapi/migrations/0030_blockedsubnet_blockedsubnet_subnet_idx.py b/api/desecapi/migrations/0030_blockedsubnet_blockedsubnet_subnet_idx.py deleted file mode 100644 index 9e61a2ed4..000000000 --- a/api/desecapi/migrations/0030_blockedsubnet_blockedsubnet_subnet_idx.py +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by Django 4.1.3 on 2023-01-27 15:58 - -import django.contrib.postgres.indexes -import django.core.validators -from django.db import migrations, models -import netfields.fields - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0029_token_mfa"), - ] - - operations = [ - migrations.CreateModel( - name="BlockedSubnet", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("created", models.DateTimeField(auto_now_add=True)), - ( - "asn", - models.PositiveBigIntegerField( - validators=[ - django.core.validators.MaxValueValidator(4294967295) - ] - ), - ), - ( - "subnet", - netfields.fields.CidrAddressField(max_length=43, unique=True), - ), - ("country", models.TextField()), - ("registry", models.TextField()), - ("allocation_date", models.DateField()), - ], - ), - migrations.AddIndex( - model_name="blockedsubnet", - index=django.contrib.postgres.indexes.GistIndex( - fields=["subnet"], name="subnet_idx", opclasses=("inet_ops",) - ), - ), - ] diff --git a/api/desecapi/migrations/0031_alter_user_email.py b/api/desecapi/migrations/0031_alter_user_email.py deleted file mode 100644 index 5ddd31239..000000000 --- a/api/desecapi/migrations/0031_alter_user_email.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 4.1.9 on 2023-06-08 16:40 - -# from django.contrib.postgres.operations import CreateCollation -from django.db import migrations # , models - - -class Migration(migrations.Migration): - dependencies = [ - ("desecapi", "0030_blockedsubnet_blockedsubnet_subnet_idx"), - ] - - operations = [ - # # Explanation: https://adamj.eu/tech/2023/02/23/migrate-django-postgresql-ci-fields-case-insensitive-collation/ - # CreateCollation( - # "case_insensitive", - # provider="icu", - # locale="und-u-ks-level2", - # deterministic=False, - # ), - # migrations.AlterField( - # model_name="user", - # name="email", - # field=models.EmailField( - # db_collation="case_insensitive", - # max_length=254, - # unique=True, - # verbose_name="email address", - # ), - # ), - migrations.RunSQL( - sql='DROP EXTENSION IF EXISTS "citext"', - reverse_sql='CREATE EXTENSION IF NOT EXISTS "citext"', - ), - ] diff --git a/api/desecapi/migrations/0032_tokendomainpolicy_token_user_and_more.py b/api/desecapi/migrations/0032_tokendomainpolicy_token_user_and_more.py index 370878403..2bebbe3cf 100644 --- a/api/desecapi/migrations/0032_tokendomainpolicy_token_user_and_more.py +++ b/api/desecapi/migrations/0032_tokendomainpolicy_token_user_and_more.py @@ -7,7 +7,7 @@ class Migration(migrations.Migration): dependencies = [ - ("desecapi", "0031_alter_user_email"), + ("desecapi", "0001_squashed_0031_alter_user_email"), ] operations = [