Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touches migrations inside site-packages #12

Closed
stianjensen opened this issue Jan 2, 2023 · 4 comments
Closed

Touches migrations inside site-packages #12

stianjensen opened this issue Jan 2, 2023 · 4 comments

Comments

@stianjensen
Copy link

This command works great, and is just what I was looking for to workaround shortcomings in the normal sqlashmigrations command.
I was quite surprised to find it tried to squash migrations inside my virtualenv, though. I have a lot of different packages there with migrations, and I also have a lot of self-authored apps, so both --ignore-app and --only will require a long list of apps (that also needs to be updated over time).
Would it be possible to find some other way to automatically ignore all apps inside site-packages?

@kingbuzzman
Copy link
Owner

kingbuzzman commented Jan 2, 2023

This command works as closely to makemigrations as can possibly be. Keep in mind there is a settings level variable you can set so you don’t have remember and have to run it with —ignore-app every time called DJANGO_SQUASH_IGNORE_APPS found here.

If you have a suggestions, @philfriesen and I are all ears. What we currently have works for us, if you want any changes we will evaluate all PRs presented.

@stianjensen
Copy link
Author

Thanks! I'll try maintaining a list for ignore_app for now. Will look into creating a PR for excluding all apps in a subdirectory or something 👍

@kingbuzzman
Copy link
Owner

kingbuzzman commented Jan 4, 2023

You can always do something like:

MY_APPS = ['a', 'b', 'c']
DJANGO_APPS = ['da', 'db', 'dc']
THIRD_PARTY_APPS = ['tpa', 'tpb', 'tpc']

INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + MY_APPS

DJANGO_SQUASH_IGNORE_APPS = DJANGO_APPS + THIRD_PARTY_APPS

just a suggestion

@kingbuzzman
Copy link
Owner

Closing for now, seems stale, and solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants