Skip to content

Commit

Permalink
Merge pull request #961 from kevinmarsh/ci/add-check-for-missing-migr…
Browse files Browse the repository at this point in the history
…ations

GH actions: add check for missing migrations (and fix migrations)
  • Loading branch information
etianen authored Jan 30, 2024
2 parents c641d3d + d86ddb6 commit dd7872b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions reversion/migrations/0001_squashed_0004_auto_20160611_1202.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down
23 changes: 23 additions & 0 deletions tests/test_app/migrations/0002_alter_testmodel_related_and_more.py
Original file line number Diff line number Diff line change
@@ -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'),
),
]

0 comments on commit dd7872b

Please sign in to comment.