question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Special key to ignore all migrations inside an app.

See original GitHub issue

It would be useful to have special key for ignoring all migrations inside an app.

Consider case when we have some third party apps and want to ignore all migrations or for all third party apps at all.

Right now we should do something like this:

DTM_IGNORED_MIGRATIONS = [
    ('taggit', '0002_auto_20150616_2121'),
    ('two_factor', '0002_auto_20150110_0810'),
    ('two_factor', '0003_auto_20150817_1733'),
    ('two_factor', '0004_auto_20160205_1827'),
    ('two_factor', '0005_auto_20160224_0450'),
    ('waffle', '0002_auto_20161201_0958'),
]

With the special key, for example, it’ll get much better:

THIRD_PARTY_APPS = (
    'taggit',
    'two_factor',
    'waffle',
)

# Apps specific for this project go here.
LOCAL_APPS = (
    'app_1',
    'app_2',
)

INSTALLED_APPS = THIRD_PARTY_APPS + LOCAL_APPS

DTM_IGNORED_MIGRATIONS = [
    (app, '*') for app in THIRD_PARTY_APPS
]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
timur-orudzhovcommented, Mar 24, 2020

I’ll try on next weekend.

1reaction
sobolevncommented, Mar 23, 2020

Yes! Great idea!

@timur-orudzhov are you willing to submit a fix?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ignore all current migrations and start from current model state ...
I'm assuming you want to "start fresh" when creating database in PostgreSQL, but still be able to use (or even update) your migrations...
Read more >
Django Tips #12 Disabling Migrations to Speed Up Unit Tests
One option is using the MIGRATION_MODULES setting, which is intended to define a custom name for an app's migration module. If you set...
Read more >
Migrations - Django documentation
Migrations ¶. Migrations are Django's way of propagating changes you make to your models (adding a field, deleting a model, etc.) into your...
Read more >
How to Use Django Migrations - Nick McCullum
You can skip to a specific section of this Django migrations tutorial using ... Django makes migrations for any changes done to the...
Read more >
EF Core tools reference (Package Manager Console)
NET Core CLI tools are cross-platform and run inside a command prompt. ... special case that means before the first migration and causes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found