Using Django 1.7 migrations.
I accidentally dropped a table in my database. I assumed that by running migration again this would recreate the table but no, Django st
Probably the simplest way to do it.
e.g. if the file you want to migrate is app_name.002_xyz
, and your latest migration file is app_name.004_abc
Then you need to make a copy of app_name.002_xyz
and rename it as the latest migration file. For example, let's rename it to app_name.005_xyz
e.g. add this line to the new migration file
class Migration(migrations.Migration):
dependencies = [
('app_name', 'app_name.004_abc'),
]
...
e.g. add this line to the new migration file
python manage.py migrate app_name
e.g.
Running migrations:
Applying app_name.005_xyz...OK
app_name.005_xyz
and you're good!