{{{
manage.py migrate --fake
}}}
This printed the message that the migration was faked. After this, when I
actually tried to apply the migration with
{{{
manage.py migrate
}}}
I got a message `No migrations to apply`. (Indeed --list showed that the
migration was applied). I dumped the database and found that the migration
was marked as applied (in `django_migrations` table &
`django_migrations_id_seq` was incremented). However the actual change
that the migration was intended for, was not applied to the database.
I've tested this on PgSQL 9.4 & Django 1.7.
--
Ticket URL: <https://code.djangoproject.com/ticket/25888>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_docs: => 0
Comment:
This is intended behavior:
{{{
python manage.py help migrate
...
--fake Mark migrations as run without actually running
them.
...
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25888#comment:1>
Comment (by jarshwah):
If you're looking to test the output of the migration perhaps you might
want to use the sqlmigrate command
https://docs.djangoproject.com/en/dev/ref/django-admin/#sqlmigrate-app-
label-migrationname
--
Ticket URL: <https://code.djangoproject.com/ticket/25888#comment:2>
Comment (by mandm):
Is there a way to undo `--fake` for manually created migrations file (if
`reverse_sql` isn't available) ?
--
Ticket URL: <https://code.djangoproject.com/ticket/25888#comment:3>
Comment (by shaib):
You can use `--fake` also when migrating backwards, thus undoing your
original `--fake` (but beware if you have other migrations depending on
your migration). How you created the migration file is irrelevant.
In the future, please use the designated support channels (IRC channel
#django on freenode, or django-users mailing list) rather than the bug
tracker for this kind of question.
--
Ticket URL: <https://code.djangoproject.com/ticket/25888#comment:4>