vendredi 19 février 2016

How to remain sqlite db file on heroku server as is, instead of overwritten by local db?

I have a Django app with a sqlite3 db.

At first, I push all the files in Django project (include db.sqlite3) to heroku master. Then, every time I deploy a new version, the local db.sqlite3 overwrites the one on the server, hence the production data is lost. I read about this question Preserve .sqlite with git push and added *.sqlite3 in .gitignore, and did

git rm db.sqlite3

I also did

git update-index --assume-unchanged db.sqlite3

But when I push to heroku, it seems the db.sqlite3 is removed on heroku server, instead of leave it as is. I tried to find a way to leave the production db.sqlite3 as is, but haven't be able to.

How can I achieve this?

Aucun commentaire:

Enregistrer un commentaire