I dropped a table manually cause while changing the model I made a very bad mistake. So anyway ... how can I recreate it ? I have tried :
- Delete the migrate folder of that app
- delete from django_migrations where app='main'
- makemigrations main
- migrate main
But it stops at the first table. Which is there :-( and my Table message in that case is not recreated. In 0001_initial.py I have the correct entry for my table
migrations.CreateModel(
name='Message',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('unread', models.BooleanField(default=True)),
('subject', models.CharField(max_length=120)),
('freetext', models.TextField(null=True)),
('from_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='from_user', to=settings.AUTH_USER_MODEL)),
('to_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='to_user', to=settings.AUTH_USER_MODEL)),
],
),
Is there way to start this manually ?