Purpose and Use Cases of 'fake-initial' in Comparison to the 'fake flag'

I know what fake-initial does, but I can’t find a use case for it. Where we specifically need it instead of the fake flag. What is it used for exactly?

Maybe the docs can clear this up a bit:

--fake-initial

Allows Django to skip an app’s initial migration if all database tables with the names of all models created by all CreateModel operations in that migration already exist. This option is intended for use when first running migrations against a database that preexisted the use of migrations. This option does not, however, check for matching database schema beyond matching table names and so is only safe to use if you are confident that your existing schema matches what is recorded in your initial migration.

The important bit here is the following:

This option is intended for use when first running migrations against a database that preexisted the use of migrations.

As far as i know, its a historic feature which remains for upgrading systems which were created before the migration system existed.

1 Like