I'm having trouble with my database at Heroku:
I've added some models for my App and whenever I run makemigrations it detects those changes. However when I run migrate it only says no migrations to apply. Please help!
I'm having trouble with my database at Heroku:
I've added some models for my App and whenever I run makemigrations it detects those changes. However when I run migrate it only says no migrations to apply. Please help!
I'VE FINALLY FIXED IT!!! This is what I did:
First I did a backup Download by heroku pg:backups:restore capture
then heroku pg:backups:restore download it made a "latest.dump" file
then I used heroku pg:reset it deleted the recent database of host
then I applied my fixes on my models and forms new fields has to have "defaults=None" for models with Data you want to preserve (If you won't do this, the merge for this model won't take effect and will be cancelled)
then I run heroku run bash run python manage.py makemigrations appname then migrate
and then used "pg_restore --verbose --clean --no-acl --no-owner -h yourDBhost -U yourDBuser -d yourDBname latest.dump" (Your database credentials will be found on your postgresql addon settings) and then type or copy-paste yourDBpassword(from credentials also) to merge the backed up database with the new one with changes
and know it's done and perfectly working!