Opened 6 years ago

Closed 6 years ago

#30174 closed Bug (duplicate)

Forgotten migrations in Django 2.1.6

Reported by: Michiel Holtkamp Owned by: nobody
Component: contrib.auth Version: 2.1
Severity: Normal Keywords: 2.1.6 migration auth
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Unless I'm mistaken, I think models were changed from 2.1.5 to 2.1.6 but new migration files were not created.

This currently breaks our build because we check for 'forgotten' migrations, so we have to stick to 2.1.5 or change our check to exclude this migration.

Steps to reproduce

python3 -m venv venv
source venv/bin/activate
pip install django
django-admin startproject mwe
cd mwe
python manage.py makemigrations

Result

Migrations for 'auth':
  /Users/michiel/tmmmp/venv/lib/python3.6/site-packages/django/contrib/auth/migrations/0012_auto_20190211_1115.py
    - Alter field name on group

Expected result

No changes detected

Suggested fix

run 'makemigrations', commit the file and re-publish :-)

Change History (5)

comment:1 by Ewald Moitzi, 6 years ago

Version 1.11.19 is also affected:

Migrations for 'admin':
  /var/lib/python3.6/site-packages/django/contrib/admin/migrations/0004_auto_20190211_1249.py
    - Alter field action_flag on logentry
Migrations for 'auth':
  /var/lib/python3.6/site-packages/django/contrib/auth/migrations/0012_auto_20190211_1249.py
    - Alter field name on group
    - Alter field last_name on user

comment:2 by Bruno Alla, 6 years ago

I noticed the same problem, but looking at the diff on GitHub, there doesn't seem to be any model change:
https://github.com/django/django/compare/2.1.5...2.1.6

Was the wrong release published as 2.1.6?

Last edited 6 years ago by Bruno Alla (previous) (diff)

in reply to:  2 comment:3 by Ewald Moitzi, 6 years ago

Replying to Bruno Alla:

I noticed the same problem, but looking at the diff on GitHub, there doesn't seem to be any model change:
https://github.com/django/django/compare/2.1.5...2.1.6

Was the wrong release published as 2.1.6?

Looks like it, the missing auth migration for 1.11 wants to undo a change that was made in the master branch
(https://github.com/django/django/commit/e81955401885a93a459bcc130642b6ea5bf4ba4d#diff-49fc6cea24d46bdb27339c1aab392e32):

class Migration(migrations.Migration):

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.AlterField(
            model_name='group',
            name='name',
            field=models.CharField(max_length=80, unique=True, verbose_name='name'),
        ),
        migrations.AlterField(
            model_name='user',
            name='last_name',
            field=models.CharField(blank=True, max_length=30, verbose_name='last name'),
        ),
    ]

comment:4 by David Viktora, 6 years ago

2.0.11 is affected as well - that means all the versions released today.

Migrations for 'admin':                                                                                                                                                                            
  /home/me/.virtualenvs/cms/lib/python3.7/site-packages/django/contrib/admin/migrations/0004_auto_20190211_1228.py                                                                
    - Alter field action_flag on logentry
Migrations for 'auth':
  /home/me/.virtualenvs/cms/lib/python3.7/site-packages/django/contrib/auth/migrations/0012_auto_20190211_1228.py
    - Alter field name on group

comment:5 by Tim Graham, 6 years ago

Resolution: duplicate
Status: newclosed

Consolidating with #30175.

Note: See TracTickets for help on using tickets.
Back to Top