chris104957 / django-carrot

A lightweight task queue for Django using RabbitMQ
https://django-carrot.readthedocs.io/
Apache License 2.0
70 stars 16 forks source link

Migrations end up inside venv? #72

Closed vidstige closed 6 years ago

vidstige commented 6 years ago

I installed djang-carrot package, added it to installed apps and ran python manage.py makemigrations, but the migrations ended up inside the virtual environment... Why is that?

$ python manage.py makemigrations carrot Migrations for 'carrot': venv/lib/python3.6/site-packages/carrot/migrations/0001_initial.py

The problem is, as the virtual environment is not checked in to source controll I cannot check in the migration, which normally how things are done in Django. What's the thought here? What I'm I doing wrong?

vidstige commented 6 years ago

Apparently, you need to do the following. Perhaps something for the "Getting Started" section of the documentation to ensure that sweet flying start for peoples.

MIGRATION_MODULES = {'carrot': 'to_module.folder_migrations'}
chris104957 commented 6 years ago

that's weird, I had no idea. Will get the docs updated ASAP. We run it mostly in containers here so I haven't seen that before

vidstige commented 6 years ago

I see. But how do you create the migration? Inside the container and then copy it outside to check it in? Or do you check it in from the container.. Seems cumbersome.

vidstige commented 6 years ago

I created the django-carrot tag on stack overflow. We'll see if it survives. :)

https://stackoverflow.com/questions/50167465/migrations-ends-up-inside-virtual-environment

chris104957 commented 6 years ago

We actually run makemigrations for carrot inside the docker image

chris104957 commented 6 years ago

I looked into this a bit more and now believe that the correct course of action is to include the migrations in the installation. This is now done in 3c20965, version 1.1.1. Docs have been updated to confirm that the carrot migrations now only need to be applied, not created

vidstige commented 6 years ago

That makes sense, will try that out. Thanks for looking into this. 🙇