mercredi 15 juillet 2015

ruby on rails loosing data even with git control

Today i lost all the db data of my app (not the table, but the actual stuff in it) and i am asking myself a few question.

But first here a quick summary of what happened.

nb : i am using cloud9/rails app with sqlite.

1) starting to work on a new controller/model combo so i make a new branch with git

2) Major screw up on my branch, the more i fix the more i destroy.

3) checking out of the branch to master and destroy the branch (i didn't commit anything)

4) i notice that i still have the modified file in my workspace so i use the git clean command (don't remember exactly which option i used)

5) nothing is working anymore on my app. so i "revert" to an earlier commit.

6) everything is working again but i my DB is empty...not that the data are important (most of the data is ipso lorem plus a few integer) but i want to try to retrieve them anyway.

7) i fetch from bitbucket and reset hard to origin. the app is working but still no data.

So my questions are :

Where the db data are kept with ruby on rails ? - git control don't save db data ? - is there a way to recover the data ? if not : can i save the db date someway and fetch it in case of problem -what going to happen in the future, each time i screw up i lost all data ?

ps: the data in itself is not that matters, its more the behavior i am trying to understand. Thx for reading and sorry for my english.

Aucun commentaire:

Enregistrer un commentaire