On our staging server I ran bundle exec rake rather than the actual rake task I wanted to run. By default this runs the test suite, which in 'development' is completely fine. However, apparently on the staging server it ran the tests using the 'staging' database, therefore wiping all the data. Thankfully this isn't an issue at all but I want to know why it did this and how to stop is happening again; especially on the production server.
I know that the default rake task is test from this question but what I don't know is why it ran it on a database other than 'test'. I'd rather an error telling me there is 'no test database' rather than it running on the database for the current environment.
Aucun commentaire:
Enregistrer un commentaire