Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH actions: add check for missing migrations (and fix migrations) #961

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'),
),
]
Loading