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

Migrations end up inside venv? #72

Closed
vidstige opened this issue May 4, 2018 · 7 comments
Closed

Migrations end up inside venv? #72

vidstige opened this issue May 4, 2018 · 7 comments
Assignees

Comments

@vidstige
Copy link

vidstige commented May 4, 2018

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
- Create model MessageLog
- Create model ScheduledTask

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
Copy link
Author

vidstige commented May 4, 2018

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
Copy link
Owner

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

@chris104957 chris104957 self-assigned this May 4, 2018
@vidstige
Copy link
Author

vidstige commented May 4, 2018

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
Copy link
Author

vidstige commented May 4, 2018

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
Copy link
Owner

We actually run makemigrations for carrot inside the docker image

@chris104957 chris104957 added the bug label May 8, 2018
chris104957 pushed a commit that referenced this issue May 8, 2018
- fixing #72
- Updating docs in relation to bug fix for #72
@chris104957
Copy link
Owner

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

@chris104957 chris104957 mentioned this issue May 8, 2018
@vidstige
Copy link
Author

vidstige commented May 8, 2018

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

chris104957 pushed a commit that referenced this issue Jun 27, 2018
- fixing #72
- Updating docs in relation to bug fix for #72
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants