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

Model changes detected depending on settings #53

Open
lorinkoz opened this issue May 2, 2020 · 0 comments
Open

Model changes detected depending on settings #53

lorinkoz opened this issue May 2, 2020 · 0 comments

Comments

@lorinkoz
Copy link

lorinkoz commented May 2, 2020

First of all, thanks for this great package. This has become super complementary with django-tenants or django-pgschemas.

I happen to use different storages in local development and production. For local development I keep the default file system private storage, while for production I am using a customization of the S3 boto3 file storage.

Because of the way in which the storage is set here:

kwargs.setdefault('storage', private_storage)

I am always getting a minor complain from Django in production that I have changes in my models that need migration. The change is basically shifting the file system storage, which is in my migrations, versus the S3 boto3 file storage which is then active.

This is actually a minor thing, nothing breaks here, it's only a polishing request. As a general rule, I think Django models should be done in a way that changing settings doesn't generate new migrations. I wonder if you would be okay to change the linked behavior and use a function instead, which could in turn return the exact same value that is being set here. I think that by using a function, Django won't detect any change in settings and won't think that there is a migration required.

I could open a PR for this if approved. Thanks!

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

1 participant