agusmakmun / agusmakmun/django-address-model

Migrations with automatic IDs

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14
Forks
4
PR merge metrics
No merged PRs in 30d

Description

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 2ebb8ce6eb1f19cfa2226c69d6e5e18c2e301e77 (with manual id field) to 87c52aaec97cbe25642c1ad24d562681193f1f61 (with automatic id field).

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.