Is there a way to exclude models of an app from Django migrations? I know changing the model meta options with managed = False
is an option but that's a lot of models to edit every time. Is there a way to specify an app whose models I don't want to migrate?
migrate , which is responsible for applying and unapplying migrations. makemigrations , which is responsible for creating new migrations based on the changes you have made to your models.
To deal with such cases, Django provides a way called fake migration, which applies the migration but does not affect the database schema. In simpler words, for each migration which is faked, an entry is created in django_migrations table but no changes are done in the database schema.
remove the app from installed apps in your settings.
Removing the __init__.py
file from within the apps migrations directory should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With