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

Migrations with automatic IDs #3

Open
qwenger opened this issue Dec 1, 2020 · 0 comments
Open

Migrations with automatic IDs #3

qwenger opened this issue Dec 1, 2020 · 0 comments

Comments

@qwenger
Copy link

qwenger commented Dec 1, 2020

Hi,

When I run manage.py makemigrations on my project that uses django-address-model, django wants to create a migration for the package:

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('django_address', '0001_initial'),
    ]

    operations = [
        migrations.AlterField(
            model_name='country',
            name='id',
            field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
        ),
        migrations.AlterField(
            model_name='district',
            name='id',
            field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
        ),
        migrations.AlterField(
            model_name='province',
            name='id',
            field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
        ),
        migrations.AlterField(
            model_name='subdistrict',
            name='id',
            field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
        ),
    ]

The problem seems to be that you forgot auto_created and verbose_name when changing the migration file from 2ebb8ce (with manual id field) to 87c52aa (with automatic id field).

You may need to adapt 0001_initial or add a new migration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant