As the title says, I can\'t seem to get migrations working.
The app was originally under 1.6, so I understand that migrations won\'t be there initially, and indeed i
Maybe that can help someone, I had the same problem.
I've already created two tables with the serializer class and the views. So when I wanted to updated, I had this error.
I followed this steps:
.\manage.py makemigrations app
.\manage.py migrate
models.py
1
and 2
.models.py
5
.If you're working with Pycharm, local history is very helpfull.
Adding this answer because only this method helped me.
I deleted the migrations
folder run makemigrations
and migrate
.
It still said: No migrations to apply.
I went to migrate
folder and opened the last created file,
comment the migration I wanted(It was detected and entered there)
and run migrate
again.
This basically editing the migrations file manually.
Do this only if you understand the file content.
Did u use schemamigration my_app --initial
after renaming old migration folder? Try it. Might work. If not - try to recreate the database and make syncdb+migrate. It worked for me...
I had the same problem with having to run makemigrations twice and all sorts of strange behaviour. It turned out the root of the problem was that I was using a function to set default dates in my models so migrations was detecting a change every time I ran makemigrations. The answer to this question put me on the right track: Avoid makemigrations to re-create date field
The answer is on this stackoverflow post, by cdvv7788 Migrations in Django 1.7
If it is the first time you are migrating that app you have to use:
manage.py makemigrations myappname Once you do that you can do:
manage.py migrate If you had your app in database, modified its model and its not updating the changes on makemigrations you probably havent migrated it yet. Change your model back to its original form, run the first command (with the app name) and migrate...it will fake it. Once you do that put back the changes on your model, run makemigrations and migrate again and it should work.
I was having the exact same trouble and doing the above worked perfectly.
I had moved my django app to cloud9 and for some reason I never caught the initial migration.