fix(src): commit migration files to prevent InconsistentMigrationHistory
Remove src/*/migrations/ from .gitignore and commit all generated migration files. The admin.0001_initial migration uses swappable_dependency(AUTH_USER_MODEL) which requires accounts.0001_initial to exist before admin migrations can be applied. Without committed migration files, running migrate before makemigrations causes admin to apply first (since accounts appears to have no migrations), leading to an InconsistentMigrationHistory error when makemigrations is run later. This follows Django's recommended workflow of committing migrations.
This commit is contained in:
15 files changed
+530
-3
No files matched your search
@@ -0,0 +1,37 @@
|
||||
# Generated by Django 6.0.6 on 2026-06-28 12:27
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('projects', '0001_initial'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ProjectNote',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=255)),
|
||||
('content', models.TextField(blank=True, null=True)),
|
||||
('note_date', models.DateField()),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='project_notes', to=settings.AUTH_USER_MODEL)),
|
||||
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notes', to='projects.project')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Project Note',
|
||||
'verbose_name_plural': 'Project Notes',
|
||||
'db_table': 'project_notes',
|
||||
'indexes': [models.Index(fields=['project', 'note_date'], name='project_not_project_833ff9_idx')],
|
||||
},
|
||||
),
|
||||
]
|
||||
Whitespace-only changes.
Reference in new issue
Block a user