Forums

Database reset after commit

Hi,

I have the following issue with my app: each time I push a commit, my sqlite database resets to an initial state in which I committed it some time ago. The changes do not persist. The database is not included in the commits (changes from my local machine are not reflected). Reloading the app from the Web tab does not trigger the database reset. Could you please point me to a solution to this problem? My post-receive hook is configured as described in the article and has additional collectstatic and migrate commands.

Regards,

Ekaterina

I think you may have the original database committed and, after you committed it, you added it to .gitignore. Try removing it from .gitignore and git rming it. Then re-add it to .gitignore.

Glenn,

Thank you for your suggestion, I think this is exaclty what happened. But I am afraid I am missing something simple. I have a gitignore file on the local machine. I could not locate one on PA. I have removed the database from gitignore, git rm-ed the database (removed the file). I then pushed a commit removing the database to PA, created a new database there and on the local machine, and added it to .gitignore on the local machine. With the next commit, the database reset again. Did I misunderstand some part of your advice? I must be missing some knowledge about git in general.

Regards,

Ekaterina

I missed in your first post that you're doing migrate as part of the post-receive hook. Is it possible that there's something wrong there and that your hook is causing the database reset?

Glenn,

I have removed this part of the hook, and the issue persists. Do you suppose deleting and re-creating the app would be an okay solution?

Ekaterina