From d36a37fd23de1b780e1aaa06fa900d088ac319f1 Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Tue, 2 Jul 2024 12:37:00 -0700 Subject: [PATCH] Clean up slightly incomplete migrations. Run valid migration command. --- morango/apps.py | 1 + .../0001_squashed_0024_auto_20240129_1757.py | 27 +++---------------- tox.ini | 2 +- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/morango/apps.py b/morango/apps.py index 2d78870..d3f73fb 100644 --- a/morango/apps.py +++ b/morango/apps.py @@ -7,6 +7,7 @@ class MorangoConfig(AppConfig): name = "morango" verbose_name = "Morango" + default_auto_field = "django.db.models.AutoField" def ready(self): from morango.models.signals import add_to_deleted_models # noqa: F401 diff --git a/morango/migrations/0001_squashed_0024_auto_20240129_1757.py b/morango/migrations/0001_squashed_0024_auto_20240129_1757.py index 34ab977..193fd77 100644 --- a/morango/migrations/0001_squashed_0024_auto_20240129_1757.py +++ b/morango/migrations/0001_squashed_0024_auto_20240129_1757.py @@ -1,12 +1,9 @@ # Generated by Django 3.2.24 on 2024-06-25 21:45 -import datetime - import django.db.models.deletion import django.db.models.manager import django.utils.timezone from django.db import migrations from django.db import models -from django.utils.timezone import utc import morango.models.fields.crypto import morango.models.fields.uuids @@ -129,9 +126,6 @@ class Migration(migrations.Migration): ( "source_id", models.CharField( - default=datetime.datetime( - 2017, 10, 18, 21, 15, 6, 842850, tzinfo=utc - ), max_length=96, ), ), @@ -166,17 +160,13 @@ class Migration(migrations.Migration): ( "connection_kind", models.CharField( - choices=[("network", "Network"), ("disk", "Disk")], - default="", + choices=[('network', 'Network'), ('disk', 'Disk')], max_length=10, ), ), ( "connection_path", models.CharField( - default=datetime.datetime( - 2017, 10, 18, 21, 15, 21, 147686, tzinfo=utc - ), max_length=1000, ), ), @@ -186,9 +176,6 @@ class Migration(migrations.Migration): ( "profile", models.CharField( - default=datetime.datetime( - 2017, 10, 18, 21, 15, 27, 811735, tzinfo=utc - ), max_length=40, ), ), @@ -220,9 +207,6 @@ class Migration(migrations.Migration): "last_activity_timestamp", models.DateTimeField( blank=True, - default=datetime.datetime( - 2017, 10, 18, 21, 15, 30, 154629, tzinfo=utc - ), ), ), ("client_fsic", models.TextField(blank=True, default="{}")), @@ -338,10 +322,10 @@ class Migration(migrations.Migration): "private_key", morango.models.fields.crypto.PrivateKeyField(blank=True, null=True), ), - ("lft", models.PositiveIntegerField(db_index=True, editable=False)), - ("rght", models.PositiveIntegerField(db_index=True, editable=False)), + ("lft", models.PositiveIntegerField(editable=False)), + ("rght", models.PositiveIntegerField(editable=False)), ("tree_id", models.PositiveIntegerField(db_index=True, editable=False)), - ("level", models.PositiveIntegerField(db_index=True, editable=False)), + ("level", models.PositiveIntegerField(editable=False)), ( "parent", models.ForeignKey( @@ -550,9 +534,6 @@ class Migration(migrations.Migration): ( "source_id", models.CharField( - default=datetime.datetime( - 2017, 10, 18, 21, 13, 11, 488565, tzinfo=utc - ), max_length=96, ), ), diff --git a/tox.ini b/tox.ini index ec4d522..12c95d0 100644 --- a/tox.ini +++ b/tox.ini @@ -27,7 +27,7 @@ deps = -r{toxinidir}/requirements/test.txt cryptography40.0.2: cryptography==40.0.2 commands = - sh -c '! tests/testapp/manage.py makemigrations --dry-run --exit --noinput' + sh -c 'tests/testapp/manage.py makemigrations --check' python -O -m pytest {posargs:--cov=morango --color=no} [testenv:postgres]