You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to scrub the 3 customer DBs, but Django-scrubber doesn't let me do that. It would be nice to have a --database <db> option, or --all-databases
A workaround is to add this in my manage.py's main() function
if len(sys.argv) > 1 and sys.argv[1] == "scrub_data":
if "--database" in sys.argv:
from django.conf import settings
database_index = sys.argv.index("--database")
del sys.argv[database_index]
settings.DATABASES["default"] = settings.DATABASES[sys.argv[database_index]]
print(f"Scrubbing database {sys.argv[database_index]}")
del sys.argv[database_index]
then I execute: ./manage.py scrub_data --database customer1, etc.
it's working well, but it's a little ugly... would be nicer to have a clean support in django-scrubber :)
The text was updated successfully, but these errors were encountered:
sorry for the very very late response. Would you mind submitting a pull request with the necessary changes to support a database selection out of the box?
Description
I use multiple databases in my app -- and Django-scrubber only scrubs the default one.
What I Did
My app uses 3 DBs, with the same models, for different customers, so my settings (in dev -- copied from prod) have this:
I'd like to scrub the 3 customer DBs, but Django-scrubber doesn't let me do that. It would be nice to have a
--database <db>
option, or--all-databases
A workaround is to add this in my
manage.py
'smain()
functionthen I execute:
./manage.py scrub_data --database customer1
, etc.it's working well, but it's a little ugly... would be nicer to have a clean support in django-scrubber :)
The text was updated successfully, but these errors were encountered: