Allow ignoring migrations from a specific application
See original GitHub issueIn our application, we’re using the waffle
feature-flag library. The first migration they define (0001_initial
) triggers warnings:
(waffle, 0001_initial)... WARNING
CREATE INDEX locks table
CREATE INDEX locks table
CREATE INDEX locks table
CREATE INDEX locks table
CREATE INDEX locks table
CREATE INDEX locks table
CREATE INDEX locks table
CREATE INDEX locks table
CREATE INDEX locks table
CREATE INDEX locks table
(waffle, 0002_auto_20161201_0958)... OK
(waffle, 0003_update_strings_for_i18n)... OK
As far as I can tell, the only way I can exclude this migration is by name (0001_initial
). However, other apps will use this 0001_initial
naming convention by default, as well.
It would be nice if we could somehow exclude this migration by name and app. That way, 0001_initial
in the specified app would not be included, but 0001_initial
in all other apps would be included.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Exclude an app from Django migrations - Stack Overflow
This answer is the right answer to specifically the question I asked. In my case however, I am using dynamic models.
Read more >How to fix/ignore pending migration in 3rd-party app?
Is there a workaround (even an ugly hack) I could use to tell makemigrations to ignore a specific app? I've tried using MIGRATION_MODULES ......
Read more >Enable Prisma to ignore specified / only look at ... - GitHub
Problem I am developing an application that uses Prisma to facilitate DB operations with DB/tables and I am using Prisma migrations to ...
Read more >Customize validation rules with ignoreMigrationPatterns
ignoreMigrationPatterns let's you specify classes of migration type and migration status to ignore during validate, but what if you need to ...
Read more >Tutorial: Use EF Migrations in an ASP.NET MVC app and ...
In this article · Prerequisites · Enable Code First migrations · Deploy to Azure · Advanced migrations scenarios · Update specific migration ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Why not, good suggestion 👍
Let’s reflect on that a little bit
👍 thanks for the response. If you’d be willing to make a breaking change, I wonder if you could change the way migrations are specified as parameters to
<appname>.<id>
.What might be nice about passing these as strings is you could allow passing regex-like strings as well. Then you wouldn’t have to have the somewhat duplicative
--ignore-name
--ignore-name-contains
flags. Using a regex would also invert the responsibility to the user to avoid overlap in how they’re including/excluding migrations.For example, this would cover my use case:
But you could also do other clever things like:
This syntax might be less user-friendly than the current options but would allow for a lot of flexibility. Just a thought 💡 🤔