Defect #3420
closed
Default rake task can destroy data
Added by mathew murphy over 15 years ago.
Updated almost 15 years ago.
Description
I performed a RedMine update via SVN, but I couldn't remember the rake task name for the database updates. I ran rake with no arguments, hoping for some helpful text.
Instead, rake blew away my production database in order to perform some unit tests.
Needless to say, I think this is less than optimal behavior. It's a good job I had a backup, or I'd probably be badmouthing RedMine all over the Internet at this point...
Tests will clear the test database, not your production database, unless you have configured the same database for tests and production in your database.yml file.
True, but it's probably not unusual for people to set up a database, run the tests, then start using the system with the same database rather than deleting it and creating a whole new one.
So I still think it's unwise and unexpected for the default rake task to modify data.
My expectation is that you would run tests by doing 'rake test', and that 'rake' on its own would provide information about what targets/tasks are available... especially since 'rake help' doesn't provide anything helpful.
- Status changed from New to Closed
- Resolution set to Wont fix
This is the Rails behaviour. The default rake task is test.
To get a list of available tasks, use:
rake --tasks
Also available in: Atom
PDF