Issue
I'm building a Django app from an existing database. The existing database is all set up and working as I need it to.
The models for this existing project were automatically placed in my project directory.
Here is a rough idea of the relevant directories:
myProject
| manage.py
| myProject
| | models.py <- auto generated models were placed here (also new models here)
| app1
| | models.py
| | migrations
I figured my new models would be accessed by all apps I install, so I've included some more models in the same models.py as the auto generated one.
Running makemigrations does not seem to pick up any changes I've made. (I've even included 'myProject' in installed apps)
How do I migrate these changes?
Solution
You have to add a __init__.py
to your migrations folder to make new migrations.__init__.py
makes your migrations folder a module thus it can be identified by Django for new migrations.
Answered By - Arpit Solanki
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.