From 0913df3c01e857ba0c8119163241f110f4ac1605 Mon Sep 17 00:00:00 2001 From: Kevin Marsh Date: Tue, 30 Jan 2024 11:05:22 -0800 Subject: [PATCH 1/3] GH actions: check that there's no missing migrations --- .github/workflows/python-package.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4f908996..b4f90e5f 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -72,6 +72,9 @@ jobs: - name: Lint with flake8 run: | flake8 + - name: Check no missing migrations + run: | + tests/manage.py makemigrations --check - name: Test with unittest run: | coverage run tests/manage.py test tests From c8459e6b325b45f73ff284e6db2e65a837a7df54 Mon Sep 17 00:00:00 2001 From: Kevin Marsh Date: Tue, 30 Jan 2024 10:44:01 -0800 Subject: [PATCH 2/3] migrations: add missing verbose_name options from previous PR --- .../migrations/0001_squashed_0004_auto_20160611_1202.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reversion/migrations/0001_squashed_0004_auto_20160611_1202.py b/reversion/migrations/0001_squashed_0004_auto_20160611_1202.py index 8e122383..afb1618c 100644 --- a/reversion/migrations/0001_squashed_0004_auto_20160611_1202.py +++ b/reversion/migrations/0001_squashed_0004_auto_20160611_1202.py @@ -23,7 +23,9 @@ class Migration(migrations.Migration): ('user', models.ForeignKey(blank=True, help_text='The user who created this revision.', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='user')), ], options={ - "ordering": ("-pk",) + "ordering": ("-pk",), + 'verbose_name': 'revision', + 'verbose_name_plural': 'revisions', }, ), migrations.CreateModel( @@ -39,7 +41,9 @@ class Migration(migrations.Migration): ('db', models.CharField(help_text='The database the model under version control is stored in.', max_length=191)), ], options={ - "ordering": ("-pk",) + "ordering": ("-pk",), + 'verbose_name': 'version', + 'verbose_name_plural': 'versions', }, ), migrations.AlterUniqueTogether( From d86ddb65d3cebc179c85fbc99bf5d865ad701efa Mon Sep 17 00:00:00 2001 From: Kevin Marsh Date: Tue, 30 Jan 2024 11:08:32 -0800 Subject: [PATCH 3/3] migrations: add missing migration in test suite --- .../0002_alter_testmodel_related_and_more.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/test_app/migrations/0002_alter_testmodel_related_and_more.py diff --git a/tests/test_app/migrations/0002_alter_testmodel_related_and_more.py b/tests/test_app/migrations/0002_alter_testmodel_related_and_more.py new file mode 100644 index 00000000..d02186f9 --- /dev/null +++ b/tests/test_app/migrations/0002_alter_testmodel_related_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 5.0.1 on 2024-01-30 19:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('test_app', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='testmodel', + name='related', + field=models.ManyToManyField(blank=True, related_name='+', to='test_app.testmodelrelated'), + ), + migrations.AlterField( + model_name='testmodel', + name='related_through', + field=models.ManyToManyField(blank=True, related_name='+', through='test_app.TestModelThrough', to='test_app.testmodelrelated'), + ), + ]